From 3a71fa8fba68982c33705722a174367b2d29b30a Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:14:38 +0100 Subject: [PATCH 1/6] =?UTF-8?q?feat(idiom):=20fold=20boolean=20negations?= =?UTF-8?q?=20=E2=80=94=20`cmp=20^=201`,=20`cmp=20=3D=3D=200`,=20`cmp=20!?= =?UTF-8?q?=3D=200`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An `icmp_*` result is 0 or 1 by construction, so xoring the low bit or testing it against zero is exactly negation. A compiler with no set-on-greater-equal spells a materialised `a >= b` that way: MIPS `slt v0,a0,a1; xori v0,v0,1` (IDO and both GCCs), and the branch form `… ; beqz v0` when the boolean is then tested. The naive lift printed the double negatives `a0 < a1 ^ 1` and `a0 >= a1 == 0`, and hid the comparison from every consumer that reasons about booleans — the short-circuit recognizer matches an `icmp` feeder, not an `xor` or an `icmp_eq` of one. xor(cmp, 1) → !cmp icmp_eq(cmp, 0) → !cmp icmp_ne(cmp, 0) → cmp Ported as an IDEA from m2c `40cbae3` (which extended its MIPS/PPC `handle_xori` fold to ARM); the implementation is asmlift's own — thirty data patterns in the idiom layer, since a data-driven fold needs a fixed replacement opcode, so the negation table is unrolled rather than expressed as a computed-opcode replacement. `icmp_eq`/`icmp_ne` also join the engine's COMMUTATIVE set: `x == 0` and `0 == x` are the same test and which one a frontend builds is an accident of decoding. These are the first UNGATED patterns in the bundle, and the difference is principled. The compiler-pinned folds trade one spelling for another and are only byte-safe where measured; here the SHAPE IS ITS OWN GATE — the pattern can only fire where the compiler emitted the flip, and wherever it did, the negated comparison is what it was spelling. A compiler with a set-on-greater-equal never produces the shape and so can never be harmed. (Four prose sites claiming every default pattern is `{compilers}`-gated are corrected; the mwcc half of that claim was already stale.) The negation now comes from ONE table (`ir/opcodes.ts` NEGATED_ICMP, expanded from five involutive pairs so `neg(neg(c)) === c` holds by construction). The MIPS `slt …; beqz` branch fold and the short-circuit diamond negation each carried their own copy; all three now read the shared one. A test asserts its completeness against the registry's icmp family — the part construction cannot give, and an eleventh comparison would otherwise degrade three consumers three different ways. Benchmark: **synthetic:clampu8:ido7.1 flips nonmatch → MATCH, asmlift 360 → 361** (m2c 342 unchanged). Its `slti at,a0,256` and `bnez at` sit in DIFFERENT blocks, so the frontend's own compare-branch peephole cannot fuse them — that peephole is block-local and register-keyed, and the SSA-level idiom has neither limit. This is the argument for doing it at this layer, stated as a measurement. Round-trip evidence: synthetic:inrange:gcc2.7.2kmc stays byte-exact MATCH while its source goes from `(a0 < a1 ^ 1) & (a2 < a0 ^ 1)` to `a0 >= a1 & a2 >= a0`. Co-Authored-By: Claude Opus 5 (1M context) --- docs/asmlift-101.md | 5 +- packages/cli/test/matching/fixtures.ts | 4 +- packages/core/README.md | 2 +- packages/core/src/ir/opcodes.ts | 32 +++++++ packages/core/src/pattern/engine.ts | 96 ++++++++++++++++++- packages/core/src/raise/shortcircuit.ts | 25 ++--- packages/core/test/pattern.test.ts | 117 +++++++++++++++++++++++- 7 files changed, 251 insertions(+), 30 deletions(-) diff --git a/docs/asmlift-101.md b/docs/asmlift-101.md index 46ef3d94..d642a966 100644 --- a/docs/asmlift-101.md +++ b/docs/asmlift-101.md @@ -236,8 +236,9 @@ enormously for retro consoles: Simpler idioms (power-of-two division via shifts — the `half` example in Part III — multiply strength-reduction, width casts) are expressed as **rewrite patterns as data** ([`pattern/engine.ts`](../packages/core/src/pattern/engine.ts)): serializable objects saying -"this DAG (directed-acyclic-graph) shape of operations becomes this op", each gated to the -compilers that emit it. Data, not code, so +"this DAG (directed-acyclic-graph) shape of operations becomes this op", most of them gated to +the compilers that emit them (a few, like `cmp ^ 1` → `!cmp`, are identities that hold +everywhere). Data, not code, so that an automated loop can eventually _propose_ new patterns and have the oracle validate them. ### 2.6 Types as ranked candidates, judged by the differ diff --git a/packages/cli/test/matching/fixtures.ts b/packages/cli/test/matching/fixtures.ts index d5495636..15d9ff2a 100644 --- a/packages/cli/test/matching/fixtures.ts +++ b/packages/cli/test/matching/fixtures.ts @@ -398,8 +398,8 @@ export const FIXTURES: DecompFixture[] = [ // ── Default idiom bundle (no `patterns` key = the benchmark path) ───────────────────── // These pin that the DEFAULT bundle fires: `decompile()` with no opts.patterns applies - // DEFAULT_IDIOM_PATTERNS, each `{compilers}`-gated so one global bundle self-selects per - // target. A revert to default-off breaks the `expectPatternHits` here. (The `patterns: []` + // DEFAULT_IDIOM_PATTERNS, mostly `{compilers}`-gated so one global bundle self-selects per + // target (the boolean-negation folds are ungated — their shape is its own gate). A revert to default-off breaks the `expectPatternHits` here. (The `patterns: []` // opt-out baseline is pinned by matching/m2.test.ts.) { // agbcc has no hardware divide → `x/2` lowers to `lsr#31;add;asr#1`; without the fold the diff --git a/packages/core/README.md b/packages/core/README.md index 459c5c1b..de6173e7 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -38,7 +38,7 @@ Input is **text**, following what each target's toolchain produces: | Option | Meaning | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `backend` | `cBackend` (default) or `pascalBackend` — values from `@asmlift/core/backend/*`. C++ is `cppBackend(spec)`, a per-function factory: it takes a `CppFnSpec` (class/method name, explicit param types, class field layouts — what a project's headers supply) and covers free and non-virtual member functions with word-sized fields; virtual dispatch, references, ctors/dtors decline | -| `patterns` | Idiom rewrite patterns. Omitted = `DEFAULT_IDIOM_PATTERNS` (each gated per compiler); `[]` = none | +| `patterns` | Idiom rewrite patterns. Omitted = `DEFAULT_IDIOM_PATTERNS` (self-selects per target: most are compiler-gated, the boolean-negation folds are universal); `[]` = none | | `prototypes` | Callee arities + void-ness, as a real project takes them from headers — drives call-argument recovery | | `asmData` | Optional `objdump -s -r -t` side-table; required to recover MIPS/PPC jump-table switches | | `onGap` | `"strict"` (default): throw on any gap. `"annotate"`: emit best-effort source with `ASMLIFT_ERROR` markers; every gap is also returned in the structured `diagnostics` array (empty ⇔ gap-free) | diff --git a/packages/core/src/ir/opcodes.ts b/packages/core/src/ir/opcodes.ts index 0110b1b1..4a0b9341 100644 --- a/packages/core/src/ir/opcodes.ts +++ b/packages/core/src/ir/opcodes.ts @@ -130,6 +130,38 @@ export function opSig(opcode: string): OpSig | undefined { return (OPCODES as Record)[opcode]; } +/** The comparison whose result is the logical NEGATION of each `icmp_*` — `!(a < b)` is `a >= b`. + * + * Unlike EFFECTFUL_OPS/HOIST_UNSAFE_OPS below, this is AUTHORED data seated beside the registry, + * not a view derived from it: nothing in `OPCODES` states which comparison opposes which. What is + * derived is its SYMMETRY — the five involutive pairs are expanded both ways, so `neg(neg(c)) === c` + * holds by construction (a hand-written map is one typo away from breaking it, and the symptom is a + * plainly inverted condition in the emitted C). Completeness against the icmp family is the part + * construction cannot give, so a test asserts it (test/pattern.test.ts) — an eleventh comparison + * added to `OPCODES` would otherwise degrade three consumers three different ways. + * + * It lives here for the reason HOIST_UNSAFE_OPS does: every consumer that has to say "the opposite + * of this compare" reads THIS one — the MIPS frontend's `slt …; beqz` branch-when-false fold, the + * short-circuit recognizer's diamond negation, and the idiom layer's `cmp ^ 1` fold — so they + * cannot drift apart the way inline copies did. Two adjacent facts worth knowing: raise/ + * shortcircuit.ts derives its `BOOL_OPS` from these keys (asserting negatable-icmp == boolean-op, + * true today), and l3/ast.ts `NEGATE_REL` is the SAME relation over the neutral L3 operator + * vocabulary — deliberately separate, because signedness lives in the operand types there, so the + * two tables are not candidates for further consolidation. */ +const ICMP_NEGATION_PAIRS: readonly (readonly [Opcode, Opcode])[] = [ + ['icmp_eq', 'icmp_ne'], + ['icmp_slt', 'icmp_sge'], + ['icmp_sgt', 'icmp_sle'], + ['icmp_ult', 'icmp_uge'], + ['icmp_ugt', 'icmp_ule'], +]; +export const NEGATED_ICMP: Readonly> = Object.fromEntries( + ICMP_NEGATION_PAIRS.flatMap(([a, b]) => [ + [a, b], + [b, a], + ]), +); + /** Ops with an observable side effect — the derived view raise/shortcircuit.ts consumes. */ export const EFFECTFUL_OPS: ReadonlySet = new Set( (Object.keys(OPCODES) as Opcode[]).filter((k) => (OPCODES[k] as OpSig).effects), diff --git a/packages/core/src/pattern/engine.ts b/packages/core/src/pattern/engine.ts index ba561eeb..0095065a 100644 --- a/packages/core/src/pattern/engine.ts +++ b/packages/core/src/pattern/engine.ts @@ -6,7 +6,7 @@ // Crucially, rewrites go through replaceAllUsesWith + DCE — never in-place opcode // mutation of a live value. import { Fn, Op, Value, defOpMap, mkOp, mkValue, replaceAllUsesWith } from '../ir/core'; -import { type Opcode, isDceSafe } from '../ir/opcodes'; +import { NEGATED_ICMP, type Opcode, isDceSafe } from '../ir/opcodes'; import type { IrType } from '../ir/types'; import { T } from '../ir/types'; @@ -229,15 +229,97 @@ const sextPat = (w: number, k: number): RewritePattern => ({ * a row ever needs it. */ export const CAST_PATTERNS: RewritePattern[] = [zextPat(8, 24), zextPat(16, 16), sextPat(8, 24), sextPat(16, 16)]; +// ── boolean-negation idiom ─────────────────────────────────────────────────────────────────── +// `cmp ^ 1` IS `!cmp`: an `icmp_*` result is 0 or 1 by construction (ir/opcodes.ts), so xoring the +// low bit flips exactly the boolean. A compiler with no set-on-greater-equal spells a MATERIALISED +// `a >= b` as its opposite plus that flip — MIPS `slt v0,a0,a1; xori v0,v0,1`, the shape IDO and +// both GCCs emit and the only one asmlift has measured (m2c `40cbae3` reports ARM `eor #1` too; +// no agbcc row in the corpus carries it, agbcc materializing the same boolean via branches). +// The naive lift prints that as the double-negative `a < b ^ 1`, and hides the comparison from +// every consumer that reasons about booleans: the short-circuit recognizer's `&&`/`||` fold matches +// an `icmp` feeder, not an `xor` of one. (It does not by itself unblock that fold — measured on +// this idiom's one benchmark inhabitant, the diamond still declines because raise/shortcircuit.ts +// additionally wants a 0/1 CONST arm and both arms here are comparisons. It removes one of the two +// blockers, and the spelling win stands on its own.) +// +// UNGATED, unlike the compiler-pinned folds above. Two independent reasons, and the second is the +// load-bearing one: +// • it is a semantic IDENTITY on asmlift's own IR, not a spelling trade — `xor(icmp, 1)` cannot +// mean anything but the negated compare on any target; +// • THE SHAPE IS ITS OWN GATE. The pattern can only fire where the compiler itself emitted the +// flip, and wherever it did, "the negated comparison" is precisely what it was spelling. A +// compiler with a set-on-greater-equal never produces the shape and so can never be harmed. +// Byte evidence is narrower than the reasoning: synthetic:inrange stays MATCH under gcc2.7.2kmc +// with the folded spelling, which proves the round-trip there; elsewhere it is unmeasured. +// +// The negation comes from THE shared table (ir/opcodes.ts NEGATED_ICMP), so this fold, the MIPS +// `slt …; beqz` branch fold and the short-circuit diamond negation cannot disagree about what the +// opposite of a compare is. One pattern per comparison — a data-driven fold needs a fixed +// replacement opcode, so the table is unrolled into ten patterns rather than expressed as a +// (nonexistent) computed-opcode replacement. +const notCmpPat = (cmp: string): RewritePattern => ({ + id: `not-${cmp}`, + applies: {}, + match: { + op: 'xor', + args: [ + { op: cmp, args: [{ bind: 'A' }, { bind: 'B' }] }, + { op: 'const', attrEquals: { value: 1 }, args: [] }, + ], + }, + // Pinned u32, matching CNTLZW_EQ0 — the other pattern in this file that produces a comparison. + // It is what raise/recover.ts stamps on every icmp result unconditionally anyway, so inheriting + // the `xor`'s type would reach the same place; saying it here keeps the two icmp-producing + // patterns on one discipline instead of leaving a reader to infer which is canonical. + replaceWith: { op: NEGATED_ICMP[cmp], args: ['A', 'B'], resultType: T.u(32) }, +}); + +// The BRANCH-form siblings. Testing a boolean against zero is the same negation by another +// spelling, and it is what a compare-and-branch ISA actually emits: MIPS `slt v0,…; xori v0,v0,1; +// beqz v0,L` lifts to `icmp_eq(icmp_sge(…), 0)` once the `xori` has folded, because the branch is a +// genuine test of the materialised boolean (the frontend's own `slt …; beqz` fusion cannot fire — +// its pending compare was invalidated by the `xori` that redefined the register). Without these the +// `^ 1` fold just trades one double negative for another: `a0 >= a1 == 0`. +// icmp_eq(cmp, 0) → !cmp `(a >= b) == 0` is `a < b` +// icmp_ne(cmp, 0) → cmp `(a >= b) != 0` is `a >= b` +// Same soundness argument as the `^ 1` fold (an icmp result is 0/1, so `== 0` is exactly negation) +// and the same shape-is-its-own-gate reason to leave them ungated. +const cmpZeroPat = (cmp: string, test: 'icmp_eq' | 'icmp_ne'): RewritePattern => ({ + id: `${test === 'icmp_eq' ? 'not' : 'is'}-zerotest-${cmp}`, + applies: {}, + match: { + op: test, + args: [ + { op: cmp, args: [{ bind: 'A' }, { bind: 'B' }] }, + { op: 'const', attrEquals: { value: 0 }, args: [] }, + ], + }, + replaceWith: { op: test === 'icmp_eq' ? NEGATED_ICMP[cmp] : cmp, args: ['A', 'B'], resultType: T.u(32) }, +}); + +/** `cmp ^ 1` and the zero-test forms `cmp == 0` / `cmp != 0` → the (negated) comparison. Every + * entry is one comparison of `NEGATED_ICMP`; the bundle is what the boolean-reasoning consumers + * downstream (short-circuit recovery, the structurer's condition spelling) actually match on. */ +export const NOT_CMP_PATTERNS: RewritePattern[] = [ + ...Object.keys(NEGATED_ICMP).map(notCmpPat), + ...Object.keys(NEGATED_ICMP).flatMap((cmp) => [cmpZeroPat(cmp, 'icmp_eq'), cmpZeroPat(cmp, 'icmp_ne')]), +]; + // The DEFAULT idiom bundle `decompile()` applies when the caller passes no `patterns`. It is -// EVERY idiom asmlift owns; each is `{compilers}`-gated (patternApplies), so this one global list -// self-selects per target — agbcc/gcc get sdiv-pow2, agbcc/ido/gcc get the mul-const folds, and a -// target whose compiler matches none (mwcc) applies nothing. Ordered like the sub-bundles: the +// EVERY idiom asmlift owns; the list self-selects per target through patternApplies — agbcc/gcc get +// sdiv-pow2, agbcc/ido/gcc get the mul-const folds, mwcc gets cntlzw-eq0 + rotl-mirror, and agbcc +// gets the casts. MOST patterns are `{compilers}`-gated because they trade one spelling for another +// and are only byte-safe where measured; the boolean-negation folds are deliberately UNGATED (see +// their comment — the shape is its own gate), so "gated per compiler" is the common case, not the +// invariant. Ordered like the sub-bundles: the // division idiom, then the multiplies (base folds before the composite tail). Passing an explicit // `patterns` (including `[]`) overrides this — `[]` runs the naive lift with no idiom folding. export const DEFAULT_IDIOM_PATTERNS: RewritePattern[] = [ SDIV_POW2_2, CNTLZW_EQ0, + // AFTER cntlzw-eq0, which is what turns mwcc's `clz(x) >> 5` into the `icmp_eq` this fold then + // negates — `!(x == 0)` composes only in that order (each pattern runs to fixpoint in turn). + ...NOT_CMP_PATTERNS, ROTL_MIRROR, ...MUL_CONST_PATTERNS, ...CAST_PATTERNS, @@ -245,7 +327,11 @@ export const DEFAULT_IDIOM_PATTERNS: RewritePattern[] = [ // Ops whose operands a compiler may emit in either order — so an idiom's match must try both // (agbcc emits `add(X, shr_u(X,31))`; KMC GCC emits `add(shr_u(X,31), X)` for the SAME `x/2`). -const COMMUTATIVE = new Set(['add', 'mul', 'and', 'or', 'xor']); +// `icmp_eq`/`icmp_ne` are here for the same reason, not as arithmetic: `x == 0` and `0 == x` are the +// same test, and which one a frontend builds is an accident of how the branch was decoded — the +// zero-test folds must match either. The ORDERED comparisons are deliberately absent: swapping the +// operands of `a < b` is `b > a`, a different opcode, which this mechanism cannot express. +const COMMUTATIVE = new Set(['add', 'mul', 'and', 'or', 'xor', 'icmp_eq', 'icmp_ne']); interface Binds { values: Map; diff --git a/packages/core/src/raise/shortcircuit.ts b/packages/core/src/raise/shortcircuit.ts index b6a016e7..c9c4bca8 100644 --- a/packages/core/src/raise/shortcircuit.ts +++ b/packages/core/src/raise/shortcircuit.ts @@ -39,23 +39,10 @@ // Guards stay conservative: the CONST is exactly 0/1, Vb is a bool op or 0/1 const, the head condition is a // negatable icmp, and any deviation falls through untouched (a miss, never a miscompile). import { Block, Fn, Op, Value, defOpMap, mkOp, mkValue, predecessors, replaceAllUsesWith } from '../ir/core'; -import type { Opcode } from '../ir/opcodes'; -import { HOIST_UNSAFE_OPS } from '../ir/opcodes'; +import { HOIST_UNSAFE_OPS, NEGATED_ICMP } from '../ir/opcodes'; import { T } from '../ir/types'; -const NEGATE_ICMP: Record = { - icmp_eq: 'icmp_ne', - icmp_ne: 'icmp_eq', - icmp_slt: 'icmp_sge', - icmp_sge: 'icmp_slt', - icmp_sgt: 'icmp_sle', - icmp_sle: 'icmp_sgt', - icmp_ult: 'icmp_uge', - icmp_uge: 'icmp_ult', - icmp_ugt: 'icmp_ule', - icmp_ule: 'icmp_ugt', -}; -const BOOL_OPS = new Set([...Object.keys(NEGATE_ICMP), 'logic_and', 'logic_or']); +const BOOL_OPS = new Set([...Object.keys(NEGATED_ICMP), 'logic_and', 'logic_or']); /** Fold `(-x | x) >> 31` (logical shift) → `x != 0`, in place. agbcc's branchless is-nonzero idiom. */ // NOT exported: it must run before the diamond fold, an ordering only recognizeShortCircuit's @@ -176,7 +163,7 @@ export function recognizeShortCircuit(fn: Fn): boolean { } const cond = ht.operands[0]; const condDef = defs.get(cond); - if (!condDef || !NEGATE_ICMP[condDef.opcode]) { + if (!condDef || !NEGATED_ICMP[condDef.opcode]) { continue; } // head condition must be a negatable icmp @@ -197,7 +184,7 @@ export function recognizeShortCircuit(fn: Fn): boolean { let condSide = cond; if (wantNeg) { condSide = mkValue(T.unk(32)); - before(mkOp(NEGATE_ICMP[condDef.opcode], { operands: [...condDef.operands], results: [condSide] })); + before(mkOp(NEGATED_ICMP[condDef.opcode], { operands: [...condDef.operands], results: [condSide] })); } // Vb const → the phi reduces to the (possibly negated) condition; Vb bool → a && / || connective. let res = condSide; @@ -362,11 +349,11 @@ export function recognizeBranchShortCircuit(fn: Fn): boolean { let second = c2; const negated: Op[] = []; if (wantEdge !== gTaken) { - if (!c2Def || !NEGATE_ICMP[c2Def.opcode]) { + if (!c2Def || !NEGATED_ICMP[c2Def.opcode]) { continue; } second = mkValue(T.unk(32)); - negated.push(mkOp(NEGATE_ICMP[c2Def.opcode], { operands: [...c2Def.operands], results: [second] })); + negated.push(mkOp(NEGATED_ICMP[c2Def.opcode], { operands: [...c2Def.operands], results: [second] })); } const res = mkValue(T.unk(32)); const connective = mkOp(gIsFall ? 'logic_or' : 'logic_and', { diff --git a/packages/core/test/pattern.test.ts b/packages/core/test/pattern.test.ts index 34c492f9..12749c72 100644 --- a/packages/core/test/pattern.test.ts +++ b/packages/core/test/pattern.test.ts @@ -3,10 +3,11 @@ // testable, AI-addable datum. import { expect, test } from 'vitest'; +import { NEGATED_ICMP, OPCODES } from '../src/ir/opcodes'; import { parse } from '../src/ir/parse'; import { print } from '../src/ir/print'; import { verify } from '../src/ir/verify'; -import { SDIV_POW2_2, applyPattern, dce, patternApplies } from '../src/pattern/engine'; +import { CNTLZW_EQ0, NOT_CMP_PATTERNS, SDIV_POW2_2, applyPattern, dce, patternApplies } from '../src/pattern/engine'; // agbcc's signed /2 idiom, lifted to L1: shr_s(add(X, shr_u(X,31)), 1). const BEFORE = `fn half { @@ -52,3 +53,117 @@ test('patternApplies gates on the COMPILER (the /2 idiom fires for agbcc + gcc, expect(patternApplies(SDIV_POW2_2, gcc)).toBe(true); expect(patternApplies(SDIV_POW2_2, ido)).toBe(false); }); + +// ── `cmp ^ 1` → the negated comparison ──────────────────────────────────────────────────────── +// MIPS's materialised `a0 >= a1`: there is no set-on-greater-equal, so the compiler emits the +// opposite compare plus a boolean flip (`slt v0,a0,a1; xori v0,v0,1`). IDO, both GCCs, PPC and ARM +// all spell a negated compare this way. +const XOR1_BEFORE = `fn ge { +^bb0(%0: s32, %1: s32): + %2: u32 = icmp_slt %0, %1 + %3: u32 = const {value=1} + %4: u32 = xor %2, %3 + ret %4 +} +`; +const XOR1_AFTER = `fn ge { +^bb0(%0: s32, %1: s32): + %2: u32 = icmp_sge %0, %1 + ret %2 +} +`; + +test('golden: `cmp ^ 1` folds to the negated comparison and DCE cleans the feeders', () => { + const fn = parse(XOR1_BEFORE); + const hits = NOT_CMP_PATTERNS.reduce((n, p) => n + applyPattern(fn, p), 0); + dce(fn); + expect(hits).toBe(1); + expect(print(fn)).toBe(XOR1_AFTER); + verify(fn); +}); + +test('the fold covers every comparison, in BOTH operand orders, and is involutive', () => { + // one pattern per icmp — a comparison missing from the table would silently keep the + // double-negative spelling, which is exactly the readability bug the fold exists to remove + expect(NOT_CMP_PATTERNS.map((p) => p.id).sort()).toEqual( + Object.keys(NEGATED_ICMP) + .flatMap((c) => [`not-${c}`, `not-zerotest-${c}`, `is-zerotest-${c}`]) + .sort(), + ); + for (const cmp of Object.keys(NEGATED_ICMP)) { + // xor is commutative — a compiler may emit either operand order (`xori rD,rS,1` + // lifts one way, a register-register `xor` the other) + for (const order of ['%2, %3', '%3, %2']) { + const fn = parse( + `fn f {\n^bb0(%0: s32, %1: s32):\n %2: u32 = ${cmp} %0, %1\n` + + ` %3: u32 = const {value=1}\n %4: u32 = xor ${order}\n ret %4\n}\n`, + ); + const hits = NOT_CMP_PATTERNS.reduce((n, p) => n + applyPattern(fn, p), 0); + dce(fn); + expect(hits).toBe(1); + expect(print(fn)).toContain(NEGATED_ICMP[cmp]); + // negating twice is the identity — the table is derived from involutive pairs, and a + // consumer that disagreed about the opposite of a compare would show up here + expect(NEGATED_ICMP[NEGATED_ICMP[cmp]]).toBe(cmp); + verify(fn); + } + } +}); + +test('the fold is SEMANTIC, not compiler-pinned: it applies to every target', () => { + // unlike the shift-pair/rotate folds (which trade one spelling for another and are only + // byte-safe on the compilers measured), `xor(icmp, 1)` cannot mean anything but the negated + // compare — an icmp result is 0/1 by construction — so no `applies` axis is declared + const targets = [ + { id: 'armv4t', compiler: 'agbcc', capabilities: { hwDivide: false, hwFloat: false } }, + { id: 'mips', compiler: 'ido', capabilities: { hwDivide: true, hwFloat: true } }, + { id: 'ppc', compiler: 'mwcc', capabilities: { hwDivide: true, hwFloat: true } }, + ]; + for (const t of targets) { + expect(NOT_CMP_PATTERNS.every((p) => patternApplies(p, t))).toBe(true); + } +}); + +test('no spurious fold: a xor by any other constant, or of a non-comparison, is left alone', () => { + const mask = parse( + `fn f {\n^bb0(%0: s32, %1: s32):\n %2: u32 = icmp_slt %0, %1\n %3: u32 = const {value=2}\n %4: u32 = xor %2, %3\n ret %4\n}\n`, + ); + expect(NOT_CMP_PATTERNS.reduce((n, p) => n + applyPattern(mask, p), 0)).toBe(0); + // ReadKeyInput's `eor rX, #0x3ff` shape: a bitwise mask-xor of a plain value, not a boolean flip + const plain = parse(`fn f {\n^bb0(%0: s32):\n %1: u32 = const {value=1}\n %2: u32 = xor %0, %1\n ret %2\n}\n`); + expect(NOT_CMP_PATTERNS.reduce((n, p) => n + applyPattern(plain, p), 0)).toBe(0); +}); + +test('the table covers the WHOLE icmp family — a new comparison cannot be silently missed', () => { + // NEGATED_ICMP is authored data seated beside the opcode registry, and its symmetry is the only + // part construction guarantees. An eleventh `icmp_*` registered without a negation entry degrades + // three consumers three different ways — the MIPS branch fold throws in the verifier, the + // short-circuit recognizer silently declines, and NOT_CMP_PATTERNS silently omits it. This is the + // one assertion that turns all three into a red test here instead. + expect(Object.keys(NEGATED_ICMP).sort()).toEqual( + Object.keys(OPCODES) + .filter((k) => k.startsWith('icmp_')) + .sort(), + ); +}); + +test('composition: mwcc `!(x == 0)` folds through cntlzw-eq0 into a single `x != 0`', () => { + // `cntlzw rD,rS; srwi rD,rD,5; xori rD,rD,1` — mwcc's `x != 0`. Neither fold reaches it alone: + // cntlzw-eq0 must run FIRST to turn `clz(x) >> 5` into the `icmp_eq` this one then negates. That + // ordering is an invariant of DEFAULT_IDIOM_PATTERNS (each pattern runs to its own fixpoint, in + // list order), and this is what pins it — reorder the list and the fold silently stops composing. + const fn = parse( + `fn notb {\n^bb0(%0: s32):\n %1: u32 = clz %0\n %2: u32 = shr_u %1 {imm=5}\n` + + ` %3: u32 = const {value=1}\n %4: u32 = xor %2, %3\n ret %4\n}\n`, + ); + let hits = applyPattern(fn, CNTLZW_EQ0); + for (const p of NOT_CMP_PATTERNS) { + hits += applyPattern(fn, p); + } + dce(fn); + expect(hits).toBe(2); + expect(print(fn)).toBe( + 'fn notb {\n^bb0(%0: s32):\n %1: s32 = const {value=0}\n %2: u32 = icmp_ne %0, %1\n ret %2\n}\n', + ); + verify(fn); +}); From 35e5ed8c36acb51439b7a13cafcb4bad0858d5b8 Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:14:59 +0100 Subject: [PATCH 2/6] fix(mips): key the pending compare by VALUE, not by register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found while measuring the boolean-negation folds, on a live benchmark row. The `slt …; beqz` fold rewrites a branch into the (negated) comparison that defined the tested register — but the record was keyed by REGISTER, and a register is exactly what the next instruction may redefine: slt v0,a0,a1 xori v0,v0,0x1 ← v0 redefined: it now holds `a0 >= a1` beqz v0,.L The fold matched the DEAD `slt` and emitted the exactly inverted condition. synthetic:inrange returned 1 where the function returns 0 (inrange(5,1,0)) — silently wrong C with no marker and no decline, and the harness scored it `nonmatch 9/10`, indistinguishable from an honest near-miss. Keying on the SSA VALUE the compare produced removes the class rather than the instance: `condValue` resolves the branch register to its reaching value and looks THAT up, so any redefinition simply misses and the honest `icmp_eq(rX, 0)` is emitted (which the idiom layer then folds back to a plain comparison). Nothing is left for a future writer to remember — and that matters, because invalidating on write would NOT have been enough: `lui rD,%hi(SYM)` deliberately reassigns a register without going through the write path, and the fold also bypassed `read`'s own sp/`%hi`/`gp` used-as-data declines by never reading the register at all. Verified alongside the inversion: the `lui %hi` case now declines loud; `slt zero,…; beqz zero` no longer folds an unconditionally-taken branch; a spill/reload pair still folds; and `move v1,v0; beqz v1` now folds through the copy, which it did not before. The shape has three inhabitants in the corpus. Two snowboardkids2 rows carry it masked behind the `jal` decline, and one of those silently DROPPED a conjunct (`sltiu; and; beqz` emitted `if (a0 < 1)`) — so the class grows the moment MIPS calls land. Pinned with corpus/ido-inrange.asm, beside ido-maxab.asm which is the same fold in its clean form; the expectation is whole text because two mechanisms must hold together, the value keying and the idiom layer's negation folds. Benchmark: 743 rows, zero moved — that row was the stale fold's only liftable inhabitant, and it was wrong. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/src/frontend/mips.ts | 47 ++++++++++++----------- packages/core/test/corpus-offline.test.ts | 21 ++++++++++ packages/core/test/corpus/ido-inrange.asm | 15 ++++++++ 3 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 packages/core/test/corpus/ido-inrange.asm diff --git a/packages/core/src/frontend/mips.ts b/packages/core/src/frontend/mips.ts index ce20bc6c..a42c5f1c 100644 --- a/packages/core/src/frontend/mips.ts +++ b/packages/core/src/frontend/mips.ts @@ -19,7 +19,7 @@ // compares (`sltu`/`sltiu`) lower to `icmp_ult`; recover types their operands u32 so the backend // re-emits `sltu` (the operator is the same `<` — the signedness lives in the operand types). import { Fn, Op, Successor, Value, mkOp, mkValue } from '../ir/core'; -import type { Opcode } from '../ir/opcodes'; +import { NEGATED_ICMP, type Opcode } from '../ir/opcodes'; import { T } from '../ir/types'; import type { Prototypes } from '../proto'; import type { TargetDescription } from '../target'; @@ -47,19 +47,6 @@ const COND_Z: Record = { bgez: 'icmp_sge', }; const COND_RR: Record = { beq: 'icmp_eq', bne: 'icmp_ne' }; -// Negated icmp opcode (for the `slt …; beqz` "branch when false" fold). -const NEG_ICMP: Record = { - icmp_slt: 'icmp_sge', - icmp_sge: 'icmp_slt', - icmp_sgt: 'icmp_sle', - icmp_sle: 'icmp_sgt', - icmp_ult: 'icmp_uge', - icmp_uge: 'icmp_ult', - icmp_ugt: 'icmp_ule', - icmp_ule: 'icmp_ugt', - icmp_eq: 'icmp_ne', - icmp_ne: 'icmp_eq', -}; const isZero = (r: string) => r === 'zero' || r === '$0'; // The stack pointer (`$29`). A `sw/lw` through it is not a store/load through a data pointer — it @@ -604,6 +591,18 @@ export function lift( } return readVar(r, bi); }; + // `slt`-family results, so a following `beqz`/`bnez` can fold into one compare. + // + // Keyed by the SSA VALUE the compare produced, never by its register. Keying by register is the + // bug: `slt v0,a0,a1; xori v0,v0,1; beqz v0,L` (a materialised `a0 >= a1` that a branch then + // tests — IDO's spelling, and a live benchmark row) redefines v0, and a register-keyed record + // folds the branch against the DEAD `slt`, silently emitting the INVERTED condition. A value + // cannot go stale that way: `condValue` resolves the branch's register to whatever value reaches + // it and looks THAT up, so a redefinition simply misses and the honest `icmp_eq(rX, 0)` is + // emitted. It also needs no invalidation discipline to be maintained by every future writer — + // which matters, because `write` is NOT the only path that redefines a register (`lui + // rD,%hi(SYM)` deliberately reassigns rD's meaning without it). + const cmpDef = new Map(); const write = (r: string, v: Value) => { // Writing a register clears any pending `%hi` it held — the high-half address is gone once the // register is reassigned (e.g. `lw rHi, %lo(SYM)(rHi)` reuses the base as the load dest). A @@ -626,13 +625,11 @@ export function lift( // DELIBERATELY (unlike divState): a cross-block `mult`/`mflo` pair has no observed inhabitant, // and the miss degrades to a LOUD opaque, never silence. let mulState: { rs: Value; rt: Value; signed: boolean } | null = null; - // `slt`-family results, so a following `beqz`/`bnez` can fold into one compare. - const cmpDef = new Map(); const emitCmp = (opc: Opcode, d: string, lhs: Value, rhs: Value) => { const v = mkValue(T.unk(32)); ops.push(mkOp(opc, { operands: [lhs, rhs], results: [v] })); write(d, v); - cmpDef.set(d, { value: v, opcode: opc, lhs, rhs }); + cmpDef.set(v, { opcode: opc, lhs, rhs }); }; const decode = (ins: Instr) => { @@ -1053,7 +1050,7 @@ function condValue( ops: Op[], read: (r: string) => Value, constVal: (n: number) => Value, - cmpDef: Map, + cmpDef: Map, ): Value { const mk = (opc: Opcode, l: Value, r: Value): Value => { const v = mkValue(T.unk(32)); @@ -1064,15 +1061,19 @@ function condValue( return mk(COND_RR[br.mnemonic], read(br.ops[0]), read(br.ops[1])); } // *z forms compare a register against zero — except beqz/bnez may fold a preceding `slt`. - const rs = br.ops[0]; - const folded = cmpDef.get(rs); + // Resolve the register to its reaching VALUE first: that is the fold's key (so a redefinition + // between the compare and the branch misses instead of folding stale), and it is also what + // routes the operand through `read`'s loud guards (sp / `%hi` / `gp` used as data) on every + // path — the fold used to bypass them by never reading the register at all. + const rsv = read(br.ops[0]); + const folded = cmpDef.get(rsv); if (folded && br.mnemonic === 'bnez') { - return folded.value; + return rsv; } // branch when slt is true if (folded && br.mnemonic === 'beqz') { - return mk(NEG_ICMP[folded.opcode], folded.lhs, folded.rhs); + return mk(NEGATED_ICMP[folded.opcode], folded.lhs, folded.rhs); } // …when false - return mk(COND_Z[br.mnemonic], read(rs), constVal(0)); + return mk(COND_Z[br.mnemonic], rsv, constVal(0)); } /** The MIPS-II / IDO frontend, registered for the `mips` target. */ diff --git a/packages/core/test/corpus-offline.test.ts b/packages/core/test/corpus-offline.test.ts index c1910ac1..34bee42d 100644 --- a/packages/core/test/corpus-offline.test.ts +++ b/packages/core/test/corpus-offline.test.ts @@ -114,6 +114,27 @@ const CASES: OfflineCase[] = [ 's32 maxab(s32 a0, s32 a1) {\n if (a0 < a1) {\n return a1;\n } else {\n return a0;\n }\n}\n', }, + // ── The sibling NEGATIVE of maxab: a compare whose register is REDEFINED before the branch ─ + // `inrange` is `x >= lo && x <= hi`. IDO materialises `a0 >= a1` the only way a compare-into-GPR + // ISA can — `slt` then `xori …,1` — and only then branches on it. That `xori` redefines v0, so a + // pending-compare record keyed by REGISTER folds the branch against the dead `slt` and emits the + // exactly inverted condition: `inrange(5,1,0)` returned 1 where the function returns 0. Silent + // wrong C, scored as a near-miss (nonmatch 9/10) — indistinguishable from an honest near-match, + // which is what makes this class worth a fixture rather than a comment. + // + // Two independent mechanisms have to hold for the expectation below, which is why it is pinned as + // whole text: the frontend keys its fold by the SSA VALUE (so the redefinition simply misses), and + // the idiom layer folds `cmp ^ 1` and the `cmp == 0` the branch then produces. Break either and + // this reads `a0 < a1 ^ 1` or `a0 >= a1 == 0` instead. + { + file: 'ido-inrange.asm', + sym: 'inrange', + target: MIPS_IDO, + note: 'materialised negated compare, then branched on — the stale-fold inversion', + expect: + 's32 inrange(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n if (a0 < a1) {\n v0 = a0 >= a1;\n } else {\n v0 = a2 >= a0;\n }\n return v0;\n}\n', + }, + // ── PowerPC / CodeWarrior (GameCube) — the third ISA, its objdump captured verbatim ────── { file: 'ppc-deref.asm', diff --git a/packages/core/test/corpus/ido-inrange.asm b/packages/core/test/corpus/ido-inrange.asm new file mode 100644 index 00000000..60cdaf47 --- /dev/null +++ b/packages/core/test/corpus/ido-inrange.asm @@ -0,0 +1,15 @@ + +target.o: file format elf32-tradbigmips + + +Disassembly of section .text: + +00000000 : + 0: slt v0,a0,a1 + 4: xori v0,v0,0x1 + 8: beqz v0,18 + c: nop + 10: slt v0,a2,a0 + 14: xori v0,v0,0x1 + 18: jr ra + 1c: nop From 49ed535279fa9e2edcaf63a3189b56638c5388c3 Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:17:35 +0100 Subject: [PATCH 3/6] fix(thumb): a flag-setter between a compare and its branch declines loud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same stale-compare class as the MIPS fix, in the sibling frontend, and worse in kind. `pendingCmp` is seeded at `cmp` and was never invalidated — but on Thumb-1 nearly every data-processing instruction on LOW registers writes the condition flags, `s`-suffix or not (agbcc spells `adds r0,r0,r3` as `add r0,r0,r3`, and the assembler picks the flag-setting encoding). So an instruction between a `cmp` and its branch REPLACES the flags the branch tests: cmp r0, r1 add r2, r0, #1 ← sets flags; `beq` tests THIS beq .L1 emitted `if (a0 != a1)`, where the hardware branches on `r0 + 1 == 0`. No benchmark row exhibits it — compilers keep the pair adjacent, and across every agbcc row no conditional-branch block has ANY instruction between its compare and the branch. That measurement is the argument for closing the hazard, not for leaving it open: the corpus is not the input domain (the playground takes hand-written asm, where there is no oracle and a silent miscompile has no tell), and the remedy here is a loud DECLINE, which guesses at nothing. So: drop the pending compare on a flag-setting mnemonic with a low-register destination and let the terminator's existing "no reaching compare in its block" decline fire — the same loud answer that shape already gets when a label splits the pair, and pinned next to it. High-register forms (`mov rD,rH`, `add rD,rH`) do not set flags and stay transparent, which is what keeps agbcc's callee-saved shuffling from tripping it; loads, stores, push/pop and `bl` are unaffected, and the test pins those three non-tripping shapes too. Benchmark: 743 rows, zero moved — free, as the scan predicted. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/src/frontend/thumb.ts | 58 +++++++++++++++++++++++ packages/core/test/thumb-frontend.test.ts | 20 ++++++++ 2 files changed, 78 insertions(+) diff --git a/packages/core/src/frontend/thumb.ts b/packages/core/src/frontend/thumb.ts index 4e81ab12..f3d91cec 100644 --- a/packages/core/src/frontend/thumb.ts +++ b/packages/core/src/frontend/thumb.ts @@ -119,6 +119,48 @@ const imm = (s: string) => parseInt(s.replace(/^#/, ''), s.includes('0x') ? 16 : // detection sees them, and any consumer that needs the exact list rejects the leftover `-` token // loudly rather than treating the fused range as one phantom register. const REG_NUM: Record = { sp: 13, lr: 14, pc: 15 }; + +// Thumb-1 data-processing mnemonics that write the condition flags when their destination is a LOW +// register — which is all of them on this ISA, `s`-suffix or not (the assembler picks the encoding). +// Used to invalidate a pending compare: see the decode loop. `cmp`/`cmn`/`tst` are absent on purpose +// — they set flags but define no register, and `cmp` is the very instruction that seeds the pending +// compare. Loads, stores, push/pop, `bl` and the high-register forms leave the flags alone. +const FLAG_SETTING = new Set([ + 'mov', + 'movs', + 'add', + 'adds', + 'sub', + 'subs', + 'lsl', + 'lsls', + 'lsr', + 'lsrs', + 'asr', + 'asrs', + 'neg', + 'negs', + 'rsb', + 'rsbs', + 'mvn', + 'mvns', + 'bic', + 'bics', + 'ror', + 'rors', + 'mul', + 'muls', + 'and', + 'ands', + 'orr', + 'orrs', + 'eor', + 'eors', + 'adc', + 'adcs', + 'sbc', + 'sbcs', +]); const regNum = (r: string) => (r[0] === 'r' ? Number(r.slice(1)) : REG_NUM[r]); function expandRegList(tokens: string[]): string[] { const out: string[] = []; @@ -1076,6 +1118,22 @@ export function lift( if (classifyXfer(ins)) { continue; } + // A Thumb-1 data-processing instruction on LOW registers writes the condition flags whether or + // not the mnemonic carries the `s` (agbcc spells `adds r0,r0,r3` as `add r0,r0,r3`, and the + // assembler picks the flag-setting encoding) — so an instruction between a `cmp` and its branch + // REPLACES the flags the branch will test. Folding the earlier `cmp` in anyway would emit a + // condition on the wrong operands: silently wrong C with no marker. Drop the pending compare + // and let the terminator's existing "no reaching compare in its block" decline fire — the loud + // answer, since modelling arithmetic flags is a capability asmlift does not have. + // + // The HIGH-register forms (`mov rD,rH`, `add rD,rH`) do NOT set flags and stay transparent, + // which is what keeps agbcc's callee-saved shuffling from tripping this. Measured free: across + // every agbcc row in the benchmark, no conditional-branch block has ANY instruction between its + // compare and the branch — compilers keep the pair adjacent. The inhabitant this guards is + // hand-written asm in the playground, where there is no oracle to catch a lie. + if (FLAG_SETTING.has(ins.mnemonic) && /^r[0-7]$/.test(reg(ins.ops[0] ?? ''))) { + pendingCmp = null; + } const [a, b, c] = ins.ops; switch (ins.mnemonic) { case 'mov': diff --git a/packages/core/test/thumb-frontend.test.ts b/packages/core/test/thumb-frontend.test.ts index f1b8b6cb..ebc62144 100644 --- a/packages/core/test/thumb-frontend.test.ts +++ b/packages/core/test/thumb-frontend.test.ts @@ -16,6 +16,26 @@ describe('Thumb frontend robustness (CONTRACT-AS-INVARIANT)', () => { expect(() => dc('splitcmp', body)).toThrow(/no reaching compare/); }); + test('a flag-setting instruction between a cmp and its branch declines loud', () => { + // On Thumb-1 nearly every data-processing instruction on LOW registers writes the condition + // flags, `s`-suffix or not (agbcc spells `adds r0,r0,r3` as `add r0,r0,r3` and the assembler + // picks the flag-setting encoding). So the `add` below REPLACES the flags `beq` tests: folding + // the earlier `cmp` in emitted `if (a0 != a1)` where the hardware branches on `r0 + 1 == 0`. + // Silent wrong C — now the same loud decline the label-split case above gets. + const clobbered = + '\tcmp\tr0, r1\n\tadd\tr2, r0, #1\n\tbeq\t.Lt\n\tmov\tr0, #0\n\tbx\tlr\n.Lt:\n\tmov\tr0, #1\n\tbx\tlr\n'; + expect(() => dc('flagclobber', clobbered)).toThrow(/no reaching compare/); + + // …and the three shapes that must NOT trip it, or the guard would cost real matches: an + // adjacent pair, a LOAD between them (loads leave the flags alone), and a HIGH-register move + // (the high-register forms do not set flags — this is agbcc's callee-saved shuffling). + const folds = (mid: string) => + dc('ok', `\tcmp\tr0, r1\n${mid}\tbeq\t.Lt\n\tmov\tr0, #0\n\tbx\tlr\n.Lt:\n\tmov\tr0, #1\n\tbx\tlr\n`).source; + expect(folds('')).toContain('if (a0 != a1)'); + expect(folds('\tldr\tr2, [r3]\n')).toContain('if (a0 != a1)'); + expect(folds('\tmov\tr8, r2\n')).toContain('if (a0 != a1)'); + }); + test('an unmodelled op that reaches the output FAILS LOUD (no silent wrong C)', () => { // `clz` (count-leading-zeros) is not modelled. If dropped, the function would return a // stale/absent r0; instead it emits an opaque the boundary contract rejects — loud. From 96ac6517bf3526573e08ff2cdd0ac01949da93a1 Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:18:00 +0100 Subject: [PATCH 4/6] test(symbols): pin that the MAP is not the reference set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit m2c declared every global symbol it had accumulated during translation, and fixed it upstream (`7e8e106`) by wiring declaration emission into its pre-existing `Expression.use()` protocol. There is nothing to port: asmlift's declarations come from `collectSymbolRefs`, which derives the set from each candidate's FINAL tree at the point of consumption, and l3/symbol-refs.ts says in its header that there is deliberately no cached field for exactly this reason. A sweep across 11 tree shapes and all 121 real symbol-map rows found zero spurious declarations. But "by construction" is a claim about code that keeps being edited, and the collector has three arms of which only one was covered. Pinned here: the map now holds a symbol the function never touches, so the existing exact-equality assertion states the property directly; plus the two uncovered arms — a write-only scalar global (the `assign` arm, the one place the collector hand-rolls a name lookup rather than going through the shared expression vocabulary, and so the likeliest to be lost in a refactor) and `&gSym` as a call argument. Deleting either arm passed the entire suite before this. Recorded, not fixed: `collectStructs` is a SECOND declaration producer with exactly m2c's shape. It walks the L2 graph, is cached on the SFn and carried unpruned through every later L3 pass, while its sibling `locals` IS reference-pruned after dead-store elimination. No pass drops such a use today — IR-level DCE runs long before struct recognition, and l3/dce's `mustKeep` never drops a `field`/`index` — so the staleness is latent, and its doc comment now says so, along with the fix if a pass ever makes it reachable: derive at the consumption point, as symbol-refs already does. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/src/raise/structs.ts | 14 +++++++-- packages/core/test/symbol-refs.test.ts | 40 ++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/packages/core/src/raise/structs.ts b/packages/core/src/raise/structs.ts index 36f28188..d7e4581c 100644 --- a/packages/core/src/raise/structs.ts +++ b/packages/core/src/raise/structs.ts @@ -196,8 +196,18 @@ export function recognizeStructs(fn: Fn): number { return count; } -/** The distinct struct types this function references (unwrapping struct pointers on every value), - * deduped by name and sorted, for the backend to declare above the function. */ +/** The distinct struct types this function's L2 GRAPH mentions (unwrapping struct pointers on every + * value), deduped by name and sorted, for the backend to declare above the function. + * + * "Mentions", not "references": this walks `fn.blocks` at the moment structuring runs, and the + * result is CACHED on the SFn (`structure.ts`) and carried by every later `{...sfn}` pass, so a + * struct whose last use a subsequent L3 pass removed would still be declared. Sibling `locals` is + * reference-pruned after dead-store elimination (`l3/dce.ts`) for exactly that reason; this list is + * not. No pass drops such a use today — the IR-level DCE runs long before recognition, and l3/dce's + * `mustKeep` never drops a `field`/`index` — so the staleness is LATENT, not live, which is why it + * is recorded here rather than fixed speculatively. The fix, if a pass ever makes it reachable, is + * the one l3/symbol-refs.ts already applies to symbol references: derive at the consumption point + * (`backend/cfamily.ts` structDecls) instead of caching. */ export function collectStructs(fn: Fn): StructType[] { const seen = new Map(); const consider = (t: IrType) => { diff --git a/packages/core/test/symbol-refs.test.ts b/packages/core/test/symbol-refs.test.ts index ca14d06d..0765d8a9 100644 --- a/packages/core/test/symbol-refs.test.ts +++ b/packages/core/test/symbol-refs.test.ts @@ -18,10 +18,25 @@ const enumerate = (sym: string, body: string, symbols?: SymbolMap) => // ldr rN, =0x03001234; load a halfword through it — promotes to the mapped name const LOADH = '\tldr\tr0, .L1\n\tldrh\tr0, [r0]\n\tbx\tlr\n.L1:\n\t.word\t0x03001234\n'; const COUNTER = { name: 'gCounter', kind: 'data', shape: 'scalar', size: 2, signed: false } as const; +// a second mapped symbol this function never touches — a real project map is mostly these +const ELSEWHERE = { name: 'gElsewhere', kind: 'data', shape: 'scalar', size: 4, signed: true } as const; describe('value references are recorded with their SymbolInfo', () => { - test('a named data global carries its map facts; /raw-globals carries none', () => { - const cands = enumerate('f', LOADH, new Map([[0x03001234, [{ ...COUNTER }]]])); + test('a named data global carries its map facts; an untouched mapped symbol carries none', () => { + // The map holds two symbols and the function names ONE. The exact-equality assertion below is + // what pins that the reference set is the TREE's, not the map's: refs are derived from each + // candidate's final tree at the consumption point (l3/symbol-refs.ts) rather than accumulated + // as symbols are encountered, so an unreferenced symbol is never a declaration. (m2c reached + // the same end differently — its symbols WERE accumulated, and declaration emission was later + // wired into its existing `Expression.use()` protocol, upstream 7e8e106.) + const cands = enumerate( + 'f', + LOADH, + new Map([ + [0x03001234, [{ ...COUNTER }]], + [0x03005678, [{ ...ELSEWHERE }]], + ]), + ); const named = cands.filter((c) => !c.label.endsWith('/raw-globals')); const raw = cands.filter((c) => c.label.endsWith('/raw-globals')); expect(named.length).toBeGreaterThan(0); @@ -34,6 +49,27 @@ describe('value references are recorded with their SymbolInfo', () => { } }); + test('the WRITE-only and address-only arms record too — the ones no other test covers', () => { + // The collector has three arms and only the `var`-leaf one is exercised elsewhere. Both of these + // are load-bearing and silent when broken: the candidate simply loses a declaration it needs and + // fails to compile. The `assign` arm is the likeliest to be lost in a refactor — it is the one + // place the collector hand-rolls a name lookup instead of going through the shared expression + // vocabulary, because an assignment carries its target as a NAME, not an Expr. + const SEED = { name: 'gSeed', kind: 'data', shape: 'scalar', size: 4, signed: true } as const; + const write = '\tldr\tr1, .L1\n\tstr\tr0, [r1]\n\tbx\tlr\n.L1:\n\t.word\tgSeed\n'; + for (const c of enumerate('f', write, new Map([[0x02000000, [{ ...SEED }]]]))) { + expect(c.source).toContain('gSeed = a0;'); // a WRITE is the only mention of the symbol + expect(c.symbolRefs).toEqual([{ name: 'gSeed', info: SEED }]); + } + // `&gThing` as a call argument: the symbol is named by an `addr` leaf and never read + const THING = { name: 'gThing', kind: 'data', shape: 'struct', size: 4, structName: 'Thing' } as const; + const addr = '\tpush\t{lr}\n\tldr\tr0, .L1\n\tbl\tUse\n\tpop\t{r1}\n\tbx\tr1\n.L1:\n\t.word\tgThing\n'; + for (const c of enumerate('f', addr, new Map([[0x02000010, [{ ...THING }]]]))) { + expect(c.source).toContain('Use(&gThing)'); + expect((c.symbolRefs ?? []).map((r) => r.name)).toEqual(['gThing']); + } + }); + test('a value-referenced CODE symbol ((u32)Func) is recorded with kind code', () => { const body = '\tldr\tr0, .L1\n\tbx\tlr\n.L1:\n\t.word\t0x08001001\n'; // odd Thumb pointer const cands = enumerate('f', body, new Map([[0x08001000, [{ name: 'DoThing', kind: 'code' }]]])); From 92b4d4019ffc6e30c7f5accaa0740669631bdf74 Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:18:00 +0100 Subject: [PATCH 5/6] test(frontend): pin the whole sp-as-data class, not one spelling at a time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit m2c crashed on `ldr rX, [sp, rY]`: its stack-frame model assumed an sp-relative access always carries a literal addend, so a register-indexed one hit a fired `assert isinstance(addend, AsmLiteral)` (upstream `ef34aff`). There is nothing to port — asmlift refuses reading `sp` as DATA up front on every frontend, so the register-indexed form is not a case to know about but one more member of a class already refused. Probed every spelling on thumb, MIPS and PPC: all decline loud. What that guard is really defending is asmlift's OWN hazard, which is why these belong in this file: `sp` is never WRITTEN, so a frontend that let it be read as data would have Braun SSA materialize it as a fabricated PHANTOM PARAMETER — a function of the wrong arity returning the wrong argument. Pinned per frontend, because the class is only worth anything if it holds for every spelling: the register-indexed load and its store dual, the literal `[sp, #N]` slot m2c does handle, and `&local`. asmlift has no GENERAL stack-frame model but two deliberately narrow partial ones, and both are covered — MIPS models word `sp` SLOTS, so its contract is narrower (the model's own spill/reload shape keeps working, while sub-word access, the whole-function aliasing case its sub-word scan exists for, frame arithmetic and a never-stored slot all decline). PPC is the interesting one and was missing: it is asmlift's only frontend with a register-indexed addressing mode, which makes `lwzx rD,r1,rB` the exact structural analogue of m2c's case, and mwcc emits `lwzx` for every variable-index array access. It declines — but only because `addrX` routes both operands through `read`, not by a check of its own, so a refactor to `readVar` would silently reopen precisely that hole. Now pinned beside its sibling r1 guards. core/README is corrected in passing: it listed live spills as declined, which the MIPS word-slot model has always contradicted. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/README.md | 4 +- packages/core/test/decline-guards.test.ts | 54 +++++++++++++++++++++++ packages/core/test/ppc-frontend.test.ts | 12 +++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/packages/core/README.md b/packages/core/README.md index de6173e7..918455c4 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -104,7 +104,9 @@ Recovered today: straight-line, if/else diamonds, natural loops (`while` / `do-w properly nested, in-body `break`/early-`return`), comparison-tree and jump-table switches, direct calls, constant-offset and variable-index memory (`*p`, `p[n]`, `a[i]`, struct fields), magic-number and soft division, short-circuit booleans, width casts. Still DECLINED (loud, never -wrong code): **local stack frames** (address-taken locals / sp-as-data / live spills), +wrong code): **local stack frames** (address-taken locals / sp-as-data; MIPS models word `sp` +slots and PPC elides callee-saved save slots, so a spill/reload pair is modelled on those two — +anything the narrow models cannot honour declines), **cross-block condition flags** on PPC (a `cmpw` whose branch lands in another block — the capability gap behind the mwcc switch stubs), computed tail calls, PIC/`gp`/SDA global access, switch fall-through, multi-latch/irreducible loops, floats, and 64-bit memory ops. Prototypes diff --git a/packages/core/test/decline-guards.test.ts b/packages/core/test/decline-guards.test.ts index 31f3a24c..63c076ae 100644 --- a/packages/core/test/decline-guards.test.ts +++ b/packages/core/test/decline-guards.test.ts @@ -93,6 +93,60 @@ test('the annotate stub carries a machine-readable declineReason', () => { expect(report.declineReason).toBeTruthy(); }); +// ── sp-as-data: the WHOLE class declines, not one spelling at a time ────────────────────── +// asmlift's own silent-miscompile hazard, and the reason this belongs in this file: `sp` is never +// WRITTEN, so a frontend that let it be read as data would have Braun SSA materialize it as a +// fabricated PHANTOM PARAMETER — a function of the wrong arity returning the wrong argument +// (thumb.ts's readData and mips.ts's never-stored-slot check each say so at their guard). Every +// frontend therefore refuses the whole class up front rather than the shapes it happens to know. +// +// The sweep exists because "the whole class" is only worth anything if it stays true for every +// spelling: the register-indexed load and its store dual, a plain `[sp, #N]` slot, `&local`. It was +// prompted by m2c hitting the register-indexed case (`ldr rX, [sp, rY]` tripped an +// `assert isinstance(addend, AsmLiteral)` in its stack-frame model, upstream ef34aff) — a case +// asmlift refuses not by knowing about it but by never having entered the class. +// +// asmlift has no GENERAL stack-frame model, but two deliberately narrow partial ones, and both are +// covered below. MIPS models word `sp` SLOTS (a spill/reload pair is one SSA variable), so its +// contract is narrower: every access the word-slot model cannot honour must decline. PPC elides +// callee-saved save/restore slots, and is the one frontend with a register-indexed addressing mode +// (`lwzx`/`stwx`) — the exact structural analogue of m2c's case, and covered in ppc-frontend.test.ts +// beside its sibling r1 guards (its decline message names the register, so it does not share the +// regex below). +test('every sp-as-data spelling declines loud — including the register-indexed load', () => { + const thumb = (body: string) => () => + decompile('f', `\t.code\t16\n\t.globl\tf\n\t.thumb_func\nf:\n${body}\tbx\tlr\n`, ARMV4T_AGBCC); + const spAsData = /stack pointer used as data/; + expect(thumb('\tldr\tr0, [sp, r1]\n')).toThrow(spAsData); // m2c's crash case + expect(thumb('\tstr\tr0, [sp, r1]\n')).toThrow(spAsData); // its store dual + expect(thumb('\tldr\tr0, [sp, #4]\n')).toThrow(spAsData); // the literal slot m2c handles + expect(thumb('\tadd\tr0, sp, #8\n')).toThrow(spAsData); // &local + // annotate mode degrades to a stub carrying the same reason — never a fabricated stack local + const annotated = decompile( + 'f', + '\t.code\t16\n\t.globl\tf\n\t.thumb_func\nf:\n\tldr\tr0, [sp, r1]\n\tbx\tlr\n', + ARMV4T_AGBCC, + { onGap: 'annotate' }, + ); + expect(annotated.diagnostics.some((d) => spAsData.test(d.reason))).toBe(true); +}); + +test('MIPS: sp accesses outside the word-slot model decline, never a bogus slot', () => { + const mips = (body: string) => () => decompile('f', `00000000 :\n${body} 8:\tjr\tra\n c:\tnop\n`, MIPS_IDO); + // the model's own shape still works: a store then reload of the same word slot is one SSA value + expect( + decompile('f', '00000000 :\n 0:\tsw\ta0,4(sp)\n 4:\tlw\tv0,4(sp)\n 8:\tjr\tra\n c:\tnop\n', MIPS_IDO) + .source, + ).toBe('s32 f(s32 a0) {\n return a0;\n}\n'); + expect(mips(' 0:\tlb\tv0,4(sp)\n')).toThrow(/stack pointer used as data/); // sub-word: slot model unsafe + // …and the ALIASING case the whole-function sub-word scan exists for: a word store routed to an + // SSA slot while a sub-word reload of the SAME offset stays on the memory path would drop the + // store outright. One sub-word sp access disables slot modelling for the entire function. + expect(mips(' 0:\tsw\ta0,4(sp)\n 4:\tlbu\tv0,4(sp)\n')).toThrow(/stack pointer used as data/); + expect(mips(' 0:\taddu\tv0,sp,a0\n')).toThrow(/stack pointer used as data/); // &local + expect(mips(' 0:\tlw\tv0,16(sp)\n')).toThrow(/never stored/); // a slot no store defined +}); + // ── Input-format boundary (frontend/format.ts) ──────────────────────────────────────────── // Each frontend reads ONE text format; a positive mismatch declines AT THE BOUNDARY with a // message naming both formats. Unclassifiable text still flows to the frontend (headerless diff --git a/packages/core/test/ppc-frontend.test.ts b/packages/core/test/ppc-frontend.test.ts index 27e78fa3..c71dead1 100644 --- a/packages/core/test/ppc-frontend.test.ts +++ b/packages/core/test/ppc-frontend.test.ts @@ -133,6 +133,18 @@ describe('PPC-WIDEN frontend (calls, frame transparency, rlwinm extract, CTR loo // `addi r3,r1,8` = `&local` — reading the stack pointer as data (silently `return a0 + 8;` otherwise). expect(() => dis('addrtaken', '0:\taddi r3,r1,8\n4:\tblr\n')).toThrow(/stack pointer r1 used as data/); }); + test('REGISTER-INDEXED frame access (`lwzx rD,r1,rB`) fails loud — r1 in either operand', () => { + // PPC is asmlift's only frontend with a register-indexed addressing mode, so this is the exact + // structural analogue of the case that broke m2c's stack-frame model (`ldr rX, [sp, rY]`, + // upstream ef34aff): an sp-relative access whose addend is a REGISTER, not a literal. It + // declines here for a reason worth pinning — `addrX` routes BOTH operands through `read`, so + // the guard above covers it rather than there being a second check. A refactor of `addrX` to + // `readVar` would silently reopen exactly that hole, and mwcc emits `lwzx` for every + // variable-index array access, so the shape is not exotic. + expect(() => dis('lwzxframe', '0:\tlwzx r3,r1,r4\n4:\tblr\n')).toThrow(/stack pointer r1 used as data/); + expect(() => dis('stwxframe', '0:\tstwx r3,r1,r4\n4:\tblr\n')).toThrow(/stack pointer r1 used as data/); + expect(() => dis('lwzxindex', '0:\tlwzx r3,r4,r1\n4:\tblr\n')).toThrow(/stack pointer r1 used as data/); + }); test('spill of a LIVE (computed) value to the stack FAILS LOUD, not a dropped spill', () => { // `addi r0,r3,1` computes a value; `stw r0,8(r1)` spills it. A callee-saved SAVE stores an // unchanged entry value (no reaching def) and stays transparent — this stores a live value. From 32d71cc8854cbe7eefc1abc52d5017d7ed6ddfb1 Mon Sep 17 00:00:00 2001 From: Bruno Macabeus Date: Wed, 5 Aug 2026 15:19:35 +0100 Subject: [PATCH 6/6] =?UTF-8?q?bench:=20refresh=20results=20=E2=80=94=20as?= =?UTF-8?q?mlift=20360=20->=20361=20vs=20m2c=20342?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The boolean-negation folds flip synthetic:clampu8:ido7.1 (`if (a0 < 256 == 0)` → `if (a0 >= 256)`, byte-exact). Four more rows change text without moving, all losing a double negative; every other row is byte-identical, and m2c's column is untouched. Also restores CLEAN provenance. The committed results have carried `dirty: true` since the m2c pin bump, which ran the benchmark from a tree that already held the pin edit — so apps/web/test/summary-consistency.test.ts has been red on main. Co-Authored-By: Claude Opus 5 (1M context) --- apps/benchmark/results/results.json | 56 +++++++++---------- apps/web/src/data/summary.json | 6 +- .../web/src/pages/benchmark/data/results.json | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/apps/benchmark/results/results.json b/apps/benchmark/results/results.json index 4fdf30e6..dcbf785d 100644 --- a/apps/benchmark/results/results.json +++ b/apps/benchmark/results/results.json @@ -1,6 +1,6 @@ { "meta": { - "generatedAt": "2026-08-05T00:35:23.409Z", + "generatedAt": "2026-08-05T14:19:19.617Z", "toolchains": [ "ido7.1", "agbcc", @@ -14,8 +14,8 @@ "real": 240 }, "asmlift": { - "commit": "3c0f76118ae3adaebd6993e88810a83664def346", - "dirty": true + "commit": "92b4d4019ffc6e30c7f5accaa0740669631bdf74", + "dirty": false }, "m2c": { "commit": "ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0" @@ -3423,11 +3423,11 @@ "droppedCandidates": [ { "label": "unsigned/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-CztkBl/c.c:1077: invalid operands to binary <<" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-NkXTmJ/c.c:1077: invalid operands to binary <<" }, { "label": "unsigned/scopebase/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-9kTYnQ/c.c:1078: invalid operands to binary <<" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-hAz9gH/c.c:1078: invalid operands to binary <<" } ], "symbolsUsed": [ @@ -4329,7 +4329,7 @@ "droppedCandidates": [ { "label": "unsigned", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-GYLwTt/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-MUXcew/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)" } ], "symbolsUsed": [], @@ -5402,7 +5402,7 @@ "droppedCandidates": [ { "label": "unsigned", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-0ySZ7J/c.c:1077: too many arguments to function `thunk_sub_080002A0'" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-iHbWd3/c.c:1077: too many arguments to function `thunk_sub_080002A0'" } ], "symbolsUsed": [], @@ -6148,43 +6148,43 @@ "droppedCandidates": [ { "label": "unsigned/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-q08N9S/c.c:1085: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-2duYZD/c.c:1085: incompatible types in assignment" }, { "label": "unsigned/coalesce-v2-v3/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kVtPjs/c.c:1084: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-IaZKL3/c.c:1084: incompatible types in assignment" }, { "label": "unsigned/coalesce-v2-v4/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-xZOlxN/c.c:1084: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-duAGNb/c.c:1084: incompatible types in assignment" }, { "label": "unsigned/defsite/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-26kOPm/c.c:1086: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-RWHHSI/c.c:1086: incompatible types in assignment" }, { "label": "unsigned/defsite/coalesce-v2-v4/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-f2VLeO/c.c:1085: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-tMRk9i/c.c:1085: incompatible types in assignment" }, { "label": "signed/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-WF9nHM/c.c:1085: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-PczVje/c.c:1085: incompatible types in assignment" }, { "label": "signed/coalesce-v2-v3/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-mDzvDo/c.c:1084: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-LRGxNi/c.c:1084: incompatible types in assignment" }, { "label": "signed/coalesce-v2-v4/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-PK7L0x/c.c:1084: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kkGrTr/c.c:1084: incompatible types in assignment" }, { "label": "signed/defsite/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-yiEeM7/c.c:1086: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-qYty7P/c.c:1086: incompatible types in assignment" }, { "label": "signed/defsite/coalesce-v2-v4/raw-globals", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kiF7nl/c.c:1085: incompatible types in assignment" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-Fl5PVX/c.c:1085: incompatible types in assignment" } ], "symbolsUsed": [ @@ -25301,7 +25301,7 @@ "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", + "source": "s32 clampu8(u32 a0) {\n if (a0 >= 0) {\n if (a0 >= 256) a0 = 255;\n } else {\n a0 = 0;\n }\n return a0;\n}\n", "score": 8, "maxScore": 9, "compileErrors": null, @@ -25384,9 +25384,9 @@ "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, + "outcome": "match", + "source": "s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 >= 256) {\n return 255;\n } else {\n return a0;\n }\n }\n}\n", + "score": 0, "maxScore": 10, "compileErrors": null, "breakdown": { @@ -25394,7 +25394,7 @@ "delete": 0, "replace": 0, "opMismatch": 0, - "argMismatch": 2 + "argMismatch": 0 }, "quality": { "score": 100, @@ -34256,7 +34256,7 @@ "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", + "source": "s32 inrange(s32 a0, s32 a1, s32 a2) {\n return a0 >= a1 & a2 >= a0;\n}\n", "score": 0, "maxScore": 6, "compileErrors": null, @@ -34326,18 +34326,18 @@ "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", + "candidateLabel": "unsigned", "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", + "source": "s32 inrange(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (a0 < a1) {\n v0 = a0 >= a1;\n } else {\n v0 = a2 >= a0;\n }\n return v0;\n}\n", "score": 9, "maxScore": 10, "compileErrors": null, "breakdown": { "insert": 2, "delete": 1, - "replace": 3, + "replace": 4, "opMismatch": 0, - "argMismatch": 3 + "argMismatch": 2 }, "quality": { "score": 100, @@ -51676,7 +51676,7 @@ "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", + "source": "s32 sw_sparse(u32 a0) {\n s32 v0;\n if (a0 == 10) {\n v0 = 2;\n } else {\n if (a0 >= 11) {\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, diff --git a/apps/web/src/data/summary.json b/apps/web/src/data/summary.json index 87f263c8..19b330bd 100644 --- a/apps/web/src/data/summary.json +++ b/apps/web/src/data/summary.json @@ -1,10 +1,10 @@ { "total": 743, "match": { - "asmlift": 360, + "asmlift": 361, "m2c": 342 }, - "commit": "3c0f76118ae3adaebd6993e88810a83664def346", + "commit": "92b4d4019ffc6e30c7f5accaa0740669631bdf74", "m2cCommit": "ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0", - "dirty": true + "dirty": false } diff --git a/apps/web/src/pages/benchmark/data/results.json b/apps/web/src/pages/benchmark/data/results.json index 56d85ea4..07f79b9e 100644 --- a/apps/web/src/pages/benchmark/data/results.json +++ b/apps/web/src/pages/benchmark/data/results.json @@ -1 +1 @@ -{"meta":{"generatedAt":"2026-08-05T00:35:23.409Z","toolchains":["ido7.1","agbcc","gcc2.7.2","gcc2.7.2kmc","mwcc_242_81"],"counts":{"total":743,"synthetic":503,"real":240},"asmlift":{"commit":"3c0f76118ae3adaebd6993e88810a83664def346","dirty":true},"m2c":{"commit":"ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0"}},"results":[{"id":"af:_MtxF_to_Mtx:ido7.1","sym":"_MtxF_to_Mtx","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","array","cast","pointer","float","shift","bitwise"],"loc":71,"refSource":"Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest) {\n s32 fp;\n u16* intPart = (u16*)&dest->m[0][0];\n u16* fracPart = (u16*)&dest->m[2][0];\n\n fp = src->xx * 0x10000;\n intPart[0] = (fp >> 0x10);\n fracPart[0] = fp & 0xFFFF;\n\n fp = src->yx * 0x10000;\n intPart[1] = (fp >> 0x10);\n fracPart[1] = fp & 0xFFFF;\n\n fp = src->zx * 0x10000;\n intPart[2] = (fp >> 0x10);\n fracPart[2] = fp & 0xFFFF;\n\n fp = src->wx * 0x10000;\n intPart[3] = (fp >> 0x10);\n fracPart[3] = fp & 0xFFFF;\n\n fp = src->xy * 0x10000;\n intPart[4] = (fp >> 0x10);\n fracPart[4] = fp & 0xFFFF;\n\n fp = src->yy * 0x10000;\n intPart[5] = (fp >> 0x10);\n fracPart[5] = fp & 0xFFFF;\n\n // Ideally these three would use fracPart instead of intPart, but it's required to match.\n fp = src->zy * 0x10000;\n intPart[6] = (fp >> 0x10);\n intPart[22] = fp & 0xFFFF;\n\n fp = src->wy * 0x10000;\n intPart[7] = (fp >> 0x10);\n intPart[23] = fp & 0xFFFF;\n\n fp = src->xz * 0x10000;\n intPart[8] = (fp >> 0x10);\n intPart[24] = fp & 0xFFFF;\n\n fp = src->yz * 0x10000;\n intPart[9] = (fp >> 0x10);\n fracPart[9] = fp & 0xFFFF;\n\n fp = src->zz * 0x10000;\n intPart[10] = (fp >> 0x10);\n fracPart[10] = fp & 0xFFFF;\n\n fp = src->wz * 0x10000;\n intPart[11] = (fp >> 0x10);\n fracPart[11] = fp & 0xFFFF;\n\n fp = src->xw * 0x10000;\n intPart[12] = (fp >> 0x10);\n fracPart[12] = fp & 0xFFFF;\n\n fp = src->yw * 0x10000;\n intPart[13] = (fp >> 0x10);\n fracPart[13] = fp & 0xFFFF;\n\n fp = src->zw * 0x10000;\n intPart[14] = (fp >> 0x10);\n fracPart[14] = fp & 0xFFFF;\n\n fp = src->ww * 0x10000;\n intPart[15] = (fp >> 0x10);\n fracPart[15] = fp & 0xFFFF;\n return dest;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_matrix.c#L768-L838","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 <_MtxF_to_Mtx>:\n 0:\tlui\tat,0x4780\n 4:\tmtc1\tat,$f0\n 8:\tlwc1\t$f4,0(a0)\n c:\taddiu\tv1,a1,32\n 10:\tmove\tv0,a1\n 14:\tmul.s\t$f6,$f4,$f0\n 18:\ttrunc.w.s\t$f8,$f6\n 1c:\tmfc1\tt8,$f8\n 20:\tnop\n 24:\tsra\tt7,t8,0x10\n 28:\tsh\tt7,0(a1)\n 2c:\tsh\tt8,32(a1)\n 30:\tlwc1\t$f10,4(a0)\n 34:\tmul.s\t$f16,$f10,$f0\n 38:\ttrunc.w.s\t$f18,$f16\n 3c:\tmfc1\tt1,$f18\n 40:\tnop\n 44:\tsra\tt0,t1,0x10\n 48:\tsh\tt0,2(a1)\n 4c:\tsh\tt1,34(a1)\n 50:\tlwc1\t$f4,8(a0)\n 54:\tmul.s\t$f6,$f4,$f0\n 58:\ttrunc.w.s\t$f8,$f6\n 5c:\tmfc1\tt4,$f8\n 60:\tnop\n 64:\tsra\tt3,t4,0x10\n 68:\tsh\tt3,4(a1)\n 6c:\tsh\tt4,36(a1)\n 70:\tlwc1\t$f10,12(a0)\n 74:\tmul.s\t$f16,$f10,$f0\n 78:\ttrunc.w.s\t$f18,$f16\n 7c:\tmfc1\tt7,$f18\n 80:\tnop\n 84:\tsra\tt6,t7,0x10\n 88:\tsh\tt6,6(a1)\n 8c:\tsh\tt7,38(a1)\n 90:\tlwc1\t$f4,16(a0)\n 94:\tmul.s\t$f6,$f4,$f0\n 98:\ttrunc.w.s\t$f8,$f6\n 9c:\tmfc1\tt0,$f8\n a0:\tnop\n a4:\tsra\tt9,t0,0x10\n a8:\tsh\tt9,8(a1)\n ac:\tsh\tt0,40(a1)\n b0:\tlwc1\t$f10,20(a0)\n b4:\tmul.s\t$f16,$f10,$f0\n b8:\ttrunc.w.s\t$f18,$f16\n bc:\tmfc1\tt3,$f18\n c0:\tnop\n c4:\tsra\tt2,t3,0x10\n c8:\tsh\tt2,10(a1)\n cc:\tsh\tt3,42(a1)\n d0:\tlwc1\t$f4,24(a0)\n d4:\tmul.s\t$f6,$f4,$f0\n d8:\ttrunc.w.s\t$f8,$f6\n dc:\tmfc1\tt6,$f8\n e0:\tnop\n e4:\tsra\tt5,t6,0x10\n e8:\tsh\tt5,12(a1)\n ec:\tsh\tt6,44(a1)\n f0:\tlwc1\t$f10,28(a0)\n f4:\tmul.s\t$f16,$f10,$f0\n f8:\ttrunc.w.s\t$f18,$f16\n fc:\tmfc1\tt9,$f18\n 100:\tnop\n 104:\tsra\tt8,t9,0x10\n 108:\tsh\tt8,14(a1)\n 10c:\tsh\tt9,46(a1)\n 110:\tlwc1\t$f4,32(a0)\n 114:\tmul.s\t$f6,$f4,$f0\n 118:\ttrunc.w.s\t$f8,$f6\n 11c:\tmfc1\tt2,$f8\n 120:\tnop\n 124:\tsra\tt1,t2,0x10\n 128:\tsh\tt1,16(a1)\n 12c:\tsh\tt2,48(a1)\n 130:\tlwc1\t$f10,36(a0)\n 134:\tmul.s\t$f16,$f10,$f0\n 138:\ttrunc.w.s\t$f18,$f16\n 13c:\tmfc1\tt5,$f18\n 140:\tnop\n 144:\tsra\tt4,t5,0x10\n 148:\tsh\tt4,18(a1)\n 14c:\tsh\tt5,18(v1)\n 150:\tlwc1\t$f4,40(a0)\n 154:\tmul.s\t$f6,$f4,$f0\n 158:\ttrunc.w.s\t$f8,$f6\n 15c:\tmfc1\tt8,$f8\n 160:\tnop\n 164:\tsra\tt7,t8,0x10\n 168:\tsh\tt7,20(a1)\n 16c:\tsh\tt8,20(v1)\n 170:\tlwc1\t$f10,44(a0)\n 174:\tmul.s\t$f16,$f10,$f0\n 178:\ttrunc.w.s\t$f18,$f16\n 17c:\tmfc1\tt1,$f18\n 180:\tnop\n 184:\tsra\tt0,t1,0x10\n 188:\tsh\tt0,22(a1)\n 18c:\tsh\tt1,22(v1)\n 190:\tlwc1\t$f4,48(a0)\n 194:\tmul.s\t$f6,$f4,$f0\n 198:\ttrunc.w.s\t$f8,$f6\n 19c:\tmfc1\tt4,$f8\n 1a0:\tnop\n 1a4:\tsra\tt3,t4,0x10\n 1a8:\tsh\tt3,24(a1)\n 1ac:\tsh\tt4,24(v1)\n 1b0:\tlwc1\t$f10,52(a0)\n 1b4:\tmul.s\t$f16,$f10,$f0\n 1b8:\ttrunc.w.s\t$f18,$f16\n 1bc:\tmfc1\tt7,$f18\n 1c0:\tnop\n 1c4:\tsra\tt6,t7,0x10\n 1c8:\tsh\tt6,26(a1)\n 1cc:\tsh\tt7,26(v1)\n 1d0:\tlwc1\t$f4,56(a0)\n 1d4:\tmul.s\t$f6,$f4,$f0\n 1d8:\ttrunc.w.s\t$f8,$f6\n 1dc:\tmfc1\tt0,$f8\n 1e0:\tnop\n 1e4:\tsra\tt9,t0,0x10\n 1e8:\tsh\tt9,28(a1)\n 1ec:\tsh\tt0,28(v1)\n 1f0:\tlwc1\t$f10,60(a0)\n 1f4:\tmul.s\t$f16,$f10,$f0\n 1f8:\ttrunc.w.s\t$f18,$f16\n 1fc:\tmfc1\tt3,$f18\n 200:\tnop\n 204:\tsra\tt2,t3,0x10\n 208:\tsh\tt2,30(a1)\n 20c:\tjr\tra\n 210:\tsh\tt3,30(v1)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000220 .text\n00000000 g F .text\t00000214 _MtxF_to_Mtx\n\n\nContents of section .text:\n 0000 3c014780 44810000 c4840000 24a30020 <.G.D.......$.. \n 0010 00a01025 46002182 4600320d 44184000 ...%F.!.F.2.D.@.\n 0020 00000000 00187c03 a4af0000 a4b80020 ......|........ \n 0030 c48a0004 46005402 4600848d 44099000 ....F.T.F...D...\n 0040 00000000 00094403 a4a80002 a4a90022 ......D........\"\n 0050 c4840008 46002182 4600320d 440c4000 ....F.!.F.2.D.@.\n 0060 00000000 000c5c03 a4ab0004 a4ac0024 ......\\........$\n 0070 c48a000c 46005402 4600848d 440f9000 ....F.T.F...D...\n 0080 00000000 000f7403 a4ae0006 a4af0026 ......t........&\n 0090 c4840010 46002182 4600320d 44084000 ....F.!.F.2.D.@.\n 00a0 00000000 0008cc03 a4b90008 a4a80028 ...............(\n 00b0 c48a0014 46005402 4600848d 440b9000 ....F.T.F...D...\n 00c0 00000000 000b5403 a4aa000a a4ab002a ......T........*\n 00d0 c4840018 46002182 4600320d 440e4000 ....F.!.F.2.D.@.\n 00e0 00000000 000e6c03 a4ad000c a4ae002c ......l........,\n 00f0 c48a001c 46005402 4600848d 44199000 ....F.T.F...D...\n 0100 00000000 0019c403 a4b8000e a4b9002e ................\n 0110 c4840020 46002182 4600320d 440a4000 ... F.!.F.2.D.@.\n 0120 00000000 000a4c03 a4a90010 a4aa0030 ......L........0\n 0130 c48a0024 46005402 4600848d 440d9000 ...$F.T.F...D...\n 0140 00000000 000d6403 a4ac0012 a46d0012 ......d......m..\n 0150 c4840028 46002182 4600320d 44184000 ...(F.!.F.2.D.@.\n 0160 00000000 00187c03 a4af0014 a4780014 ......|......x..\n 0170 c48a002c 46005402 4600848d 44099000 ...,F.T.F...D...\n 0180 00000000 00094403 a4a80016 a4690016 ......D......i..\n 0190 c4840030 46002182 4600320d 440c4000 ...0F.!.F.2.D.@.\n 01a0 00000000 000c5c03 a4ab0018 a46c0018 ......\\......l..\n 01b0 c48a0034 46005402 4600848d 440f9000 ...4F.T.F...D...\n 01c0 00000000 000f7403 a4ae001a a46f001a ......t......o..\n 01d0 c4840038 46002182 4600320d 44084000 ...8F.!.F.2.D.@.\n 01e0 00000000 0008cc03 a4b9001c a468001c .............h..\n 01f0 c48a003c 46005402 4600848d 440b9000 .......\n 0010 000f07d1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff3e 00000000 000f07d1 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000085 0000003c 00000398 p..........<....\n 0010 00000005 0000051c 00000001 000003d4 ................\n 0020 00000004 00000408 00000000 00000000 ................\n 0030 00000011 00000438 00000038 0000047c .......8...8...|\n 0040 00000010 000004b4 00000001 000004c4 ................\n 0050 00000000 00000000 00000001 0000050c ................\n 0060 01408000 1d800013 82ffd012 10131210 .@..............\n 0070 13121013 12101312 10131210 13121013 ................\n 0080 12101312 10131210 13121013 12101312 ................\n 0090 10131210 13121013 1220f000 00000000 ......... ......\n 00a0 00000001 00000000 00000000 00000000 ................\n 00b0 ffffffff 00000000 00000000 00000000 ................\n 00c0 001d001f 0000001b 0000004f 00000000 ...........O....\n 00d0 00000001 00000000 2c200004 0000002a ........, .....*\n 00e0 00000000 1820000f 0000002a 00000214 ..... .....*....\n 00f0 20200001 00000001 00000000 20200000 .......... ..\n 0100 02000000 03000000 04000000 05000000 ................\n 0110 06000000 07000000 08000000 09000000 ................\n 0120 20000000 21000000 0a000000 0b000000 ...!...........\n 0130 0b000000 1a000000 00000000 00000003 ................\n 0140 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0150 7265616c 2d69646f 2d643330 33633630 real-ido-d303c60\n 0160 30313864 30656135 312f752e 69005f4d 018d0ea51/u.i._M\n 0170 7478465f 746f5f4d 74780000 5f4d7478 txF_to_Mtx.._Mtx\n 0180 465f746f 5f4d7478 00000000 00000000 F_to_Mtx........\n 0190 00000001 00000000 00000037 00000000 ...........7....\n 01a0 00000004 00000000 00000085 00000000 ................\n 01b0 00000000 00000001 00000000 00000011 ................\n 01c0 00000000 00000000 01800000 00000000 ................\n 01d0 0000003b 00000000 00000000 00000000 ...;............\n 01e0 18200001 00000000 00000000 00000000 . ..............\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile '_MtxF_to_Mtx' — lift: cannot lift '_MtxF_to_Mtx @0x8': 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 <_MtxF_to_Mtx>: */\n/* 0:\tlui\tat,0x4780 */\n/* 4:\tmtc1\tat,$f0 */\n/* 8:\tlwc1\t$f4,0(a0) */\n/* c:\taddiu\tv1,a1,32 */\n/* 10:\tmove\tv0,a1 */\n/* 14:\tmul.s\t$f6,$f4,$f0 */\n/* 18:\ttrunc.w.s\t$f8,$f6 */\n/* 1c:\tmfc1\tt8,$f8 */\n/* 20:\tnop */\n/* 24:\tsra\tt7,t8,0x10 */\n/* 28:\tsh\tt7,0(a1) */\n/* 2c:\tsh\tt8,32(a1) */\n/* 30:\tlwc1\t$f10,4(a0) */\n/* 34:\tmul.s\t$f16,$f10,$f0 */\n/* 38:\ttrunc.w.s\t$f18,$f16 */\n/* 3c:\tmfc1\tt1,$f18 */\n/* 40:\tnop */\n/* 44:\tsra\tt0,t1,0x10 */\n/* 48:\tsh\tt0,2(a1) */\n/* 4c:\tsh\tt1,34(a1) */\n/* 50:\tlwc1\t$f4,8(a0) */\n/* 54:\tmul.s\t$f6,$f4,$f0 */\n/* 58:\ttrunc.w.s\t$f8,$f6 */\n/* 5c:\tmfc1\tt4,$f8 */\n/* 60:\tnop */\n/* 64:\tsra\tt3,t4,0x10 */\n/* 68:\tsh\tt3,4(a1) */\n/* 6c:\tsh\tt4,36(a1) */\n/* 70:\tlwc1\t$f10,12(a0) */\n/* 74:\tmul.s\t$f16,$f10,$f0 */\n/* 78:\ttrunc.w.s\t$f18,$f16 */\n/* 7c:\tmfc1\tt7,$f18 */\n/* 80:\tnop */\n/* 84:\tsra\tt6,t7,0x10 */\n/* 88:\tsh\tt6,6(a1) */\n/* 8c:\tsh\tt7,38(a1) */\n/* 90:\tlwc1\t$f4,16(a0) */\n/* 94:\tmul.s\t$f6,$f4,$f0 */\n/* 98:\ttrunc.w.s\t$f8,$f6 */\n/* 9c:\tmfc1\tt0,$f8 */\n/* a0:\tnop */\n/* a4:\tsra\tt9,t0,0x10 */\n/* a8:\tsh\tt9,8(a1) */\n/* ac:\tsh\tt0,40(a1) */\n/* b0:\tlwc1\t$f10,20(a0) */\n/* b4:\tmul.s\t$f16,$f10,$f0 */\n/* b8:\ttrunc.w.s\t$f18,$f16 */\n/* bc:\tmfc1\tt3,$f18 */\n/* c0:\tnop */\n/* c4:\tsra\tt2,t3,0x10 */\n/* c8:\tsh\tt2,10(a1) */\n/* cc:\tsh\tt3,42(a1) */\n/* d0:\tlwc1\t$f4,24(a0) */\n/* d4:\tmul.s\t$f6,$f4,$f0 */\n/* d8:\ttrunc.w.s\t$f8,$f6 */\n/* dc:\tmfc1\tt6,$f8 */\n/* e0:\tnop */\n/* e4:\tsra\tt5,t6,0x10 */\n/* e8:\tsh\tt5,12(a1) */\n/* ec:\tsh\tt6,44(a1) */\n/* f0:\tlwc1\t$f10,28(a0) */\n/* f4:\tmul.s\t$f16,$f10,$f0 */\n/* f8:\ttrunc.w.s\t$f18,$f16 */\n/* fc:\tmfc1\tt9,$f18 */\n/* 100:\tnop */\n/* 104:\tsra\tt8,t9,0x10 */\n/* 108:\tsh\tt8,14(a1) */\n/* 10c:\tsh\tt9,46(a1) */\n/* 110:\tlwc1\t$f4,32(a0) */\n/* 114:\tmul.s\t$f6,$f4,$f0 */\n/* 118:\ttrunc.w.s\t$f8,$f6 */\n/* 11c:\tmfc1\tt2,$f8 */\n/* 120:\tnop */\n/* 124:\tsra\tt1,t2,0x10 */\n/* 128:\tsh\tt1,16(a1) */\n/* 12c:\tsh\tt2,48(a1) */\n/* 130:\tlwc1\t$f10,36(a0) */\n/* 134:\tmul.s\t$f16,$f10,$f0 */\n/* 138:\ttrunc.w.s\t$f18,$f16 */\n/* 13c:\tmfc1\tt5,$f18 */\n/* 140:\tnop */\n/* 144:\tsra\tt4,t5,0x10 */\n/* 148:\tsh\tt4,18(a1) */\n/* 14c:\tsh\tt5,18(v1) */\n/* 150:\tlwc1\t$f4,40(a0) */\n/* 154:\tmul.s\t$f6,$f4,$f0 */\n/* 158:\ttrunc.w.s\t$f8,$f6 */\n/* 15c:\tmfc1\tt8,$f8 */\n/* 160:\tnop */\n/* 164:\tsra\tt7,t8,0x10 */\n/* 168:\tsh\tt7,20(a1) */\n/* 16c:\tsh\tt8,20(v1) */\n/* 170:\tlwc1\t$f10,44(a0) */\n/* 174:\tmul.s\t$f16,$f10,$f0 */\n/* 178:\ttrunc.w.s\t$f18,$f16 */\n/* 17c:\tmfc1\tt1,$f18 */\n/* 180:\tnop */\n/* 184:\tsra\tt0,t1,0x10 */\n/* 188:\tsh\tt0,22(a1) */\n/* 18c:\tsh\tt1,22(v1) */\n/* 190:\tlwc1\t$f4,48(a0) */\n/* 194:\tmul.s\t$f6,$f4,$f0 */\n/* 198:\ttrunc.w.s\t$f8,$f6 */\n/* 19c:\tmfc1\tt4,$f8 */\n/* 1a0:\tnop */\n/* 1a4:\tsra\tt3,t4,0x10 */\n/* 1a8:\tsh\tt3,24(a1) */\n/* 1ac:\tsh\tt4,24(v1) */\n/* 1b0:\tlwc1\t$f10,52(a0) */\n/* 1b4:\tmul.s\t$f16,$f10,$f0 */\n/* 1b8:\ttrunc.w.s\t$f18,$f16 */\n/* 1bc:\tmfc1\tt7,$f18 */\n/* 1c0:\tnop */\n/* 1c4:\tsra\tt6,t7,0x10 */\n/* 1c8:\tsh\tt6,26(a1) */\n/* 1cc:\tsh\tt7,26(v1) */\n/* 1d0:\tlwc1\t$f4,56(a0) */\n/* 1d4:\tmul.s\t$f6,$f4,$f0 */\n/* 1d8:\ttrunc.w.s\t$f8,$f6 */\n/* 1dc:\tmfc1\tt0,$f8 */\n/* 1e0:\tnop */\n/* 1e4:\tsra\tt9,t0,0x10 */\n/* 1e8:\tsh\tt9,28(a1) */\n/* 1ec:\tsh\tt0,28(v1) */\n/* 1f0:\tlwc1\t$f10,60(a0) */\n/* 1f4:\tmul.s\t$f16,$f10,$f0 */\n/* 1f8:\ttrunc.w.s\t$f18,$f16 */\n/* 1fc:\tmfc1\tt3,$f18 */\n/* 200:\tnop */\n/* 204:\tsra\tt2,t3,0x10 */\n/* 208:\tsh\tt2,30(a1) */\n/* 20c:\tjr\tra */\n/* 210:\tsh\tt3,30(v1) */\n/* \t... */\nvoid _MtxF_to_Mtx(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift '_MtxF_to_Mtx @0x8': 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":142,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift '_MtxF_to_Mtx @0x8': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *_MtxF_to_Mtx(void *arg0, void *arg1) {\n s32 temp_f18;\n s32 temp_f18_2;\n s32 temp_f18_3;\n s32 temp_f18_4;\n s32 temp_f18_5;\n s32 temp_f18_6;\n s32 temp_f18_7;\n s32 temp_f18_8;\n s32 temp_f8;\n s32 temp_f8_2;\n s32 temp_f8_3;\n s32 temp_f8_4;\n s32 temp_f8_5;\n s32 temp_f8_6;\n s32 temp_f8_7;\n s32 temp_f8_8;\n void *temp_v1;\n\n temp_v1 = arg1 + 0x20;\n temp_f8 = (s32) (arg0->unk0 * 65536.0f);\n arg1->unk0 = (s16) (temp_f8 >> 0x10);\n arg1->unk20 = (s16) temp_f8;\n temp_f18 = (s32) (arg0->unk4 * 65536.0f);\n arg1->unk2 = (s16) (temp_f18 >> 0x10);\n arg1->unk22 = (s16) temp_f18;\n temp_f8_2 = (s32) (arg0->unk8 * 65536.0f);\n arg1->unk4 = (s16) (temp_f8_2 >> 0x10);\n arg1->unk24 = (s16) temp_f8_2;\n temp_f18_2 = (s32) (arg0->unkC * 65536.0f);\n arg1->unk6 = (s16) (temp_f18_2 >> 0x10);\n arg1->unk26 = (s16) temp_f18_2;\n temp_f8_3 = (s32) (arg0->unk10 * 65536.0f);\n arg1->unk8 = (s16) (temp_f8_3 >> 0x10);\n arg1->unk28 = (s16) temp_f8_3;\n temp_f18_3 = (s32) (arg0->unk14 * 65536.0f);\n arg1->unkA = (s16) (temp_f18_3 >> 0x10);\n arg1->unk2A = (s16) temp_f18_3;\n temp_f8_4 = (s32) (arg0->unk18 * 65536.0f);\n arg1->unkC = (s16) (temp_f8_4 >> 0x10);\n arg1->unk2C = (s16) temp_f8_4;\n temp_f18_4 = (s32) (arg0->unk1C * 65536.0f);\n arg1->unkE = (s16) (temp_f18_4 >> 0x10);\n arg1->unk2E = (s16) temp_f18_4;\n temp_f8_5 = (s32) (arg0->unk20 * 65536.0f);\n arg1->unk10 = (s16) (temp_f8_5 >> 0x10);\n arg1->unk30 = (s16) temp_f8_5;\n temp_f18_5 = (s32) (arg0->unk24 * 65536.0f);\n arg1->unk12 = (s16) (temp_f18_5 >> 0x10);\n temp_v1->unk12 = (s16) temp_f18_5;\n temp_f8_6 = (s32) (arg0->unk28 * 65536.0f);\n arg1->unk14 = (s16) (temp_f8_6 >> 0x10);\n temp_v1->unk14 = (s16) temp_f8_6;\n temp_f18_6 = (s32) (arg0->unk2C * 65536.0f);\n arg1->unk16 = (s16) (temp_f18_6 >> 0x10);\n temp_v1->unk16 = (s16) temp_f18_6;\n temp_f8_7 = (s32) (arg0->unk30 * 65536.0f);\n arg1->unk18 = (s16) (temp_f8_7 >> 0x10);\n temp_v1->unk18 = (s16) temp_f8_7;\n temp_f18_7 = (s32) (arg0->unk34 * 65536.0f);\n arg1->unk1A = (s16) (temp_f18_7 >> 0x10);\n temp_v1->unk1A = (s16) temp_f18_7;\n temp_f8_8 = (s32) (arg0->unk38 * 65536.0f);\n arg1->unk1C = (s16) (temp_f8_8 >> 0x10);\n temp_v1->unk1C = (s16) temp_f8_8;\n temp_f18_8 = (s32) (arg0->unk3C * 65536.0f);\n arg1->unk1E = (s16) (temp_f18_8 >> 0x10);\n temp_v1->unk1E = (s16) temp_f18_8;\n return arg1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":69,"gotos":0,"casts":48,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 45: Unacceptable operand of '+'.","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side","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 `_MtxF_to_Mtx` — benchmark function af:_MtxF_to_Mtx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel _MtxF_to_Mtx\n lui\t$at, 0x4780\n mtc1\t$at, $f0\n lwc1\t$f4, 0($a0)\n addiu\t$v1, $a1, 32\n move\t$v0, $a1\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t8, $f8\n nop\n sra\t$t7, $t8, 0x10\n sh\t$t7, 0($a1)\n sh\t$t8, 32($a1)\n lwc1\t$f10, 4($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t1, $f18\n nop\n sra\t$t0, $t1, 0x10\n sh\t$t0, 2($a1)\n sh\t$t1, 34($a1)\n lwc1\t$f4, 8($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t4, $f8\n nop\n sra\t$t3, $t4, 0x10\n sh\t$t3, 4($a1)\n sh\t$t4, 36($a1)\n lwc1\t$f10, 12($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t7, $f18\n nop\n sra\t$t6, $t7, 0x10\n sh\t$t6, 6($a1)\n sh\t$t7, 38($a1)\n lwc1\t$f4, 16($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t0, $f8\n nop\n sra\t$t9, $t0, 0x10\n sh\t$t9, 8($a1)\n sh\t$t0, 40($a1)\n lwc1\t$f10, 20($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t3, $f18\n nop\n sra\t$t2, $t3, 0x10\n sh\t$t2, 10($a1)\n sh\t$t3, 42($a1)\n lwc1\t$f4, 24($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t6, $f8\n nop\n sra\t$t5, $t6, 0x10\n sh\t$t5, 12($a1)\n sh\t$t6, 44($a1)\n lwc1\t$f10, 28($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t9, $f18\n nop\n sra\t$t8, $t9, 0x10\n sh\t$t8, 14($a1)\n sh\t$t9, 46($a1)\n lwc1\t$f4, 32($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t2, $f8\n nop\n sra\t$t1, $t2, 0x10\n sh\t$t1, 16($a1)\n sh\t$t2, 48($a1)\n lwc1\t$f10, 36($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t5, $f18\n nop\n sra\t$t4, $t5, 0x10\n sh\t$t4, 18($a1)\n sh\t$t5, 18($v1)\n lwc1\t$f4, 40($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t8, $f8\n nop\n sra\t$t7, $t8, 0x10\n sh\t$t7, 20($a1)\n sh\t$t8, 20($v1)\n lwc1\t$f10, 44($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t1, $f18\n nop\n sra\t$t0, $t1, 0x10\n sh\t$t0, 22($a1)\n sh\t$t1, 22($v1)\n lwc1\t$f4, 48($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t4, $f8\n nop\n sra\t$t3, $t4, 0x10\n sh\t$t3, 24($a1)\n sh\t$t4, 24($v1)\n lwc1\t$f10, 52($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t7, $f18\n nop\n sra\t$t6, $t7, 0x10\n sh\t$t6, 26($a1)\n sh\t$t7, 26($v1)\n lwc1\t$f4, 56($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t0, $f8\n nop\n sra\t$t9, $t0, 0x10\n sh\t$t9, 28($a1)\n sh\t$t0, 28($v1)\n lwc1\t$f10, 60($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t3, $f18\n nop\n sra\t$t2, $t3, 0x10\n sh\t$t2, 30($a1)\n jr\t$ra\n sh\t$t3, 30($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 _MtxF_to_Mtx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `_MtxF_to_Mtx` — benchmark function af:_MtxF_to_Mtx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:_MtxF_to_Mtx: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 <_MtxF_to_Mtx>:\n 0:\tlui\tat,0x4780\n 4:\tmtc1\tat,$f0\n 8:\tlwc1\t$f4,0(a0)\n c:\taddiu\tv1,a1,32\n 10:\tmove\tv0,a1\n 14:\tmul.s\t$f6,$f4,$f0\n 18:\ttrunc.w.s\t$f8,$f6\n 1c:\tmfc1\tt8,$f8\n 20:\tnop\n 24:\tsra\tt7,t8,0x10\n 28:\tsh\tt7,0(a1)\n 2c:\tsh\tt8,32(a1)\n 30:\tlwc1\t$f10,4(a0)\n 34:\tmul.s\t$f16,$f10,$f0\n 38:\ttrunc.w.s\t$f18,$f16\n 3c:\tmfc1\tt1,$f18\n 40:\tnop\n 44:\tsra\tt0,t1,0x10\n 48:\tsh\tt0,2(a1)\n 4c:\tsh\tt1,34(a1)\n 50:\tlwc1\t$f4,8(a0)\n 54:\tmul.s\t$f6,$f4,$f0\n 58:\ttrunc.w.s\t$f8,$f6\n 5c:\tmfc1\tt4,$f8\n 60:\tnop\n 64:\tsra\tt3,t4,0x10\n 68:\tsh\tt3,4(a1)\n 6c:\tsh\tt4,36(a1)\n 70:\tlwc1\t$f10,12(a0)\n 74:\tmul.s\t$f16,$f10,$f0\n 78:\ttrunc.w.s\t$f18,$f16\n 7c:\tmfc1\tt7,$f18\n 80:\tnop\n 84:\tsra\tt6,t7,0x10\n 88:\tsh\tt6,6(a1)\n 8c:\tsh\tt7,38(a1)\n 90:\tlwc1\t$f4,16(a0)\n 94:\tmul.s\t$f6,$f4,$f0\n 98:\ttrunc.w.s\t$f8,$f6\n 9c:\tmfc1\tt0,$f8\n a0:\tnop\n a4:\tsra\tt9,t0,0x10\n a8:\tsh\tt9,8(a1)\n ac:\tsh\tt0,40(a1)\n b0:\tlwc1\t$f10,20(a0)\n b4:\tmul.s\t$f16,$f10,$f0\n b8:\ttrunc.w.s\t$f18,$f16\n bc:\tmfc1\tt3,$f18\n c0:\tnop\n c4:\tsra\tt2,t3,0x10\n c8:\tsh\tt2,10(a1)\n cc:\tsh\tt3,42(a1)\n d0:\tlwc1\t$f4,24(a0)\n d4:\tmul.s\t$f6,$f4,$f0\n d8:\ttrunc.w.s\t$f8,$f6\n dc:\tmfc1\tt6,$f8\n e0:\tnop\n e4:\tsra\tt5,t6,0x10\n e8:\tsh\tt5,12(a1)\n ec:\tsh\tt6,44(a1)\n f0:\tlwc1\t$f10,28(a0)\n f4:\tmul.s\t$f16,$f10,$f0\n f8:\ttrunc.w.s\t$f18,$f16\n fc:\tmfc1\tt9,$f18\n 100:\tnop\n 104:\tsra\tt8,t9,0x10\n 108:\tsh\tt8,14(a1)\n 10c:\tsh\tt9,46(a1)\n 110:\tlwc1\t$f4,32(a0)\n 114:\tmul.s\t$f6,$f4,$f0\n 118:\ttrunc.w.s\t$f8,$f6\n 11c:\tmfc1\tt2,$f8\n 120:\tnop\n 124:\tsra\tt1,t2,0x10\n 128:\tsh\tt1,16(a1)\n 12c:\tsh\tt2,48(a1)\n 130:\tlwc1\t$f10,36(a0)\n 134:\tmul.s\t$f16,$f10,$f0\n 138:\ttrunc.w.s\t$f18,$f16\n 13c:\tmfc1\tt5,$f18\n 140:\tnop\n 144:\tsra\tt4,t5,0x10\n 148:\tsh\tt4,18(a1)\n 14c:\tsh\tt5,18(v1)\n 150:\tlwc1\t$f4,40(a0)\n 154:\tmul.s\t$f6,$f4,$f0\n 158:\ttrunc.w.s\t$f8,$f6\n 15c:\tmfc1\tt8,$f8\n 160:\tnop\n 164:\tsra\tt7,t8,0x10\n 168:\tsh\tt7,20(a1)\n 16c:\tsh\tt8,20(v1)\n 170:\tlwc1\t$f10,44(a0)\n 174:\tmul.s\t$f16,$f10,$f0\n 178:\ttrunc.w.s\t$f18,$f16\n 17c:\tmfc1\tt1,$f18\n 180:\tnop\n 184:\tsra\tt0,t1,0x10\n 188:\tsh\tt0,22(a1)\n 18c:\tsh\tt1,22(v1)\n 190:\tlwc1\t$f4,48(a0)\n 194:\tmul.s\t$f6,$f4,$f0\n 198:\ttrunc.w.s\t$f8,$f6\n 19c:\tmfc1\tt4,$f8\n 1a0:\tnop\n 1a4:\tsra\tt3,t4,0x10\n 1a8:\tsh\tt3,24(a1)\n 1ac:\tsh\tt4,24(v1)\n 1b0:\tlwc1\t$f10,52(a0)\n 1b4:\tmul.s\t$f16,$f10,$f0\n 1b8:\ttrunc.w.s\t$f18,$f16\n 1bc:\tmfc1\tt7,$f18\n 1c0:\tnop\n 1c4:\tsra\tt6,t7,0x10\n 1c8:\tsh\tt6,26(a1)\n 1cc:\tsh\tt7,26(v1)\n 1d0:\tlwc1\t$f4,56(a0)\n 1d4:\tmul.s\t$f6,$f4,$f0\n 1d8:\ttrunc.w.s\t$f8,$f6\n 1dc:\tmfc1\tt0,$f8\n 1e0:\tnop\n 1e4:\tsra\tt9,t0,0x10\n 1e8:\tsh\tt9,28(a1)\n 1ec:\tsh\tt0,28(v1)\n 1f0:\tlwc1\t$f10,60(a0)\n 1f4:\tmul.s\t$f16,$f10,$f0\n 1f8:\ttrunc.w.s\t$f18,$f16\n 1fc:\tmfc1\tt3,$f18\n 200:\tnop\n 204:\tsra\tt2,t3,0x10\n 208:\tsh\tt2,30(a1)\n 20c:\tjr\tra\n 210:\tsh\tt3,30(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\t00000220 .text\n00000000 g F .text\t00000214 _MtxF_to_Mtx\n\n\nContents of section .text:\n 0000 3c014780 44810000 c4840000 24a30020 <.G.D.......$.. \n 0010 00a01025 46002182 4600320d 44184000 ...%F.!.F.2.D.@.\n 0020 00000000 00187c03 a4af0000 a4b80020 ......|........ \n 0030 c48a0004 46005402 4600848d 44099000 ....F.T.F...D...\n 0040 00000000 00094403 a4a80002 a4a90022 ......D........\"\n 0050 c4840008 46002182 4600320d 440c4000 ....F.!.F.2.D.@.\n 0060 00000000 000c5c03 a4ab0004 a4ac0024 ......\\........$\n 0070 c48a000c 46005402 4600848d 440f9000 ....F.T.F...D...\n 0080 00000000 000f7403 a4ae0006 a4af0026 ......t........&\n 0090 c4840010 46002182 4600320d 44084000 ....F.!.F.2.D.@.\n 00a0 00000000 0008cc03 a4b90008 a4a80028 ...............(\n 00b0 c48a0014 46005402 4600848d 440b9000 ....F.T.F...D...\n 00c0 00000000 000b5403 a4aa000a a4ab002a ......T........*\n 00d0 c4840018 46002182 4600320d 440e4000 ....F.!.F.2.D.@.\n 00e0 00000000 000e6c03 a4ad000c a4ae002c ......l........,\n 00f0 c48a001c 46005402 4600848d 44199000 ....F.T.F...D...\n 0100 00000000 0019c403 a4b8000e a4b9002e ................\n 0110 c4840020 46002182 4600320d 440a4000 ... F.!.F.2.D.@.\n 0120 00000000 000a4c03 a4a90010 a4aa0030 ......L........0\n 0130 c48a0024 46005402 4600848d 440d9000 ...$F.T.F...D...\n 0140 00000000 000d6403 a4ac0012 a46d0012 ......d......m..\n 0150 c4840028 46002182 4600320d 44184000 ...(F.!.F.2.D.@.\n 0160 00000000 00187c03 a4af0014 a4780014 ......|......x..\n 0170 c48a002c 46005402 4600848d 44099000 ...,F.T.F...D...\n 0180 00000000 00094403 a4a80016 a4690016 ......D......i..\n 0190 c4840030 46002182 4600320d 440c4000 ...0F.!.F.2.D.@.\n 01a0 00000000 000c5c03 a4ab0018 a46c0018 ......\\......l..\n 01b0 c48a0034 46005402 4600848d 440f9000 ...4F.T.F...D...\n 01c0 00000000 000f7403 a4ae001a a46f001a ......t......o..\n 01d0 c4840038 46002182 4600320d 44084000 ...8F.!.F.2.D.@.\n 01e0 00000000 0008cc03 a4b9001c a468001c .............h..\n 01f0 c48a003c 46005402 4600848d 440b9000 .......\n 0010 000f07d1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff3e 00000000 000f07d1 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000085 0000003c 00000398 p..........<....\n 0010 00000005 0000051c 00000001 000003d4 ................\n 0020 00000004 00000408 00000000 00000000 ................\n 0030 00000011 00000438 00000038 0000047c .......8...8...|\n 0040 00000010 000004b4 00000001 000004c4 ................\n 0050 00000000 00000000 00000001 0000050c ................\n 0060 01408000 1d800013 82ffd012 10131210 .@..............\n 0070 13121013 12101312 10131210 13121013 ................\n 0080 12101312 10131210 13121013 12101312 ................\n 0090 10131210 13121013 1220f000 00000000 ......... ......\n 00a0 00000001 00000000 00000000 00000000 ................\n 00b0 ffffffff 00000000 00000000 00000000 ................\n 00c0 001d001f 0000001b 0000004f 00000000 ...........O....\n 00d0 00000001 00000000 2c200004 0000002a ........, .....*\n 00e0 00000000 1820000f 0000002a 00000214 ..... .....*....\n 00f0 20200001 00000001 00000000 20200000 .......... ..\n 0100 02000000 03000000 04000000 05000000 ................\n 0110 06000000 07000000 08000000 09000000 ................\n 0120 20000000 21000000 0a000000 0b000000 ...!...........\n 0130 0b000000 1a000000 00000000 00000003 ................\n 0140 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0150 7265616c 2d69646f 2d643330 33633630 real-ido-d303c60\n 0160 30313864 30656135 312f752e 69005f4d 018d0ea51/u.i._M\n 0170 7478465f 746f5f4d 74780000 5f4d7478 txF_to_Mtx.._Mtx\n 0180 465f746f 5f4d7478 00000000 00000000 F_to_Mtx........\n 0190 00000001 00000000 00000037 00000000 ...........7....\n 01a0 00000004 00000000 00000085 00000000 ................\n 01b0 00000000 00000001 00000000 00000011 ................\n 01c0 00000000 00000000 01800000 00000000 ................\n 01d0 0000003b 00000000 00000000 00000000 ...;............\n 01e0 18200001 00000000 00000000 00000000 . ..............\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 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 _MtxF_to_Mtx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_calc_a:ido7.1","sym":"add_calc_a","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer","arithmetic"],"loc":53,"refSource":"f32 add_calc_a(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep) {\n f32 stepSize = 0.0f;\n f32 diff = target - *pValue;\n\n if (target != *pValue) {\n if (diff > 180.0f) {\n diff = -(360.0f - diff);\n } else if (diff < -180.0f) {\n diff = 360.0f + diff;\n }\n\n stepSize = diff * fraction;\n\n if ((stepSize >= minStep) || (stepSize <= -minStep)) {\n if (step < stepSize) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n\n if (stepSize > 0.0f) {\n if (target < *pValue) {\n *pValue = target;\n }\n } else if (*pValue < target) {\n *pValue = target;\n }\n } else {\n if (stepSize > 0.0f) {\n stepSize = minStep;\n *pValue += stepSize;\n if (target < *pValue) {\n *pValue = target;\n }\n } else {\n stepSize = -minStep;\n *pValue += -minStep;\n if (*pValue < target) {\n *pValue = target;\n }\n }\n }\n }\n if (*pValue >= 360.0f) {\n *pValue -= 360.0f;\n }\n if (*pValue < 0.0f) {\n *pValue += 360.0f;\n }\n return stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L437-L489","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-16\n 4:\tsw\ta2,24(sp)\n 8:\tmtc1\ta1,$f12\n c:\tlwc1\t$f0,0(a0)\n 10:\tmtc1\tzero,$f2\n 14:\tmtc1\ta3,$f14\n 18:\tc.eq.s\t$f12,$f0\n 1c:\tlui\tat,0x4334\n 20:\tsub.s\t$f18,$f12,$f0\n 24:\tmov.s\t$f16,$f2\n 28:\tbc1tl\t1a0 \n 2c:\tlui\tat,0x43b4\n 30:\tmtc1\tat,$f4\n 34:\tlui\tat,0xc334\n 38:\tc.lt.s\t$f4,$f18\n 3c:\tlwc1\t$f4,24(sp)\n 40:\tbc1fl\t64 \n 44:\tmtc1\tat,$f8\n 48:\tlui\tat,0x43b4\n 4c:\tmtc1\tat,$f6\n 50:\tnop\n 54:\tsub.s\t$f18,$f6,$f18\n 58:\tb\t84 \n 5c:\tneg.s\t$f18,$f18\n 60:\tmtc1\tat,$f8\n 64:\tlui\tat,0x43b4\n 68:\tc.lt.s\t$f18,$f8\n 6c:\tnop\n 70:\tbc1fl\t88 \n 74:\tmul.s\t$f6,$f18,$f4\n 78:\tmtc1\tat,$f10\n 7c:\tnop\n 80:\tadd.s\t$f18,$f10,$f18\n 84:\tmul.s\t$f6,$f18,$f4\n 88:\tlwc1\t$f10,32(sp)\n 8c:\tswc1\t$f6,0(sp)\n 90:\tlwc1\t$f8,0(sp)\n 94:\tlwc1\t$f4,0(sp)\n 98:\tc.le.s\t$f10,$f8\n 9c:\tmov.s\t$f16,$f8\n a0:\tbc1tl\tc0 \n a4:\tc.lt.s\t$f14,$f4\n a8:\tneg.s\t$f18,$f10\n ac:\tc.le.s\t$f8,$f18\n b0:\tlwc1\t$f8,0(sp)\n b4:\tbc1fl\t140 \n b8:\tc.lt.s\t$f2,$f8\n bc:\tc.lt.s\t$f14,$f4\n c0:\tlwc1\t$f6,0(sp)\n c4:\tbc1fl\td8 \n c8:\tneg.s\t$f18,$f14\n cc:\tb\tec \n d0:\tmov.s\t$f16,$f14\n d4:\tneg.s\t$f18,$f14\n d8:\tc.lt.s\t$f6,$f18\n dc:\tnop\n e0:\tbc1fl\tf0 \n e4:\tc.lt.s\t$f2,$f16\n e8:\tmov.s\t$f16,$f18\n ec:\tc.lt.s\t$f2,$f16\n f0:\tadd.s\t$f10,$f0,$f16\n f4:\tbc1f\t11c \n f8:\tswc1\t$f10,0(a0)\n fc:\tlwc1\t$f0,0(a0)\n 100:\tc.lt.s\t$f12,$f0\n 104:\tnop\n 108:\tbc1fl\t1a0 \n 10c:\tlui\tat,0x43b4\n 110:\tswc1\t$f12,0(a0)\n 114:\tb\t19c \n 118:\tlwc1\t$f0,0(a0)\n 11c:\tlwc1\t$f0,0(a0)\n 120:\tc.lt.s\t$f0,$f12\n 124:\tnop\n 128:\tbc1fl\t1a0 \n 12c:\tlui\tat,0x43b4\n 130:\tswc1\t$f12,0(a0)\n 134:\tb\t19c \n 138:\tlwc1\t$f0,0(a0)\n 13c:\tc.lt.s\t$f2,$f8\n 140:\tlwc1\t$f16,32(sp)\n 144:\tbc1fl\t178 \n 148:\tadd.s\t$f10,$f0,$f18\n 14c:\tadd.s\t$f6,$f0,$f16\n 150:\tswc1\t$f6,0(a0)\n 154:\tlwc1\t$f0,0(a0)\n 158:\tc.lt.s\t$f12,$f0\n 15c:\tnop\n 160:\tbc1fl\t1a0 \n 164:\tlui\tat,0x43b4\n 168:\tswc1\t$f12,0(a0)\n 16c:\tb\t19c \n 170:\tlwc1\t$f0,0(a0)\n 174:\tadd.s\t$f10,$f0,$f18\n 178:\tmov.s\t$f16,$f18\n 17c:\tswc1\t$f10,0(a0)\n 180:\tlwc1\t$f0,0(a0)\n 184:\tc.lt.s\t$f0,$f12\n 188:\tnop\n 18c:\tbc1fl\t1a0 \n 190:\tlui\tat,0x43b4\n 194:\tswc1\t$f12,0(a0)\n 198:\tlwc1\t$f0,0(a0)\n 19c:\tlui\tat,0x43b4\n 1a0:\tmtc1\tat,$f8\n 1a4:\tlui\tat,0x43b4\n 1a8:\tc.le.s\t$f8,$f0\n 1ac:\tnop\n 1b0:\tbc1fl\t1d0 \n 1b4:\tc.lt.s\t$f0,$f2\n 1b8:\tmtc1\tat,$f4\n 1bc:\tnop\n 1c0:\tsub.s\t$f6,$f0,$f4\n 1c4:\tswc1\t$f6,0(a0)\n 1c8:\tlwc1\t$f0,0(a0)\n 1cc:\tc.lt.s\t$f0,$f2\n 1d0:\tlui\tat,0x43b4\n 1d4:\tbc1fl\t1f0 \n 1d8:\tmov.s\t$f0,$f16\n 1dc:\tmtc1\tat,$f10\n 1e0:\tnop\n 1e4:\tadd.s\t$f8,$f0,$f10\n 1e8:\tswc1\t$f8,0(a0)\n 1ec:\tmov.s\t$f0,$f16\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,16\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000200 .text\n00000000 g F .text\t000001f8 add_calc_a\n\n\nContents of section .text:\n 0000 27bdfff0 afa60018 44856000 c4800000 '.......D.`.....\n 0010 44801000 44877000 46006032 3c014334 D...D.p.F.`2<.C4\n 0020 46006481 46001406 4503005d 3c0143b4 F.d.F...E..]<.C.\n 0030 44812000 3c01c334 4612203c c7a40018 D. .<..4F. <....\n 0040 45020008 44814000 3c0143b4 44813000 E...D.@.<.C.D.0.\n 0050 00000000 46123481 1000000a 46009487 ....F.4.....F...\n 0060 44814000 3c0143b4 4608903c 00000000 D.@.<.C.F..<....\n 0070 45020005 46049182 44815000 00000000 E...F...D.P.....\n 0080 46125480 46049182 c7aa0020 e7a60000 F.T.F...... ....\n 0090 c7a80000 c7a40000 4608503e 46004406 ........F.P>F.D.\n 00a0 45030007 4604703c 46005487 4612403e E...F.p\n 00b0 c7a80000 45020022 4608103c 4604703c ....E..\"F......\n 01b0 45020007 4602003c 44812000 00000000 E...F..: */\n/* 0:\taddiu\tsp,sp,-16 */\n/* 4:\tsw\ta2,24(sp) */\n/* 8:\tmtc1\ta1,$f12 */\n/* c:\tlwc1\t$f0,0(a0) */\n/* 10:\tmtc1\tzero,$f2 */\n/* 14:\tmtc1\ta3,$f14 */\n/* 18:\tc.eq.s\t$f12,$f0 */\n/* 1c:\tlui\tat,0x4334 */\n/* 20:\tsub.s\t$f18,$f12,$f0 */\n/* 24:\tmov.s\t$f16,$f2 */\n/* 28:\tbc1tl\t1a0 */\n/* 2c:\tlui\tat,0x43b4 */\n/* 30:\tmtc1\tat,$f4 */\n/* 34:\tlui\tat,0xc334 */\n/* 38:\tc.lt.s\t$f4,$f18 */\n/* 3c:\tlwc1\t$f4,24(sp) */\n/* 40:\tbc1fl\t64 */\n/* 44:\tmtc1\tat,$f8 */\n/* 48:\tlui\tat,0x43b4 */\n/* 4c:\tmtc1\tat,$f6 */\n/* 50:\tnop */\n/* 54:\tsub.s\t$f18,$f6,$f18 */\n/* 58:\tb\t84 */\n/* 5c:\tneg.s\t$f18,$f18 */\n/* 60:\tmtc1\tat,$f8 */\n/* 64:\tlui\tat,0x43b4 */\n/* 68:\tc.lt.s\t$f18,$f8 */\n/* 6c:\tnop */\n/* 70:\tbc1fl\t88 */\n/* 74:\tmul.s\t$f6,$f18,$f4 */\n/* 78:\tmtc1\tat,$f10 */\n/* 7c:\tnop */\n/* 80:\tadd.s\t$f18,$f10,$f18 */\n/* 84:\tmul.s\t$f6,$f18,$f4 */\n/* 88:\tlwc1\t$f10,32(sp) */\n/* 8c:\tswc1\t$f6,0(sp) */\n/* 90:\tlwc1\t$f8,0(sp) */\n/* 94:\tlwc1\t$f4,0(sp) */\n/* 98:\tc.le.s\t$f10,$f8 */\n/* 9c:\tmov.s\t$f16,$f8 */\n/* a0:\tbc1tl\tc0 */\n/* a4:\tc.lt.s\t$f14,$f4 */\n/* a8:\tneg.s\t$f18,$f10 */\n/* ac:\tc.le.s\t$f8,$f18 */\n/* b0:\tlwc1\t$f8,0(sp) */\n/* b4:\tbc1fl\t140 */\n/* b8:\tc.lt.s\t$f2,$f8 */\n/* bc:\tc.lt.s\t$f14,$f4 */\n/* c0:\tlwc1\t$f6,0(sp) */\n/* c4:\tbc1fl\td8 */\n/* c8:\tneg.s\t$f18,$f14 */\n/* cc:\tb\tec */\n/* d0:\tmov.s\t$f16,$f14 */\n/* d4:\tneg.s\t$f18,$f14 */\n/* d8:\tc.lt.s\t$f6,$f18 */\n/* dc:\tnop */\n/* e0:\tbc1fl\tf0 */\n/* e4:\tc.lt.s\t$f2,$f16 */\n/* e8:\tmov.s\t$f16,$f18 */\n/* ec:\tc.lt.s\t$f2,$f16 */\n/* f0:\tadd.s\t$f10,$f0,$f16 */\n/* f4:\tbc1f\t11c */\n/* f8:\tswc1\t$f10,0(a0) */\n/* fc:\tlwc1\t$f0,0(a0) */\n/* 100:\tc.lt.s\t$f12,$f0 */\n/* 104:\tnop */\n/* 108:\tbc1fl\t1a0 */\n/* 10c:\tlui\tat,0x43b4 */\n/* 110:\tswc1\t$f12,0(a0) */\n/* 114:\tb\t19c */\n/* 118:\tlwc1\t$f0,0(a0) */\n/* 11c:\tlwc1\t$f0,0(a0) */\n/* 120:\tc.lt.s\t$f0,$f12 */\n/* 124:\tnop */\n/* 128:\tbc1fl\t1a0 */\n/* 12c:\tlui\tat,0x43b4 */\n/* 130:\tswc1\t$f12,0(a0) */\n/* 134:\tb\t19c */\n/* 138:\tlwc1\t$f0,0(a0) */\n/* 13c:\tc.lt.s\t$f2,$f8 */\n/* 140:\tlwc1\t$f16,32(sp) */\n/* 144:\tbc1fl\t178 */\n/* 148:\tadd.s\t$f10,$f0,$f18 */\n/* 14c:\tadd.s\t$f6,$f0,$f16 */\n/* 150:\tswc1\t$f6,0(a0) */\n/* 154:\tlwc1\t$f0,0(a0) */\n/* 158:\tc.lt.s\t$f12,$f0 */\n/* 15c:\tnop */\n/* 160:\tbc1fl\t1a0 */\n/* 164:\tlui\tat,0x43b4 */\n/* 168:\tswc1\t$f12,0(a0) */\n/* 16c:\tb\t19c */\n/* 170:\tlwc1\t$f0,0(a0) */\n/* 174:\tadd.s\t$f10,$f0,$f18 */\n/* 178:\tmov.s\t$f16,$f18 */\n/* 17c:\tswc1\t$f10,0(a0) */\n/* 180:\tlwc1\t$f0,0(a0) */\n/* 184:\tc.lt.s\t$f0,$f12 */\n/* 188:\tnop */\n/* 18c:\tbc1fl\t1a0 */\n/* 190:\tlui\tat,0x43b4 */\n/* 194:\tswc1\t$f12,0(a0) */\n/* 198:\tlwc1\t$f0,0(a0) */\n/* 19c:\tlui\tat,0x43b4 */\n/* 1a0:\tmtc1\tat,$f8 */\n/* 1a4:\tlui\tat,0x43b4 */\n/* 1a8:\tc.le.s\t$f8,$f0 */\n/* 1ac:\tnop */\n/* 1b0:\tbc1fl\t1d0 */\n/* 1b4:\tc.lt.s\t$f0,$f2 */\n/* 1b8:\tmtc1\tat,$f4 */\n/* 1bc:\tnop */\n/* 1c0:\tsub.s\t$f6,$f0,$f4 */\n/* 1c4:\tswc1\t$f6,0(a0) */\n/* 1c8:\tlwc1\t$f0,0(a0) */\n/* 1cc:\tc.lt.s\t$f0,$f2 */\n/* 1d0:\tlui\tat,0x43b4 */\n/* 1d4:\tbc1fl\t1f0 */\n/* 1d8:\tmov.s\t$f0,$f16 */\n/* 1dc:\tmtc1\tat,$f10 */\n/* 1e0:\tnop */\n/* 1e4:\tadd.s\t$f8,$f0,$f10 */\n/* 1e8:\tswc1\t$f8,0(a0) */\n/* 1ec:\tmov.s\t$f0,$f16 */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,16 */\n/* \t... */\nvoid add_calc_a(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc_a': unmodelled control transfer 'bc1tl' at 0x28 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc_a': unmodelled control transfer 'bc1tl' at 0x28 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 add_calc_a(f32 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {\n f32 sp0;\n f32 temp_f0;\n f32 temp_f18;\n f32 temp_f18_2;\n f32 var_f16;\n f32 var_f18;\n\n temp_f0 = *arg0;\n var_f18 = arg1 - temp_f0;\n var_f16 = 0.0f;\n if (arg1 != temp_f0) {\n if (var_f18 > 180.0f) {\n var_f18 = -(360.0f - var_f18);\n } else if (var_f18 < -180.0f) {\n var_f18 += 360.0f;\n }\n sp0 = var_f18 * arg2;\n var_f16 = sp0;\n if ((arg4 <= sp0) || (temp_f18 = -arg4, (sp0 <= temp_f18))) {\n if (arg3 < sp0) {\n var_f16 = arg3;\n } else {\n temp_f18_2 = -arg3;\n if (sp0 < temp_f18_2) {\n var_f16 = temp_f18_2;\n }\n }\n *arg0 = temp_f0 + var_f16;\n if (var_f16 > 0.0f) {\n if (arg1 < *arg0) {\n *arg0 = arg1;\n }\n } else if (*arg0 < arg1) {\n *arg0 = arg1;\n }\n } else {\n var_f16 = arg4;\n if (sp0 > 0.0f) {\n *arg0 = temp_f0 + var_f16;\n if (arg1 < *arg0) {\n *arg0 = arg1;\n }\n } else {\n var_f16 = temp_f18;\n *arg0 = temp_f0 + temp_f18;\n if (*arg0 < arg1) {\n *arg0 = arg1;\n }\n }\n }\n }\n if (*arg0 >= 360.0f) {\n *arg0 -= 360.0f;\n }\n if (*arg0 < 0.0f) {\n *arg0 += 360.0f;\n }\n return var_f16;\n}\n","score":98,"maxScore":137,"compileErrors":null,"breakdown":{"insert":11,"delete":14,"replace":9,"opMismatch":0,"argMismatch":64},"quality":{"score":100,"lines":59,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":98,"maxScore":137,"ratio":0.7153284671532847,"kinds":{"insert":11,"delete":14,"replace":9,"opMismatch":0,"argMismatch":64}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc_a` — benchmark function af:add_calc_a:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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_a\n addiu\t$sp, $sp, -16\n sw\t$a2, 24($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$zero, $f2\n mtc1\t$a3, $f14\n c.eq.s\t$f12, $f0\n lui\t$at, 0x4334\n sub.s\t$f18, $f12, $f0\n mov.s\t$f16, $f2\n bc1tl\t.L1a0\n lui\t$at, 0x43b4\n mtc1\t$at, $f4\n lui\t$at, 0xc334\n c.lt.s\t$f4, $f18\n lwc1\t$f4, 24($sp)\n bc1fl\t.L64\n mtc1\t$at, $f8\n lui\t$at, 0x43b4\n mtc1\t$at, $f6\n nop\n sub.s\t$f18, $f6, $f18\n b\t.L84\n neg.s\t$f18, $f18\n mtc1\t$at, $f8\n.L64:\n lui\t$at, 0x43b4\n c.lt.s\t$f18, $f8\n nop\n bc1fl\t.L88\n mul.s\t$f6, $f18, $f4\n mtc1\t$at, $f10\n nop\n add.s\t$f18, $f10, $f18\n.L84:\n mul.s\t$f6, $f18, $f4\n.L88:\n lwc1\t$f10, 32($sp)\n swc1\t$f6, 0($sp)\n lwc1\t$f8, 0($sp)\n lwc1\t$f4, 0($sp)\n c.le.s\t$f10, $f8\n mov.s\t$f16, $f8\n bc1tl\t.Lc0\n c.lt.s\t$f14, $f4\n neg.s\t$f18, $f10\n c.le.s\t$f8, $f18\n lwc1\t$f8, 0($sp)\n bc1fl\t.L140\n c.lt.s\t$f2, $f8\n c.lt.s\t$f14, $f4\n.Lc0:\n lwc1\t$f6, 0($sp)\n bc1fl\t.Ld8\n neg.s\t$f18, $f14\n b\t.Lec\n mov.s\t$f16, $f14\n neg.s\t$f18, $f14\n.Ld8:\n c.lt.s\t$f6, $f18\n nop\n bc1fl\t.Lf0\n c.lt.s\t$f2, $f16\n mov.s\t$f16, $f18\n.Lec:\n c.lt.s\t$f2, $f16\n.Lf0:\n add.s\t$f10, $f0, $f16\n bc1f\t.L11c\n swc1\t$f10, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n.L11c:\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f2, $f8\n.L140:\n lwc1\t$f16, 32($sp)\n bc1fl\t.L178\n add.s\t$f10, $f0, $f18\n add.s\t$f6, $f0, $f16\n swc1\t$f6, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n add.s\t$f10, $f0, $f18\n.L178:\n mov.s\t$f16, $f18\n swc1\t$f10, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n lwc1\t$f0, 0($a0)\n.L19c:\n lui\t$at, 0x43b4\n.L1a0:\n mtc1\t$at, $f8\n lui\t$at, 0x43b4\n c.le.s\t$f8, $f0\n nop\n bc1fl\t.L1d0\n c.lt.s\t$f0, $f2\n mtc1\t$at, $f4\n nop\n sub.s\t$f6, $f0, $f4\n swc1\t$f6, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f2\n.L1d0:\n lui\t$at, 0x43b4\n bc1fl\t.L1f0\n mov.s\t$f0, $f16\n mtc1\t$at, $f10\n nop\n add.s\t$f8, $f0, $f10\n swc1\t$f8, 0($a0)\n mov.s\t$f0, $f16\n.L1f0:\n jr\t$ra\n addiu\t$sp, $sp, 16\nASM_INPUT\n\n# (This function ran with NO context header — the 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_a # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk 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_a` — benchmark function af:add_calc_a:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_a: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,-16\n 4:\tsw\ta2,24(sp)\n 8:\tmtc1\ta1,$f12\n c:\tlwc1\t$f0,0(a0)\n 10:\tmtc1\tzero,$f2\n 14:\tmtc1\ta3,$f14\n 18:\tc.eq.s\t$f12,$f0\n 1c:\tlui\tat,0x4334\n 20:\tsub.s\t$f18,$f12,$f0\n 24:\tmov.s\t$f16,$f2\n 28:\tbc1tl\t1a0 \n 2c:\tlui\tat,0x43b4\n 30:\tmtc1\tat,$f4\n 34:\tlui\tat,0xc334\n 38:\tc.lt.s\t$f4,$f18\n 3c:\tlwc1\t$f4,24(sp)\n 40:\tbc1fl\t64 \n 44:\tmtc1\tat,$f8\n 48:\tlui\tat,0x43b4\n 4c:\tmtc1\tat,$f6\n 50:\tnop\n 54:\tsub.s\t$f18,$f6,$f18\n 58:\tb\t84 \n 5c:\tneg.s\t$f18,$f18\n 60:\tmtc1\tat,$f8\n 64:\tlui\tat,0x43b4\n 68:\tc.lt.s\t$f18,$f8\n 6c:\tnop\n 70:\tbc1fl\t88 \n 74:\tmul.s\t$f6,$f18,$f4\n 78:\tmtc1\tat,$f10\n 7c:\tnop\n 80:\tadd.s\t$f18,$f10,$f18\n 84:\tmul.s\t$f6,$f18,$f4\n 88:\tlwc1\t$f10,32(sp)\n 8c:\tswc1\t$f6,0(sp)\n 90:\tlwc1\t$f8,0(sp)\n 94:\tlwc1\t$f4,0(sp)\n 98:\tc.le.s\t$f10,$f8\n 9c:\tmov.s\t$f16,$f8\n a0:\tbc1tl\tc0 \n a4:\tc.lt.s\t$f14,$f4\n a8:\tneg.s\t$f18,$f10\n ac:\tc.le.s\t$f8,$f18\n b0:\tlwc1\t$f8,0(sp)\n b4:\tbc1fl\t140 \n b8:\tc.lt.s\t$f2,$f8\n bc:\tc.lt.s\t$f14,$f4\n c0:\tlwc1\t$f6,0(sp)\n c4:\tbc1fl\td8 \n c8:\tneg.s\t$f18,$f14\n cc:\tb\tec \n d0:\tmov.s\t$f16,$f14\n d4:\tneg.s\t$f18,$f14\n d8:\tc.lt.s\t$f6,$f18\n dc:\tnop\n e0:\tbc1fl\tf0 \n e4:\tc.lt.s\t$f2,$f16\n e8:\tmov.s\t$f16,$f18\n ec:\tc.lt.s\t$f2,$f16\n f0:\tadd.s\t$f10,$f0,$f16\n f4:\tbc1f\t11c \n f8:\tswc1\t$f10,0(a0)\n fc:\tlwc1\t$f0,0(a0)\n 100:\tc.lt.s\t$f12,$f0\n 104:\tnop\n 108:\tbc1fl\t1a0 \n 10c:\tlui\tat,0x43b4\n 110:\tswc1\t$f12,0(a0)\n 114:\tb\t19c \n 118:\tlwc1\t$f0,0(a0)\n 11c:\tlwc1\t$f0,0(a0)\n 120:\tc.lt.s\t$f0,$f12\n 124:\tnop\n 128:\tbc1fl\t1a0 \n 12c:\tlui\tat,0x43b4\n 130:\tswc1\t$f12,0(a0)\n 134:\tb\t19c \n 138:\tlwc1\t$f0,0(a0)\n 13c:\tc.lt.s\t$f2,$f8\n 140:\tlwc1\t$f16,32(sp)\n 144:\tbc1fl\t178 \n 148:\tadd.s\t$f10,$f0,$f18\n 14c:\tadd.s\t$f6,$f0,$f16\n 150:\tswc1\t$f6,0(a0)\n 154:\tlwc1\t$f0,0(a0)\n 158:\tc.lt.s\t$f12,$f0\n 15c:\tnop\n 160:\tbc1fl\t1a0 \n 164:\tlui\tat,0x43b4\n 168:\tswc1\t$f12,0(a0)\n 16c:\tb\t19c \n 170:\tlwc1\t$f0,0(a0)\n 174:\tadd.s\t$f10,$f0,$f18\n 178:\tmov.s\t$f16,$f18\n 17c:\tswc1\t$f10,0(a0)\n 180:\tlwc1\t$f0,0(a0)\n 184:\tc.lt.s\t$f0,$f12\n 188:\tnop\n 18c:\tbc1fl\t1a0 \n 190:\tlui\tat,0x43b4\n 194:\tswc1\t$f12,0(a0)\n 198:\tlwc1\t$f0,0(a0)\n 19c:\tlui\tat,0x43b4\n 1a0:\tmtc1\tat,$f8\n 1a4:\tlui\tat,0x43b4\n 1a8:\tc.le.s\t$f8,$f0\n 1ac:\tnop\n 1b0:\tbc1fl\t1d0 \n 1b4:\tc.lt.s\t$f0,$f2\n 1b8:\tmtc1\tat,$f4\n 1bc:\tnop\n 1c0:\tsub.s\t$f6,$f0,$f4\n 1c4:\tswc1\t$f6,0(a0)\n 1c8:\tlwc1\t$f0,0(a0)\n 1cc:\tc.lt.s\t$f0,$f2\n 1d0:\tlui\tat,0x43b4\n 1d4:\tbc1fl\t1f0 \n 1d8:\tmov.s\t$f0,$f16\n 1dc:\tmtc1\tat,$f10\n 1e0:\tnop\n 1e4:\tadd.s\t$f8,$f0,$f10\n 1e8:\tswc1\t$f8,0(a0)\n 1ec:\tmov.s\t$f0,$f16\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,16\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000200 .text\n00000000 g F .text\t000001f8 add_calc_a\n\n\nContents of section .text:\n 0000 27bdfff0 afa60018 44856000 c4800000 '.......D.`.....\n 0010 44801000 44877000 46006032 3c014334 D...D.p.F.`2<.C4\n 0020 46006481 46001406 4503005d 3c0143b4 F.d.F...E..]<.C.\n 0030 44812000 3c01c334 4612203c c7a40018 D. .<..4F. <....\n 0040 45020008 44814000 3c0143b4 44813000 E...D.@.<.C.D.0.\n 0050 00000000 46123481 1000000a 46009487 ....F.4.....F...\n 0060 44814000 3c0143b4 4608903c 00000000 D.@.<.C.F..<....\n 0070 45020005 46049182 44815000 00000000 E...F...D.P.....\n 0080 46125480 46049182 c7aa0020 e7a60000 F.T.F...... ....\n 0090 c7a80000 c7a40000 4608503e 46004406 ........F.P>F.D.\n 00a0 45030007 4604703c 46005487 4612403e E...F.p\n 00b0 c7a80000 45020022 4608103c 4604703c ....E..\"F......\n 01b0 45020007 4602003c 44812000 00000000 E...F.. 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc_short_angle3\n sw\t$a1, 4($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n mtc1\t$a2, $f12\n beq\t$a1, $v1, .Lbc\n andi\t$v0, $v1, 0xffff\n andi\t$a3, $a1, 0xffff\n slt\t$at, $a3, $v0\n beqz\t$at, .L38\n move\t$a2, $a3\n lui\t$at, 0x1\n addu\t$a2, $a3, $at\n.L38:\n subu\t$t6, $a2, $v0\n mtc1\t$t6, $f4\n lh\t$t7, 14($sp)\n lh\t$t8, 18($sp)\n cvt.s.w\t$f6, $f4\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f14, $f8\n mul.s\t$f2, $f6, $f12\n c.lt.s\t$f14, $f2\n mov.s\t$f0, $f2\n bc1fl\t.L78\n mtc1\t$t8, $f10\n b\t.L94\n mov.s\t$f0, $f14\n mtc1\t$t8, $f10\n.L78:\n nop\n cvt.s.w\t$f12, $f10\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L98\n trunc.w.s\t$f16, $f0\n mov.s\t$f0, $f12\n.L94:\n trunc.w.s\t$f16, $f0\n.L98:\n mfc1\t$t0, $f16\n nop\n addu\t$a3, $t0, $v0\n slt\t$at, $a2, $a3\n beqzl\t$at, .Lb8\n sh\t$a3, 0($a0)\n move\t$a3, $a2\n sh\t$a3, 0($a0)\n.Lb8:\n lh\t$v1, 0($a0)\n.Lbc:\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc_short_angle3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc0:ido7.1","sym":"add_calc0","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":11,"refSource":"void add_calc0(f32* pValue, f32 fraction, f32 step) {\n f32 stepSize = *pValue * fraction;\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue -= stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\n","proto":{"add_calc0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc0' — lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f2,0(a0) */\n/* 8:\tmtc1\ta2,$f14 */\n/* c:\tmul.s\t$f0,$f2,$f12 */\n/* 10:\tc.lt.s\t$f14,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1fl\t2c */\n/* 1c:\tneg.s\t$f12,$f14 */\n/* 20:\tb\t40 */\n/* 24:\tmov.s\t$f0,$f14 */\n/* 28:\tneg.s\t$f12,$f14 */\n/* 2c:\tc.lt.s\t$f0,$f12 */\n/* 30:\tnop */\n/* 34:\tbc1fl\t44 */\n/* 38:\tsub.s\t$f4,$f2,$f0 */\n/* 3c:\tmov.s\t$f0,$f12 */\n/* 40:\tsub.s\t$f4,$f2,$f0 */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f4,0(a0) */\n/* 4c:\tnop */\nvoid add_calc0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc0(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f12;\n f32 temp_f2;\n f32 var_f0;\n\n temp_f2 = *arg0;\n var_f0 = temp_f2 * arg1;\n if (arg2 < var_f0) {\n var_f0 = arg2;\n } else {\n temp_f12 = -arg2;\n if (var_f0 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n *arg0 = temp_f2 - var_f0;\n}\n","score":15,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":21,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc0\n mtc1\t$a1, $f12\n lwc1\t$f2, 0($a0)\n mtc1\t$a2, $f14\n mul.s\t$f0, $f2, $f12\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L2c\n neg.s\t$f12, $f14\n b\t.L40\n mov.s\t$f0, $f14\n neg.s\t$f12, $f14\n.L2c:\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L44\n sub.s\t$f4, $f2, $f0\n mov.s\t$f0, $f12\n.L40:\n sub.s\t$f4, $f2, $f0\n.L44:\n jr\t$ra\n swc1\t$f4, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc2:ido7.1","sym":"add_calc2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":14,"refSource":"void add_calc2(f32* pValue, f32 target, f32 fraction, f32 step) {\n f32 stepSize;\n if (*pValue != target) {\n stepSize = fraction * (target - *pValue);\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\n","proto":{"add_calc2":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc2' — lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tc.eq.s\t$f12,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1t\t68 */\n/* 1c:\tnop */\n/* 20:\tsub.s\t$f4,$f12,$f0 */\n/* 24:\tlwc1\t$f6,12(sp) */\n/* 28:\tlwc1\t$f12,12(sp) */\n/* 2c:\tmul.s\t$f2,$f4,$f14 */\n/* 30:\tc.lt.s\t$f6,$f2 */\n/* 34:\tnop */\n/* 38:\tbc1fl\t4c */\n/* 3c:\tneg.s\t$f12,$f12 */\n/* 40:\tb\t60 */\n/* 44:\tmov.s\t$f2,$f6 */\n/* 48:\tneg.s\t$f12,$f12 */\n/* 4c:\tc.lt.s\t$f2,$f12 */\n/* 50:\tnop */\n/* 54:\tbc1fl\t64 */\n/* 58:\tadd.s\t$f8,$f0,$f2 */\n/* 5c:\tmov.s\t$f2,$f12 */\n/* 60:\tadd.s\t$f8,$f0,$f2 */\n/* 64:\tswc1\t$f8,0(a0) */\n/* 68:\tjr\tra */\n/* 6c:\tnop */\nvoid add_calc2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc2(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 temp_f12;\n f32 var_f2;\n\n temp_f0 = *arg0;\n if (arg1 != temp_f0) {\n var_f2 = (arg1 - temp_f0) * arg2;\n if (arg3 < var_f2) {\n var_f2 = arg3;\n } else {\n temp_f12 = -arg3;\n if (var_f2 < temp_f12) {\n var_f2 = temp_f12;\n }\n }\n *arg0 = temp_f0 + var_f2;\n }\n}\n","score":4,"maxScore":28,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":28,"ratio":0.14285714285714285,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc2\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n c.eq.s\t$f12, $f0\n nop\n bc1t\t.L68\n nop\n sub.s\t$f4, $f12, $f0\n lwc1\t$f6, 12($sp)\n lwc1\t$f12, 12($sp)\n mul.s\t$f2, $f4, $f14\n c.lt.s\t$f6, $f2\n nop\n bc1fl\t.L4c\n neg.s\t$f12, $f12\n b\t.L60\n mov.s\t$f2, $f6\n neg.s\t$f12, $f12\n.L4c:\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L64\n add.s\t$f8, $f0, $f2\n mov.s\t$f2, $f12\n.L60:\n add.s\t$f8, $f0, $f2\n.L64:\n swc1\t$f8, 0($a0)\n.L68:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:adds:ido7.1","sym":"adds","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","branch","pointer","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel adds\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n div\t$zero, $v0, $a2\n sll\t$a3, $a3, 0x10\n sra\t$a3, $a3, 0x10\n bnez\t$a2, .L44\n nop\n break\t0x7\n.L44:\n li\t$at, -1\n bne\t$a2, $at, .L5c\n lui\t$at, 0x8000\n bne\t$v0, $at, .L5c\n nop\n break\t0x6\n.L5c:\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$at, $a3, $v0\n beqz\t$at, .L80\n negu\t$t7, $a3\n addu\t$t6, $v1, $a3\n jr\t$ra\n sh\t$t6, 0($a0)\n.L80:\n slt\t$at, $v0, $t7\n beqz\t$at, .L98\n addu\t$t9, $v1, $v0\n subu\t$t8, $v1, $a3\n jr\t$ra\n sh\t$t8, 0($a0)\n.L98:\n sh\t$t9, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function adds # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:atans_table:ido7.1","sym":"atans_table","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":36,"refSource":"s16 atans_table(f32 x, f32 y) {\n s32 tbl;\n\n if (y >= 0.0f) {\n if (x >= 0.0f) {\n if (y <= x) {\n if (y != 0.0f) {\n tbl = U_GetAtanTable(y, x);\n } else {\n tbl = 0;\n }\n } else {\n tbl = 0x4000 - U_GetAtanTable(x, y);\n }\n } else {\n if (-x < y) {\n tbl = U_GetAtanTable(-x, y) + 0x4000;\n } else {\n tbl = 0x8000 - U_GetAtanTable(y, -x);\n }\n }\n } else if (x < 0.0f) {\n if (-y <= -x) {\n tbl = U_GetAtanTable(-y, -x) + 0x8000;\n } else {\n tbl = 0xC000 - U_GetAtanTable(-x, -y);\n }\n } else {\n if (x < -y) {\n tbl = U_GetAtanTable(x, -y) + 0xC000;\n } else {\n tbl = -U_GetAtanTable(-y, x);\n }\n }\n return tbl;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_math_atan.c#L101-L136","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f0\n 4:\taddiu\tsp,sp,-40\n 8:\tsdc1\t$f22,24(sp)\n c:\tc.le.s\t$f0,$f14\n 10:\tsdc1\t$f20,16(sp)\n 14:\tmov.s\t$f20,$f14\n 18:\tmov.s\t$f22,$f12\n 1c:\tbc1f\tc8 \n 20:\tsw\tra,36(sp)\n 24:\tc.le.s\t$f0,$f12\n 28:\tnop\n 2c:\tbc1fl\t8c \n 30:\tneg.s\t$f0,$f22\n 34:\tc.le.s\t$f14,$f12\n 38:\tnop\n 3c:\tbc1fl\t74 \n 40:\tcvt.d.s\t$f12,$f22\n 44:\tc.eq.s\t$f14,$f0\n 48:\tnop\n 4c:\tbc1t\t68 \n 50:\tnop\n 54:\tcvt.d.s\t$f12,$f14\n 58:\tjal\t0 \n 5c:\tcvt.d.s\t$f14,$f22\n 60:\tb\t15c \n 64:\tmove\tv1,v0\n 68:\tb\t15c \n 6c:\tmove\tv1,zero\n 70:\tcvt.d.s\t$f12,$f22\n 74:\tjal\t0 \n 78:\tcvt.d.s\t$f14,$f20\n 7c:\tli\tt6,16384\n 80:\tb\t15c \n 84:\tsubu\tv1,t6,v0\n 88:\tneg.s\t$f0,$f22\n 8c:\tc.lt.s\t$f0,$f20\n 90:\tnop\n 94:\tbc1fl\tb4 \n 98:\tcvt.d.s\t$f12,$f20\n 9c:\tcvt.d.s\t$f12,$f0\n a0:\tjal\t0 \n a4:\tcvt.d.s\t$f14,$f20\n a8:\tb\t15c \n ac:\taddiu\tv1,v0,16384\n b0:\tcvt.d.s\t$f12,$f20\n b4:\tjal\t0 \n b8:\tcvt.d.s\t$f14,$f0\n bc:\tli\tt7,0x8000\n c0:\tb\t15c \n c4:\tsubu\tv1,t7,v0\n c8:\tc.lt.s\t$f22,$f0\n cc:\tnop\n d0:\tbc1fl\t124 \n d4:\tneg.s\t$f2,$f20\n d8:\tneg.s\t$f0,$f22\n dc:\tneg.s\t$f2,$f20\n e0:\tc.le.s\t$f2,$f0\n e4:\tnop\n e8:\tbc1fl\t10c \n ec:\tcvt.d.s\t$f12,$f0\n f0:\tcvt.d.s\t$f12,$f2\n f4:\tjal\t0 \n f8:\tcvt.d.s\t$f14,$f0\n fc:\tli\tat,0x8000\n 100:\tb\t15c \n 104:\taddu\tv1,v0,at\n 108:\tcvt.d.s\t$f12,$f0\n 10c:\tjal\t0 \n 110:\tcvt.d.s\t$f14,$f2\n 114:\tli\tt8,0xc000\n 118:\tb\t15c \n 11c:\tsubu\tv1,t8,v0\n 120:\tneg.s\t$f2,$f20\n 124:\tc.lt.s\t$f22,$f2\n 128:\tnop\n 12c:\tbc1fl\t150 \n 130:\tcvt.d.s\t$f12,$f2\n 134:\tcvt.d.s\t$f12,$f22\n 138:\tjal\t0 \n 13c:\tcvt.d.s\t$f14,$f2\n 140:\tli\tat,0xc000\n 144:\tb\t15c \n 148:\taddu\tv1,v0,at\n 14c:\tcvt.d.s\t$f12,$f2\n 150:\tjal\t0 \n 154:\tcvt.d.s\t$f14,$f22\n 158:\tnegu\tv1,v0\n 15c:\tlw\tra,36(sp)\n 160:\tsll\tv0,v1,0x10\n 164:\tldc1\t$f20,16(sp)\n 168:\tldc1\t$f22,24(sp)\n 16c:\taddiu\tsp,sp,40\n 170:\tjr\tra\n 174:\tsra\tv0,v0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000180 .text\n00000000 g F .text\t00000178 atans_table\n00000000 F *UND*\t00000000 U_GetAtanTable\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000058 R_MIPS_26 U_GetAtanTable\n00000074 R_MIPS_26 U_GetAtanTable\n000000a0 R_MIPS_26 U_GetAtanTable\n000000b4 R_MIPS_26 U_GetAtanTable\n000000f4 R_MIPS_26 U_GetAtanTable\n0000010c R_MIPS_26 U_GetAtanTable\n00000138 R_MIPS_26 U_GetAtanTable\n00000150 R_MIPS_26 U_GetAtanTable\n\n\nContents of section .text:\n 0000 44800000 27bdffd8 f7b60018 460e003e D...'.......F..>\n 0010 f7b40010 46007506 46006586 4500002a ....F.u.F.e.E..*\n 0020 afbf0024 460c003e 00000000 45020017 ...$F..>....E...\n 0030 4600b007 460c703e 00000000 4502000d F...F.p>....E...\n 0040 4600b321 46007032 00000000 45010006 F..!F.p2....E...\n 0050 00000000 46007321 0c000000 4600b3a1 ....F.s!....F...\n 0060 1000003e 00401825 1000003c 00001825 ...>.@.%...<...%\n 0070 4600b321 0c000000 4600a3a1 240e4000 F..!....F...$.@.\n 0080 10000036 01c21823 4600b007 4614003c ...6...#F...F..<\n 0090 00000000 45020007 4600a321 46000321 ....E...F..!F..!\n 00a0 0c000000 4600a3a1 1000002c 24434000 ....F......,$C@.\n 00b0 4600a321 0c000000 460003a1 340f8000 F..!....F...4...\n 00c0 10000026 01e21823 4600b03c 00000000 ...&...#F..<....\n 00d0 45020014 4600a087 4600b007 4600a087 E...F...F...F...\n 00e0 4600103e 00000000 45020008 46000321 F..>....E...F..!\n 00f0 46001321 0c000000 460003a1 34018000 F..!....F...4...\n 0100 10000016 00411821 46000321 0c000000 .....A.!F..!....\n 0110 460013a1 3418c000 10000010 03021823 F...4..........#\n 0120 4600a087 4602b03c 00000000 45020008 F...F..<....E...\n 0130 46001321 4600b321 0c000000 460013a1 F..!F..!....F...\n 0140 3401c000 10000005 00411821 46001321 4........A.!F..!\n 0150 0c000000 4600b3a1 00021823 8fbf0024 ....F......#...$\n 0160 00031400 d7b40010 d7b60018 27bd0028 ............'..(\n 0170 03e00008 00021403 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c00e 00000000 . ..............\n 0010 00f0f00f 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c00e 00000000 00f0f00f 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000005e 00000018 00000358 p......^.......X\n 0010 00000006 000004d4 00000001 00000370 ...............p\n 0020 00000004 000003a4 00000000 00000000 ................\n 0030 00000011 000003d4 00000038 00000418 ...........8....\n 0040 0000001c 00000450 00000001 0000046c .......P.......l\n 0050 00000000 00000000 00000002 000004b4 ................\n 0060 0220e220 e0331313 14213534 14253315 . . .3...!54.%3.\n 0070 15253415 23360000 00000000 00000001 .%4.#6..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00f00000 fffffff0 00000028 001d001f ...........(....\n 00a0 0000001b 0000003c 00000000 00000001 .......<........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000178 20200001 . .....*...x ..\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 2d383437 63323165 31356433 -ido-847c21e15d3\n 0140 65666562 642f752e 69006174 616e735f efebd/u.i.atans_\n 0150 7461626c 65000000 6174616e 735f7461 table...atans_ta\n 0160 626c6500 555f4765 74417461 6e546162 ble.U_GetAtanTab\n 0170 6c650000 00000000 00000001 00000000 le..............\n 0180 00000036 00000000 00000004 00000000 ...6............\n 0190 0000005e 00000000 00000000 00000001 ...^............\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000016 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 0000000c 00000000 18cfffff 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 'atans_table' — lift: cannot lift 'atans_table': 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:\tmtc1\tzero,$f0 */\n/* 4:\taddiu\tsp,sp,-40 */\n/* 8:\tsdc1\t$f22,24(sp) */\n/* c:\tc.le.s\t$f0,$f14 */\n/* 10:\tsdc1\t$f20,16(sp) */\n/* 14:\tmov.s\t$f20,$f14 */\n/* 18:\tmov.s\t$f22,$f12 */\n/* 1c:\tbc1f\tc8 */\n/* 20:\tsw\tra,36(sp) */\n/* 24:\tc.le.s\t$f0,$f12 */\n/* 28:\tnop */\n/* 2c:\tbc1fl\t8c */\n/* 30:\tneg.s\t$f0,$f22 */\n/* 34:\tc.le.s\t$f14,$f12 */\n/* 38:\tnop */\n/* 3c:\tbc1fl\t74 */\n/* 40:\tcvt.d.s\t$f12,$f22 */\n/* 44:\tc.eq.s\t$f14,$f0 */\n/* 48:\tnop */\n/* 4c:\tbc1t\t68 */\n/* 50:\tnop */\n/* 54:\tcvt.d.s\t$f12,$f14 */\n/* 58:\tjal\t0 */\n/* 5c:\tcvt.d.s\t$f14,$f22 */\n/* 60:\tb\t15c */\n/* 64:\tmove\tv1,v0 */\n/* 68:\tb\t15c */\n/* 6c:\tmove\tv1,zero */\n/* 70:\tcvt.d.s\t$f12,$f22 */\n/* 74:\tjal\t0 */\n/* 78:\tcvt.d.s\t$f14,$f20 */\n/* 7c:\tli\tt6,16384 */\n/* 80:\tb\t15c */\n/* 84:\tsubu\tv1,t6,v0 */\n/* 88:\tneg.s\t$f0,$f22 */\n/* 8c:\tc.lt.s\t$f0,$f20 */\n/* 90:\tnop */\n/* 94:\tbc1fl\tb4 */\n/* 98:\tcvt.d.s\t$f12,$f20 */\n/* 9c:\tcvt.d.s\t$f12,$f0 */\n/* a0:\tjal\t0 */\n/* a4:\tcvt.d.s\t$f14,$f20 */\n/* a8:\tb\t15c */\n/* ac:\taddiu\tv1,v0,16384 */\n/* b0:\tcvt.d.s\t$f12,$f20 */\n/* b4:\tjal\t0 */\n/* b8:\tcvt.d.s\t$f14,$f0 */\n/* bc:\tli\tt7,0x8000 */\n/* c0:\tb\t15c */\n/* c4:\tsubu\tv1,t7,v0 */\n/* c8:\tc.lt.s\t$f22,$f0 */\n/* cc:\tnop */\n/* d0:\tbc1fl\t124 */\n/* d4:\tneg.s\t$f2,$f20 */\n/* d8:\tneg.s\t$f0,$f22 */\n/* dc:\tneg.s\t$f2,$f20 */\n/* e0:\tc.le.s\t$f2,$f0 */\n/* e4:\tnop */\n/* e8:\tbc1fl\t10c */\n/* ec:\tcvt.d.s\t$f12,$f0 */\n/* f0:\tcvt.d.s\t$f12,$f2 */\n/* f4:\tjal\t0 */\n/* f8:\tcvt.d.s\t$f14,$f0 */\n/* fc:\tli\tat,0x8000 */\n/* 100:\tb\t15c */\n/* 104:\taddu\tv1,v0,at */\n/* 108:\tcvt.d.s\t$f12,$f0 */\n/* 10c:\tjal\t0 */\n/* 110:\tcvt.d.s\t$f14,$f2 */\n/* 114:\tli\tt8,0xc000 */\n/* 118:\tb\t15c */\n/* 11c:\tsubu\tv1,t8,v0 */\n/* 120:\tneg.s\t$f2,$f20 */\n/* 124:\tc.lt.s\t$f22,$f2 */\n/* 128:\tnop */\n/* 12c:\tbc1fl\t150 */\n/* 130:\tcvt.d.s\t$f12,$f2 */\n/* 134:\tcvt.d.s\t$f12,$f22 */\n/* 138:\tjal\t0 */\n/* 13c:\tcvt.d.s\t$f14,$f2 */\n/* 140:\tli\tat,0xc000 */\n/* 144:\tb\t15c */\n/* 148:\taddu\tv1,v0,at */\n/* 14c:\tcvt.d.s\t$f12,$f2 */\n/* 150:\tjal\t0 */\n/* 154:\tcvt.d.s\t$f14,$f22 */\n/* 158:\tnegu\tv1,v0 */\n/* 15c:\tlw\tra,36(sp) */\n/* 160:\tsll\tv0,v1,0x10 */\n/* 164:\tldc1\t$f20,16(sp) */\n/* 168:\tldc1\t$f22,24(sp) */\n/* 16c:\taddiu\tsp,sp,40 */\n/* 170:\tjr\tra */\n/* 174:\tsra\tv0,v0,0x10 */\n/* \t... */\nvoid atans_table(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'atans_table': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":103,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'atans_table': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 U_GetAtanTable(f64, f64); /* extern */\n\ns16 atans_table(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 temp_f0_2;\n f32 temp_f2;\n f32 temp_f2_2;\n s16 var_v1;\n\n if (arg1 >= 0.0f) {\n if (arg0 >= 0.0f) {\n if (arg1 <= arg0) {\n if (arg1 != 0.0f) {\n var_v1 = U_GetAtanTable((f64) arg1, (f64) arg0);\n } else {\n var_v1 = 0;\n }\n } else {\n var_v1 = 0x4000 - U_GetAtanTable((f64) arg0, (f64) arg1);\n }\n } else {\n temp_f0 = -arg0;\n if (temp_f0 < arg1) {\n var_v1 = U_GetAtanTable((f64) temp_f0, (f64) arg1) + 0x4000;\n } else {\n var_v1 = 0x8000 - U_GetAtanTable((f64) arg1, (f64) temp_f0);\n }\n }\n } else if (arg0 < 0.0f) {\n temp_f0_2 = -arg0;\n temp_f2 = -arg1;\n if (temp_f2 <= temp_f0_2) {\n var_v1 = U_GetAtanTable((f64) temp_f2, (f64) temp_f0_2) + 0x8000;\n } else {\n var_v1 = 0xC000 - U_GetAtanTable((f64) temp_f0_2, (f64) temp_f2);\n }\n } else {\n temp_f2_2 = -arg1;\n if (arg0 < temp_f2_2) {\n var_v1 = U_GetAtanTable((f64) arg0, (f64) temp_f2_2) + 0xC000;\n } else {\n var_v1 = -U_GetAtanTable((f64) temp_f2_2, (f64) arg0);\n }\n }\n return var_v1;\n}\n","score":27,"maxScore":112,"compileErrors":null,"breakdown":{"insert":18,"delete":4,"replace":5,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":44,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":27,"maxScore":112,"ratio":0.24107142857142858,"kinds":{"insert":18,"delete":4,"replace":5,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `atans_table` — benchmark function af:atans_table:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel atans_table\n mtc1\t$zero, $f0\n addiu\t$sp, $sp, -40\n sdc1\t$f22, 24($sp)\n c.le.s\t$f0, $f14\n sdc1\t$f20, 16($sp)\n mov.s\t$f20, $f14\n mov.s\t$f22, $f12\n bc1f\t.Lc8\n sw\t$ra, 36($sp)\n c.le.s\t$f0, $f12\n nop\n bc1fl\t.L8c\n neg.s\t$f0, $f22\n c.le.s\t$f14, $f12\n nop\n bc1fl\t.L74\n cvt.d.s\t$f12, $f22\n c.eq.s\t$f14, $f0\n nop\n bc1t\t.L68\n nop\n cvt.d.s\t$f12, $f14\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f22\n b\t.L15c\n move\t$v1, $v0\n.L68:\n b\t.L15c\n move\t$v1, $zero\n cvt.d.s\t$f12, $f22\n.L74:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f20\n li\t$t6, 16384\n b\t.L15c\n subu\t$v1, $t6, $v0\n neg.s\t$f0, $f22\n.L8c:\n c.lt.s\t$f0, $f20\n nop\n bc1fl\t.Lb4\n cvt.d.s\t$f12, $f20\n cvt.d.s\t$f12, $f0\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f20\n b\t.L15c\n addiu\t$v1, $v0, 16384\n cvt.d.s\t$f12, $f20\n.Lb4:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f0\n li\t$t7, 0x8000\n b\t.L15c\n subu\t$v1, $t7, $v0\n.Lc8:\n c.lt.s\t$f22, $f0\n nop\n bc1fl\t.L124\n neg.s\t$f2, $f20\n neg.s\t$f0, $f22\n neg.s\t$f2, $f20\n c.le.s\t$f2, $f0\n nop\n bc1fl\t.L10c\n cvt.d.s\t$f12, $f0\n cvt.d.s\t$f12, $f2\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f0\n li\t$at, 0x8000\n b\t.L15c\n addu\t$v1, $v0, $at\n cvt.d.s\t$f12, $f0\n.L10c:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f2\n li\t$t8, 0xc000\n b\t.L15c\n subu\t$v1, $t8, $v0\n neg.s\t$f2, $f20\n.L124:\n c.lt.s\t$f22, $f2\n nop\n bc1fl\t.L150\n cvt.d.s\t$f12, $f2\n cvt.d.s\t$f12, $f22\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f2\n li\t$at, 0xc000\n b\t.L15c\n addu\t$v1, $v0, $at\n cvt.d.s\t$f12, $f2\n.L150:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f22\n negu\t$v1, $v0\n.L15c:\n lw\t$ra, 36($sp)\n sll\t$v0, $v1, 0x10\n ldc1\t$f20, 16($sp)\n ldc1\t$f22, 24($sp)\n addiu\t$sp, $sp, 40\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-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function atans_table # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `atans_table` — benchmark function af:atans_table:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:atans_table: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,$f0\n 4:\taddiu\tsp,sp,-40\n 8:\tsdc1\t$f22,24(sp)\n c:\tc.le.s\t$f0,$f14\n 10:\tsdc1\t$f20,16(sp)\n 14:\tmov.s\t$f20,$f14\n 18:\tmov.s\t$f22,$f12\n 1c:\tbc1f\tc8 \n 20:\tsw\tra,36(sp)\n 24:\tc.le.s\t$f0,$f12\n 28:\tnop\n 2c:\tbc1fl\t8c \n 30:\tneg.s\t$f0,$f22\n 34:\tc.le.s\t$f14,$f12\n 38:\tnop\n 3c:\tbc1fl\t74 \n 40:\tcvt.d.s\t$f12,$f22\n 44:\tc.eq.s\t$f14,$f0\n 48:\tnop\n 4c:\tbc1t\t68 \n 50:\tnop\n 54:\tcvt.d.s\t$f12,$f14\n 58:\tjal\t0 \n 5c:\tcvt.d.s\t$f14,$f22\n 60:\tb\t15c \n 64:\tmove\tv1,v0\n 68:\tb\t15c \n 6c:\tmove\tv1,zero\n 70:\tcvt.d.s\t$f12,$f22\n 74:\tjal\t0 \n 78:\tcvt.d.s\t$f14,$f20\n 7c:\tli\tt6,16384\n 80:\tb\t15c \n 84:\tsubu\tv1,t6,v0\n 88:\tneg.s\t$f0,$f22\n 8c:\tc.lt.s\t$f0,$f20\n 90:\tnop\n 94:\tbc1fl\tb4 \n 98:\tcvt.d.s\t$f12,$f20\n 9c:\tcvt.d.s\t$f12,$f0\n a0:\tjal\t0 \n a4:\tcvt.d.s\t$f14,$f20\n a8:\tb\t15c \n ac:\taddiu\tv1,v0,16384\n b0:\tcvt.d.s\t$f12,$f20\n b4:\tjal\t0 \n b8:\tcvt.d.s\t$f14,$f0\n bc:\tli\tt7,0x8000\n c0:\tb\t15c \n c4:\tsubu\tv1,t7,v0\n c8:\tc.lt.s\t$f22,$f0\n cc:\tnop\n d0:\tbc1fl\t124 \n d4:\tneg.s\t$f2,$f20\n d8:\tneg.s\t$f0,$f22\n dc:\tneg.s\t$f2,$f20\n e0:\tc.le.s\t$f2,$f0\n e4:\tnop\n e8:\tbc1fl\t10c \n ec:\tcvt.d.s\t$f12,$f0\n f0:\tcvt.d.s\t$f12,$f2\n f4:\tjal\t0 \n f8:\tcvt.d.s\t$f14,$f0\n fc:\tli\tat,0x8000\n 100:\tb\t15c \n 104:\taddu\tv1,v0,at\n 108:\tcvt.d.s\t$f12,$f0\n 10c:\tjal\t0 \n 110:\tcvt.d.s\t$f14,$f2\n 114:\tli\tt8,0xc000\n 118:\tb\t15c \n 11c:\tsubu\tv1,t8,v0\n 120:\tneg.s\t$f2,$f20\n 124:\tc.lt.s\t$f22,$f2\n 128:\tnop\n 12c:\tbc1fl\t150 \n 130:\tcvt.d.s\t$f12,$f2\n 134:\tcvt.d.s\t$f12,$f22\n 138:\tjal\t0 \n 13c:\tcvt.d.s\t$f14,$f2\n 140:\tli\tat,0xc000\n 144:\tb\t15c \n 148:\taddu\tv1,v0,at\n 14c:\tcvt.d.s\t$f12,$f2\n 150:\tjal\t0 \n 154:\tcvt.d.s\t$f14,$f22\n 158:\tnegu\tv1,v0\n 15c:\tlw\tra,36(sp)\n 160:\tsll\tv0,v1,0x10\n 164:\tldc1\t$f20,16(sp)\n 168:\tldc1\t$f22,24(sp)\n 16c:\taddiu\tsp,sp,40\n 170:\tjr\tra\n 174:\tsra\tv0,v0,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\t00000180 .text\n00000000 g F .text\t00000178 atans_table\n00000000 F *UND*\t00000000 U_GetAtanTable\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000058 R_MIPS_26 U_GetAtanTable\n00000074 R_MIPS_26 U_GetAtanTable\n000000a0 R_MIPS_26 U_GetAtanTable\n000000b4 R_MIPS_26 U_GetAtanTable\n000000f4 R_MIPS_26 U_GetAtanTable\n0000010c R_MIPS_26 U_GetAtanTable\n00000138 R_MIPS_26 U_GetAtanTable\n00000150 R_MIPS_26 U_GetAtanTable\n\n\nContents of section .text:\n 0000 44800000 27bdffd8 f7b60018 460e003e D...'.......F..>\n 0010 f7b40010 46007506 46006586 4500002a ....F.u.F.e.E..*\n 0020 afbf0024 460c003e 00000000 45020017 ...$F..>....E...\n 0030 4600b007 460c703e 00000000 4502000d F...F.p>....E...\n 0040 4600b321 46007032 00000000 45010006 F..!F.p2....E...\n 0050 00000000 46007321 0c000000 4600b3a1 ....F.s!....F...\n 0060 1000003e 00401825 1000003c 00001825 ...>.@.%...<...%\n 0070 4600b321 0c000000 4600a3a1 240e4000 F..!....F...$.@.\n 0080 10000036 01c21823 4600b007 4614003c ...6...#F...F..<\n 0090 00000000 45020007 4600a321 46000321 ....E...F..!F..!\n 00a0 0c000000 4600a3a1 1000002c 24434000 ....F......,$C@.\n 00b0 4600a321 0c000000 460003a1 340f8000 F..!....F...4...\n 00c0 10000026 01e21823 4600b03c 00000000 ...&...#F..<....\n 00d0 45020014 4600a087 4600b007 4600a087 E...F...F...F...\n 00e0 4600103e 00000000 45020008 46000321 F..>....E...F..!\n 00f0 46001321 0c000000 460003a1 34018000 F..!....F...4...\n 0100 10000016 00411821 46000321 0c000000 .....A.!F..!....\n 0110 460013a1 3418c000 10000010 03021823 F...4..........#\n 0120 4600a087 4602b03c 00000000 45020008 F...F..<....E...\n 0130 46001321 4600b321 0c000000 460013a1 F..!F..!....F...\n 0140 3401c000 10000005 00411821 46001321 4........A.!F..!\n 0150 0c000000 4600b3a1 00021823 8fbf0024 ....F......#...$\n 0160 00031400 d7b40010 d7b60018 27bd0028 ............'..(\n 0170 03e00008 00021403 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c00e 00000000 . ..............\n 0010 00f0f00f 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c00e 00000000 00f0f00f 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000005e 00000018 00000358 p......^.......X\n 0010 00000006 000004d4 00000001 00000370 ...............p\n 0020 00000004 000003a4 00000000 00000000 ................\n 0030 00000011 000003d4 00000038 00000418 ...........8....\n 0040 0000001c 00000450 00000001 0000046c .......P.......l\n 0050 00000000 00000000 00000002 000004b4 ................\n 0060 0220e220 e0331313 14213534 14253315 . . .3...!54.%3.\n 0070 15253415 23360000 00000000 00000001 .%4.#6..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00f00000 fffffff0 00000028 001d001f ...........(....\n 00a0 0000001b 0000003c 00000000 00000001 .......<........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000178 20200001 . .....*...x ..\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 2d383437 63323165 31356433 -ido-847c21e15d3\n 0140 65666562 642f752e 69006174 616e735f efebd/u.i.atans_\n 0150 7461626c 65000000 6174616e 735f7461 table...atans_ta\n 0160 626c6500 555f4765 74417461 6e546162 ble.U_GetAtanTab\n 0170 6c650000 00000000 00000001 00000000 le..............\n 0180 00000036 00000000 00000004 00000000 ...6............\n 0190 0000005e 00000000 00000000 00000001 ...^............\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000016 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 0000000c 00000000 18cfffff 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 atans_table # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_angle\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L98\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n lui\t$at, %hi(game_GameFrame_2F)\n lwc1\t$f0, %lo(game_GameFrame_2F)($at)\n subu\t$t6, $v0, $a1\n sll\t$t7, $t6, 0x10\n sra\t$t8, $t7, 0x10\n blezl\t$t8, .L4c\n mtc1\t$a2, $f4\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n mtc1\t$a2, $f4\n.L4c:\n nop\n cvt.s.w\t$f6, $f4\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t2, $f10\n nop\n addu\t$t3, $v0, $t2\n sh\t$t3, 0($a0)\n lh\t$t4, 0($a0)\n li\t$v0, 1\n subu\t$t5, $t4, $a1\n sll\t$t6, $t5, 0x10\n sra\t$t7, $t6, 0x10\n multu\t$t7, $a2\n mflo\t$t8\n bltzl\t$t8, .Lb0\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L98:\n lh\t$t9, 0($a0)\n bnel\t$a1, $t9, .Lb0\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lb0:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_angle # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f:ido7.1","sym":"chase_f","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f\n mtc1\t$a2, $f12\n mtc1\t$zero, $f4\n mtc1\t$a1, $f14\n c.eq.s\t$f12, $f4\n nop\n bc1tl\t.L6c\n lwc1\t$f4, 0($a0)\n lwc1\t$f0, 0($a0)\n li\t$v0, 1\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L3c\n add.s\t$f6, $f0, $f12\n neg.s\t$f12, $f12\n add.s\t$f6, $f0, $f12\n.L3c:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f14\n mul.s\t$f16, $f10, $f12\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f14, 0($a0)\n lwc1\t$f4, 0($a0)\n.L6c:\n c.eq.s\t$f14, $f4\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L88:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f3:ido7.1","sym":"chase_f3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","ternary"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f3\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n mtc1\t$zero, $f4\n c.le.s\t$f0, $f12\n lwc1\t$f2, 12($sp)\n bc1f\t.L2c\n nop\n b\t.L2c\n mov.s\t$f2, $f14\n.L2c:\n c.eq.s\t$f2, $f4\n nop\n bc1tl\t.L84\n c.eq.s\t$f12, $f0\n c.lt.s\t$f12, $f0\n li\t$v0, 1\n bc1fl\t.L54\n add.s\t$f6, $f0, $f2\n neg.s\t$f2, $f2\n add.s\t$f6, $f0, $f2\n.L54:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f12\n mul.s\t$f16, $f10, $f2\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f12, 0($a0)\n c.eq.s\t$f12, $f0\n.L84:\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L9c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s:ido7.1","sym":"chase_s","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"loc":19,"refSource":"s32 chase_s(s16* pValue, s16 target, s16 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s' — lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,64 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tslt\tat,a1,v0 */\n/* 24:\tbeqzl\tat,3c */\n/* 28:\taddu\tt6,v0,a2 */\n/* 2c:\tnegu\ta2,a2 */\n/* 30:\tsll\ta2,a2,0x10 */\n/* 34:\tsra\ta2,a2,0x10 */\n/* 38:\taddu\tt6,v0,a2 */\n/* 3c:\tsh\tt6,0(a0) */\n/* 40:\tlh\tt7,0(a0) */\n/* 44:\tli\tv0,1 */\n/* 48:\tsubu\tt8,t7,a1 */\n/* 4c:\tmultu\tt8,a2 */\n/* 50:\tmflo\tt9 */\n/* 54:\tbltzl\tt9,7c */\n/* 58:\tmove\tv0,zero */\n/* 5c:\tjr\tra */\n/* 60:\tsh\ta1,0(a0) */\n/* 64:\tlh\tt0,0(a0) */\n/* 68:\tbnel\ta1,t0,7c */\n/* 6c:\tmove\tv0,zero */\n/* 70:\tjr\tra */\n/* 74:\tli\tv0,1 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tnop */\n/* \t... */\nvoid chase_s(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if (arg1 < temp_v0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + var_a2;\n if (((*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":22,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":40,"ratio":0.55,"kinds":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L64\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n slt\t$at, $a1, $v0\n beqzl\t$at, .L3c\n addu\t$t6, $v0, $a2\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v0, $a2\n.L3c:\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n li\t$v0, 1\n subu\t$t8, $t7, $a1\n multu\t$t8, $a2\n mflo\t$t9\n bltzl\t$t9, .L7c\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L64:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .L7c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L7c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s2:ido7.1","sym":"chase_s2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","pointer","branch"],"loc":10,"refSource":"s32 chase_s2(s16* pValue, s16 limit, s16 step) {\n s16 prev = *pValue;\n\n *pValue += step;\n if ((*pValue - limit) * (prev - limit) <= 0) {\n *pValue = limit;\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 chase_s2(s16 * a0, s32 a1, s32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n","score":18,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":14},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s2(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = temp_v1 + arg2;\n if (((*arg0 - arg1) * (temp_v1 - arg1)) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n return 0;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s2\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n lh\t$v1, 0($a0)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v1, $a2\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$v0, $v1, 0x10\n sra\t$v0, $v0, 0x10\n subu\t$t9, $v0, $a1\n subu\t$t8, $t7, $a1\n multu\t$t8, $t9\n move\t$v0, $zero\n mflo\t$t0\n bgtz\t$t0, .L58\n nop\n sh\t$a1, 0($a0)\n jr\t$ra\n li\t$v0, 1\n.L58:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s3:ido7.1","sym":"chase_s3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s3\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .La4\n sra\t$a1, $a1, 0x10\n lh\t$v1, 0($a0)\n li\t$at, 0x8000\n lui\t$t7, 0xffff\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L40\n slt\t$at, $v0, $at\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n.L40:\n bnez\t$at, .L60\n negu\t$t6, $v0\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n ori\t$t7, $t7, 0x1\n sra\t$a2, $a2, 0x10\n b\t.L80\n subu\t$v0, $t7, $t6\n.L60:\n slti\t$at, $v0, -32767\n beqz\t$at, .L80\n nop\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n li\t$at, 0xffff\n sra\t$a2, $a2, 0x10\n addu\t$v0, $v0, $at\n.L80:\n multu\t$a2, $v0\n addu\t$t8, $v1, $a2\n sh\t$t8, 0($a0)\n li\t$v0, 1\n mflo\t$t9\n bgtzl\t$t9, .Lbc\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.La4:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .Lbc\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lbc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:check_percent_abs:ido7.1","sym":"check_percent_abs","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel check_percent_abs\n neg.s\t$f4, $f14\n sw\t$a2, 8($sp)\n c.le.s\t$f4, $f12\n sw\t$a3, 12($sp)\n lwc1\t$f6, 8($sp)\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n c.le.s\t$f12, $f14\n nop\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n mtc1\t$zero, $f0\n jr\t$ra\n nop\n c.le.s\t$f6, $f12\n.L3c:\n lui\t$at, 0x3f80\n lwc1\t$f8, 8($sp)\n bc1fl\t.L5c\n neg.s\t$f10, $f8\n mtc1\t$at, $f0\n jr\t$ra\n nop\n neg.s\t$f10, $f8\n.L5c:\n lui\t$at, 0xbf80\n c.le.s\t$f12, $f10\n lw\t$t6, 16($sp)\n bc1f\t.L7c\n nop\n mtc1\t$at, $f0\n jr\t$ra\n nop\n.L7c:\n beqz\t$t6, .Lbc\n lwc1\t$f10, 12($sp)\n mtc1\t$zero, $f16\n nop\n c.lt.s\t$f16, $f12\n nop\n bc1fl\t.Lb0\n add.s\t$f6, $f12, $f14\n sub.s\t$f18, $f12, $f14\n lwc1\t$f4, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f18, $f4\n add.s\t$f6, $f12, $f14\n.Lb0:\n lwc1\t$f8, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f6, $f8\n.Lbc:\n mul.s\t$f0, $f12, $f10\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function check_percent_abs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:get_percent_forAccelBrake:ido7.1","sym":"get_percent_forAccelBrake","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","arithmetic"],"loc":51,"refSource":"f32 get_percent_forAccelBrake(f32 x, f32 min, f32 max, f32 accelRange, f32 brakeRange) {\n f32 percent;\n f32 range;\n f32 cur;\n f32 scale;\n\n if (x >= max) {\n return 1.0f;\n }\n if (x <= min) {\n return 0.0f;\n }\n\n cur = x - min;\n range = max - min;\n\n if (range < accelRange + brakeRange) {\n return 0.0f;\n }\n\n scale = 1.0f / (2.0f * range - accelRange - brakeRange);\n\n if (accelRange != 0.0f) {\n if (cur <= accelRange) {\n percent = scale * cur * cur;\n percent /= accelRange;\n return percent;\n } else {\n percent = scale * accelRange;\n }\n } else {\n percent = 0.0f;\n }\n\n if (cur <= range - brakeRange) {\n percent += (scale * 2.0f) * (cur - accelRange);\n return percent;\n }\n\n percent += 2.0f * scale * (range - accelRange - brakeRange);\n\n if (brakeRange != 0.0f) {\n percent += scale * brakeRange;\n if (cur < range) {\n f32 left = range - cur;\n\n percent -= scale * left * left / brakeRange;\n }\n }\n return percent;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L673-L723","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ta2,40(sp)\n 8:\tlwc1\t$f4,40(sp)\n c:\tsdc1\t$f20,8(sp)\n 10:\tmtc1\ta3,$f20\n 14:\tc.le.s\t$f4,$f12\n 18:\tsdc1\t$f24,24(sp)\n 1c:\tsdc1\t$f22,16(sp)\n 20:\tlui\tat,0x3f80\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f12,$f14\n 2c:\tmtc1\tat,$f0\n 30:\tb\t154 \n 34:\tldc1\t$f20,8(sp)\n 38:\tc.le.s\t$f12,$f14\n 3c:\tlwc1\t$f6,40(sp)\n 40:\tbc1fl\t58 \n 44:\tlwc1\t$f2,48(sp)\n 48:\tmtc1\tzero,$f0\n 4c:\tb\t154 \n 50:\tldc1\t$f20,8(sp)\n 54:\tlwc1\t$f2,48(sp)\n 58:\tsub.s\t$f0,$f6,$f14\n 5c:\tadd.s\t$f8,$f20,$f2\n 60:\tc.lt.s\t$f0,$f8\n 64:\tnop\n 68:\tbc1fl\t80 \n 6c:\tadd.s\t$f4,$f0,$f0\n 70:\tmtc1\tzero,$f0\n 74:\tb\t154 \n 78:\tldc1\t$f20,8(sp)\n 7c:\tadd.s\t$f4,$f0,$f0\n 80:\tlui\tat,0x3f80\n 84:\tmtc1\tat,$f10\n 88:\tsub.s\t$f6,$f4,$f20\n 8c:\tmtc1\tzero,$f4\n 90:\tsub.s\t$f8,$f6,$f2\n 94:\tc.eq.s\t$f20,$f4\n 98:\tdiv.s\t$f24,$f10,$f8\n 9c:\tbc1t\td0 \n a0:\tmov.s\t$f18,$f24\n a4:\tsub.s\t$f16,$f12,$f14\n a8:\tc.le.s\t$f16,$f20\n ac:\tnop\n b0:\tbc1f\tc8 \n b4:\tnop\n b8:\tmul.s\t$f6,$f24,$f16\n bc:\tmul.s\t$f10,$f6,$f16\n c0:\tb\t150 \n c4:\tdiv.s\t$f0,$f10,$f20\n c8:\tb\td8 \n cc:\tmul.s\t$f22,$f24,$f20\n d0:\tmtc1\tzero,$f22\n d4:\tsub.s\t$f16,$f12,$f14\n d8:\tsub.s\t$f8,$f0,$f2\n dc:\tc.le.s\t$f16,$f8\n e0:\tnop\n e4:\tbc1fl\t104 \n e8:\tsub.s\t$f4,$f0,$f20\n ec:\tadd.s\t$f4,$f24,$f24\n f0:\tsub.s\t$f6,$f16,$f20\n f4:\tmul.s\t$f10,$f4,$f6\n f8:\tb\t150 \n fc:\tadd.s\t$f0,$f22,$f10\n 100:\tsub.s\t$f4,$f0,$f20\n 104:\tadd.s\t$f8,$f24,$f24\n 108:\tsub.s\t$f6,$f4,$f2\n 10c:\tmtc1\tzero,$f4\n 110:\tmul.s\t$f10,$f8,$f6\n 114:\tc.eq.s\t$f2,$f4\n 118:\tnop\n 11c:\tbc1t\t14c \n 120:\tadd.s\t$f22,$f22,$f10\n 124:\tmul.s\t$f8,$f24,$f2\n 128:\tc.lt.s\t$f16,$f0\n 12c:\tnop\n 130:\tbc1f\t14c \n 134:\tadd.s\t$f22,$f22,$f8\n 138:\tsub.s\t$f12,$f0,$f16\n 13c:\tmul.s\t$f6,$f18,$f12\n 140:\tmul.s\t$f10,$f6,$f12\n 144:\tdiv.s\t$f4,$f10,$f2\n 148:\tsub.s\t$f22,$f22,$f4\n 14c:\tmov.s\t$f0,$f22\n 150:\tldc1\t$f20,8(sp)\n 154:\tldc1\t$f22,16(sp)\n 158:\tldc1\t$f24,24(sp)\n 15c:\tjr\tra\n 160:\taddiu\tsp,sp,32\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000170 .text\n00000000 g F .text\t00000164 get_percent_forAccelBrake\n\n\nContents of section .text:\n 0000 27bdffe0 afa60028 c7a40028 f7b40008 '......(...(....\n 0010 4487a000 460c203e f7b80018 f7b60010 D...F. >........\n 0020 3c013f80 45020005 460e603e 44810000 <.?.E...F.`>D...\n 0030 10000048 d7b40008 460e603e c7a60028 ...H....F.`>...(\n 0040 45020005 c7a20030 44800000 10000041 E......0D......A\n 0050 d7b40008 c7a20030 460e3001 4602a200 .......0F.0.F...\n 0060 4608003c 00000000 45020005 46000100 F..<....E...F...\n 0070 44800000 10000037 d7b40008 46000100 D......7....F...\n 0080 3c013f80 44815000 46142181 44802000 <.?.D.P.F.!.D. .\n 0090 46023201 4604a032 46085603 4501000c F.2.F..2F.V.E...\n 00a0 4600c486 460e6401 4614803e 00000000 F...F.d.F..>....\n 00b0 45000005 00000000 4610c182 46103282 E.......F...F.2.\n 00c0 10000023 46145003 10000003 4614c582 ...#F.P.....F...\n 00d0 4480b000 460e6401 46020201 4608803e D...F.d.F...F..>\n 00e0 00000000 45020007 46140101 4618c100 ....E...F...F...\n 00f0 46148181 46062282 10000015 460ab000 F...F.\".....F...\n 0100 46140101 4618c200 46022181 44802000 F...F...F.!.D. .\n 0110 46064282 46041032 00000000 4501000b F.B.F..2....E...\n 0120 460ab580 4602c202 4600803c 00000000 F...F...F..<....\n 0130 45000006 4608b580 46100301 460c9182 E...F...F...F...\n 0140 460c3282 46025103 4604b581 4600b006 F.2.F.Q.F...F...\n 0150 d7b40008 d7b60010 d7b80018 03e00008 ................\n 0160 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .options:\n 0000 01200000 00000000 a00000c2 00000000 . ..............\n 0010 03ff7ff7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000c2 00000000 03ff7ff7 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000059 00000028 000002e8 p......Y...(....\n 0010 00000005 00000470 00000001 00000310 .......p........\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000044 000003b8 .......t...D....\n 0040 0000001c 000003fc 00000001 00000418 ................\n 0050 00000000 00000000 00000001 00000460 ...............`\n 0060 0150b150 b160f112 2050b113 45122310 .P.P.`.. P..E.#.\n 0070 f010f010 f0243321 31241210 f03210f0 .....$3!1$...2..\n 0080 12f02012 f0343500 00000000 00000001 .. ..45.........\n 0090 00000000 00000000 00000000 ffffffff ................\n 00a0 03f00000 fffffff8 00000020 001d001f ........... ....\n 00b0 0000001b 00000043 00000000 00000001 .......C........\n 00c0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00d0 1820000f 0000002a 00000164 20200001 . .....*...d ..\n 00e0 00000001 00000000 20200000 02000000 ........ ......\n 00f0 03000000 04000000 05000000 06000000 ................\n 0100 07000000 08000000 09000000 20000000 ............ ...\n 0110 21000000 0a000000 0b000000 0b000000 !...............\n 0120 1a000000 00000000 00000003 06000000 ................\n 0130 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0140 2d69646f 2d333330 63613265 65353238 -ido-330ca2ee528\n 0150 65386162 302f752e 69006765 745f7065 e8ab0/u.i.get_pe\n 0160 7263656e 745f666f 72416363 656c4272 rcent_forAccelBr\n 0170 616b6500 6765745f 70657263 656e745f ake.get_percent_\n 0180 666f7241 6363656c 4272616b 65000000 forAccelBrake...\n 0190 00000000 00000001 00000000 00000044 ...............D\n 01a0 00000000 00000004 00000000 00000059 ...............Y\n 01b0 00000000 00000000 00000001 00000000 ................\n 01c0 00000011 00000000 00000000 01800000 ................\n 01d0 00000000 00000027 00000000 00000000 .......'........\n 01e0 00000000 18200001 00000000 00000000 ..... ..........\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'get_percent_forAccelBrake' — lift: cannot lift 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' 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:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ta2,40(sp) */\n/* 8:\tlwc1\t$f4,40(sp) */\n/* c:\tsdc1\t$f20,8(sp) */\n/* 10:\tmtc1\ta3,$f20 */\n/* 14:\tc.le.s\t$f4,$f12 */\n/* 18:\tsdc1\t$f24,24(sp) */\n/* 1c:\tsdc1\t$f22,16(sp) */\n/* 20:\tlui\tat,0x3f80 */\n/* 24:\tbc1fl\t3c */\n/* 28:\tc.le.s\t$f12,$f14 */\n/* 2c:\tmtc1\tat,$f0 */\n/* 30:\tb\t154 */\n/* 34:\tldc1\t$f20,8(sp) */\n/* 38:\tc.le.s\t$f12,$f14 */\n/* 3c:\tlwc1\t$f6,40(sp) */\n/* 40:\tbc1fl\t58 */\n/* 44:\tlwc1\t$f2,48(sp) */\n/* 48:\tmtc1\tzero,$f0 */\n/* 4c:\tb\t154 */\n/* 50:\tldc1\t$f20,8(sp) */\n/* 54:\tlwc1\t$f2,48(sp) */\n/* 58:\tsub.s\t$f0,$f6,$f14 */\n/* 5c:\tadd.s\t$f8,$f20,$f2 */\n/* 60:\tc.lt.s\t$f0,$f8 */\n/* 64:\tnop */\n/* 68:\tbc1fl\t80 */\n/* 6c:\tadd.s\t$f4,$f0,$f0 */\n/* 70:\tmtc1\tzero,$f0 */\n/* 74:\tb\t154 */\n/* 78:\tldc1\t$f20,8(sp) */\n/* 7c:\tadd.s\t$f4,$f0,$f0 */\n/* 80:\tlui\tat,0x3f80 */\n/* 84:\tmtc1\tat,$f10 */\n/* 88:\tsub.s\t$f6,$f4,$f20 */\n/* 8c:\tmtc1\tzero,$f4 */\n/* 90:\tsub.s\t$f8,$f6,$f2 */\n/* 94:\tc.eq.s\t$f20,$f4 */\n/* 98:\tdiv.s\t$f24,$f10,$f8 */\n/* 9c:\tbc1t\td0 */\n/* a0:\tmov.s\t$f18,$f24 */\n/* a4:\tsub.s\t$f16,$f12,$f14 */\n/* a8:\tc.le.s\t$f16,$f20 */\n/* ac:\tnop */\n/* b0:\tbc1f\tc8 */\n/* b4:\tnop */\n/* b8:\tmul.s\t$f6,$f24,$f16 */\n/* bc:\tmul.s\t$f10,$f6,$f16 */\n/* c0:\tb\t150 */\n/* c4:\tdiv.s\t$f0,$f10,$f20 */\n/* c8:\tb\td8 */\n/* cc:\tmul.s\t$f22,$f24,$f20 */\n/* d0:\tmtc1\tzero,$f22 */\n/* d4:\tsub.s\t$f16,$f12,$f14 */\n/* d8:\tsub.s\t$f8,$f0,$f2 */\n/* dc:\tc.le.s\t$f16,$f8 */\n/* e0:\tnop */\n/* e4:\tbc1fl\t104 */\n/* e8:\tsub.s\t$f4,$f0,$f20 */\n/* ec:\tadd.s\t$f4,$f24,$f24 */\n/* f0:\tsub.s\t$f6,$f16,$f20 */\n/* f4:\tmul.s\t$f10,$f4,$f6 */\n/* f8:\tb\t150 */\n/* fc:\tadd.s\t$f0,$f22,$f10 */\n/* 100:\tsub.s\t$f4,$f0,$f20 */\n/* 104:\tadd.s\t$f8,$f24,$f24 */\n/* 108:\tsub.s\t$f6,$f4,$f2 */\n/* 10c:\tmtc1\tzero,$f4 */\n/* 110:\tmul.s\t$f10,$f8,$f6 */\n/* 114:\tc.eq.s\t$f2,$f4 */\n/* 118:\tnop */\n/* 11c:\tbc1t\t14c */\n/* 120:\tadd.s\t$f22,$f22,$f10 */\n/* 124:\tmul.s\t$f8,$f24,$f2 */\n/* 128:\tc.lt.s\t$f16,$f0 */\n/* 12c:\tnop */\n/* 130:\tbc1f\t14c */\n/* 134:\tadd.s\t$f22,$f22,$f8 */\n/* 138:\tsub.s\t$f12,$f0,$f16 */\n/* 13c:\tmul.s\t$f6,$f18,$f12 */\n/* 140:\tmul.s\t$f10,$f6,$f12 */\n/* 144:\tdiv.s\t$f4,$f10,$f2 */\n/* 148:\tsub.s\t$f22,$f22,$f4 */\n/* 14c:\tmov.s\t$f0,$f22 */\n/* 150:\tldc1\t$f20,8(sp) */\n/* 154:\tldc1\t$f22,16(sp) */\n/* 158:\tldc1\t$f24,24(sp) */\n/* 15c:\tjr\tra */\n/* 160:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid get_percent_forAccelBrake(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' at 0x24 — branch-likely / coprocessor branch not supported\");\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 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 get_percent_forAccelBrake(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {\n f32 temp_f0;\n f32 temp_f12;\n f32 temp_f24;\n f32 var_f16;\n f32 var_f22;\n f32 var_f22_2;\n\n if (arg2 <= arg0) {\n return 1.0f;\n }\n if (arg0 <= arg1) {\n return 0.0f;\n }\n temp_f0 = arg2 - arg1;\n if (temp_f0 < (arg3 + arg4)) {\n return 0.0f;\n }\n temp_f24 = 1.0f / (((2.0f * temp_f0) - arg3) - arg4);\n if (arg3 != 0.0f) {\n var_f16 = arg0 - arg1;\n if (var_f16 <= arg3) {\n return (temp_f24 * var_f16 * var_f16) / arg3;\n }\n var_f22_2 = temp_f24 * arg3;\n goto block_11;\n }\n var_f22_2 = 0.0f;\n var_f16 = arg0 - arg1;\nblock_11:\n if (var_f16 <= (temp_f0 - arg4)) {\n return var_f22_2 + (2.0f * temp_f24 * (var_f16 - arg3));\n }\n var_f22 = var_f22_2 + (2.0f * temp_f24 * ((temp_f0 - arg3) - arg4));\n if (arg4 != 0.0f) {\n var_f22 += temp_f24 * arg4;\n if (var_f16 < temp_f0) {\n temp_f12 = temp_f0 - var_f16;\n var_f22 -= (temp_f24 * temp_f12 * temp_f12) / arg4;\n }\n }\n return var_f22;\n}\n","score":78,"maxScore":106,"compileErrors":null,"breakdown":{"insert":17,"delete":7,"replace":8,"opMismatch":0,"argMismatch":46},"quality":{"score":88,"lines":42,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":78,"maxScore":106,"ratio":0.7358490566037735,"kinds":{"insert":17,"delete":7,"replace":8,"opMismatch":0,"argMismatch":46}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `get_percent_forAccelBrake` — benchmark function af:get_percent_forAccelBrake:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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_forAccelBrake\n addiu\t$sp, $sp, -32\n sw\t$a2, 40($sp)\n lwc1\t$f4, 40($sp)\n sdc1\t$f20, 8($sp)\n mtc1\t$a3, $f20\n c.le.s\t$f4, $f12\n sdc1\t$f24, 24($sp)\n sdc1\t$f22, 16($sp)\n lui\t$at, 0x3f80\n bc1fl\t.L3c\n c.le.s\t$f12, $f14\n mtc1\t$at, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n c.le.s\t$f12, $f14\n.L3c:\n lwc1\t$f6, 40($sp)\n bc1fl\t.L58\n lwc1\t$f2, 48($sp)\n mtc1\t$zero, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n lwc1\t$f2, 48($sp)\n.L58:\n sub.s\t$f0, $f6, $f14\n add.s\t$f8, $f20, $f2\n c.lt.s\t$f0, $f8\n nop\n bc1fl\t.L80\n add.s\t$f4, $f0, $f0\n mtc1\t$zero, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n add.s\t$f4, $f0, $f0\n.L80:\n lui\t$at, 0x3f80\n mtc1\t$at, $f10\n sub.s\t$f6, $f4, $f20\n mtc1\t$zero, $f4\n sub.s\t$f8, $f6, $f2\n c.eq.s\t$f20, $f4\n div.s\t$f24, $f10, $f8\n bc1t\t.Ld0\n mov.s\t$f18, $f24\n sub.s\t$f16, $f12, $f14\n c.le.s\t$f16, $f20\n nop\n bc1f\t.Lc8\n nop\n mul.s\t$f6, $f24, $f16\n mul.s\t$f10, $f6, $f16\n b\t.L150\n div.s\t$f0, $f10, $f20\n.Lc8:\n b\t.Ld8\n mul.s\t$f22, $f24, $f20\n.Ld0:\n mtc1\t$zero, $f22\n sub.s\t$f16, $f12, $f14\n.Ld8:\n sub.s\t$f8, $f0, $f2\n c.le.s\t$f16, $f8\n nop\n bc1fl\t.L104\n sub.s\t$f4, $f0, $f20\n add.s\t$f4, $f24, $f24\n sub.s\t$f6, $f16, $f20\n mul.s\t$f10, $f4, $f6\n b\t.L150\n add.s\t$f0, $f22, $f10\n sub.s\t$f4, $f0, $f20\n.L104:\n add.s\t$f8, $f24, $f24\n sub.s\t$f6, $f4, $f2\n mtc1\t$zero, $f4\n mul.s\t$f10, $f8, $f6\n c.eq.s\t$f2, $f4\n nop\n bc1t\t.L14c\n add.s\t$f22, $f22, $f10\n mul.s\t$f8, $f24, $f2\n c.lt.s\t$f16, $f0\n nop\n bc1f\t.L14c\n add.s\t$f22, $f22, $f8\n sub.s\t$f12, $f0, $f16\n mul.s\t$f6, $f18, $f12\n mul.s\t$f10, $f6, $f12\n div.s\t$f4, $f10, $f2\n sub.s\t$f22, $f22, $f4\n.L14c:\n mov.s\t$f0, $f22\n.L150:\n ldc1\t$f20, 8($sp)\n.L154:\n ldc1\t$f22, 16($sp)\n ldc1\t$f24, 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-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent_forAccelBrake # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk 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_forAccelBrake` — benchmark function af:get_percent_forAccelBrake:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent_forAccelBrake: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,-32\n 4:\tsw\ta2,40(sp)\n 8:\tlwc1\t$f4,40(sp)\n c:\tsdc1\t$f20,8(sp)\n 10:\tmtc1\ta3,$f20\n 14:\tc.le.s\t$f4,$f12\n 18:\tsdc1\t$f24,24(sp)\n 1c:\tsdc1\t$f22,16(sp)\n 20:\tlui\tat,0x3f80\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f12,$f14\n 2c:\tmtc1\tat,$f0\n 30:\tb\t154 \n 34:\tldc1\t$f20,8(sp)\n 38:\tc.le.s\t$f12,$f14\n 3c:\tlwc1\t$f6,40(sp)\n 40:\tbc1fl\t58 \n 44:\tlwc1\t$f2,48(sp)\n 48:\tmtc1\tzero,$f0\n 4c:\tb\t154 \n 50:\tldc1\t$f20,8(sp)\n 54:\tlwc1\t$f2,48(sp)\n 58:\tsub.s\t$f0,$f6,$f14\n 5c:\tadd.s\t$f8,$f20,$f2\n 60:\tc.lt.s\t$f0,$f8\n 64:\tnop\n 68:\tbc1fl\t80 \n 6c:\tadd.s\t$f4,$f0,$f0\n 70:\tmtc1\tzero,$f0\n 74:\tb\t154 \n 78:\tldc1\t$f20,8(sp)\n 7c:\tadd.s\t$f4,$f0,$f0\n 80:\tlui\tat,0x3f80\n 84:\tmtc1\tat,$f10\n 88:\tsub.s\t$f6,$f4,$f20\n 8c:\tmtc1\tzero,$f4\n 90:\tsub.s\t$f8,$f6,$f2\n 94:\tc.eq.s\t$f20,$f4\n 98:\tdiv.s\t$f24,$f10,$f8\n 9c:\tbc1t\td0 \n a0:\tmov.s\t$f18,$f24\n a4:\tsub.s\t$f16,$f12,$f14\n a8:\tc.le.s\t$f16,$f20\n ac:\tnop\n b0:\tbc1f\tc8 \n b4:\tnop\n b8:\tmul.s\t$f6,$f24,$f16\n bc:\tmul.s\t$f10,$f6,$f16\n c0:\tb\t150 \n c4:\tdiv.s\t$f0,$f10,$f20\n c8:\tb\td8 \n cc:\tmul.s\t$f22,$f24,$f20\n d0:\tmtc1\tzero,$f22\n d4:\tsub.s\t$f16,$f12,$f14\n d8:\tsub.s\t$f8,$f0,$f2\n dc:\tc.le.s\t$f16,$f8\n e0:\tnop\n e4:\tbc1fl\t104 \n e8:\tsub.s\t$f4,$f0,$f20\n ec:\tadd.s\t$f4,$f24,$f24\n f0:\tsub.s\t$f6,$f16,$f20\n f4:\tmul.s\t$f10,$f4,$f6\n f8:\tb\t150 \n fc:\tadd.s\t$f0,$f22,$f10\n 100:\tsub.s\t$f4,$f0,$f20\n 104:\tadd.s\t$f8,$f24,$f24\n 108:\tsub.s\t$f6,$f4,$f2\n 10c:\tmtc1\tzero,$f4\n 110:\tmul.s\t$f10,$f8,$f6\n 114:\tc.eq.s\t$f2,$f4\n 118:\tnop\n 11c:\tbc1t\t14c \n 120:\tadd.s\t$f22,$f22,$f10\n 124:\tmul.s\t$f8,$f24,$f2\n 128:\tc.lt.s\t$f16,$f0\n 12c:\tnop\n 130:\tbc1f\t14c \n 134:\tadd.s\t$f22,$f22,$f8\n 138:\tsub.s\t$f12,$f0,$f16\n 13c:\tmul.s\t$f6,$f18,$f12\n 140:\tmul.s\t$f10,$f6,$f12\n 144:\tdiv.s\t$f4,$f10,$f2\n 148:\tsub.s\t$f22,$f22,$f4\n 14c:\tmov.s\t$f0,$f22\n 150:\tldc1\t$f20,8(sp)\n 154:\tldc1\t$f22,16(sp)\n 158:\tldc1\t$f24,24(sp)\n 15c:\tjr\tra\n 160:\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 d .text\t00000170 .text\n00000000 g F .text\t00000164 get_percent_forAccelBrake\n\n\nContents of section .text:\n 0000 27bdffe0 afa60028 c7a40028 f7b40008 '......(...(....\n 0010 4487a000 460c203e f7b80018 f7b60010 D...F. >........\n 0020 3c013f80 45020005 460e603e 44810000 <.?.E...F.`>D...\n 0030 10000048 d7b40008 460e603e c7a60028 ...H....F.`>...(\n 0040 45020005 c7a20030 44800000 10000041 E......0D......A\n 0050 d7b40008 c7a20030 460e3001 4602a200 .......0F.0.F...\n 0060 4608003c 00000000 45020005 46000100 F..<....E...F...\n 0070 44800000 10000037 d7b40008 46000100 D......7....F...\n 0080 3c013f80 44815000 46142181 44802000 <.?.D.P.F.!.D. .\n 0090 46023201 4604a032 46085603 4501000c F.2.F..2F.V.E...\n 00a0 4600c486 460e6401 4614803e 00000000 F...F.d.F..>....\n 00b0 45000005 00000000 4610c182 46103282 E.......F...F.2.\n 00c0 10000023 46145003 10000003 4614c582 ...#F.P.....F...\n 00d0 4480b000 460e6401 46020201 4608803e D...F.d.F...F..>\n 00e0 00000000 45020007 46140101 4618c100 ....E...F...F...\n 00f0 46148181 46062282 10000015 460ab000 F...F.\".....F...\n 0100 46140101 4618c200 46022181 44802000 F...F...F.!.D. .\n 0110 46064282 46041032 00000000 4501000b F.B.F..2....E...\n 0120 460ab580 4602c202 4600803c 00000000 F...F...F..<....\n 0130 45000006 4608b580 46100301 460c9182 E...F...F...F...\n 0140 460c3282 46025103 4604b581 4600b006 F.2.F.Q.F...F...\n 0150 d7b40008 d7b60010 d7b80018 03e00008 ................\n 0160 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .options:\n 0000 01200000 00000000 a00000c2 00000000 . ..............\n 0010 03ff7ff7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000c2 00000000 03ff7ff7 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000059 00000028 000002e8 p......Y...(....\n 0010 00000005 00000470 00000001 00000310 .......p........\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000044 000003b8 .......t...D....\n 0040 0000001c 000003fc 00000001 00000418 ................\n 0050 00000000 00000000 00000001 00000460 ...............`\n 0060 0150b150 b160f112 2050b113 45122310 .P.P.`.. P..E.#.\n 0070 f010f010 f0243321 31241210 f03210f0 .....$3!1$...2..\n 0080 12f02012 f0343500 00000000 00000001 .. ..45.........\n 0090 00000000 00000000 00000000 ffffffff ................\n 00a0 03f00000 fffffff8 00000020 001d001f ........... ....\n 00b0 0000001b 00000043 00000000 00000001 .......C........\n 00c0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00d0 1820000f 0000002a 00000164 20200001 . .....*...d ..\n 00e0 00000001 00000000 20200000 02000000 ........ ......\n 00f0 03000000 04000000 05000000 06000000 ................\n 0100 07000000 08000000 09000000 20000000 ............ ...\n 0110 21000000 0a000000 0b000000 0b000000 !...............\n 0120 1a000000 00000000 00000003 06000000 ................\n 0130 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0140 2d69646f 2d333330 63613265 65353238 -ido-330ca2ee528\n 0150 65386162 302f752e 69006765 745f7065 e8ab0/u.i.get_pe\n 0160 7263656e 745f666f 72416363 656c4272 rcent_forAccelBr\n 0170 616b6500 6765745f 70657263 656e745f ake.get_percent_\n 0180 666f7241 6363656c 4272616b 65000000 forAccelBrake...\n 0190 00000000 00000001 00000000 00000044 ...............D\n 01a0 00000000 00000004 00000000 00000059 ...............Y\n 01b0 00000000 00000000 00000001 00000000 ................\n 01c0 00000011 00000000 00000000 01800000 ................\n 01d0 00000000 00000027 00000000 00000000 .......'........\n 01e0 00000000 18200001 00000000 00000000 ..... ..........\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 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_forAccelBrake # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel get_percent\n lui\t$at, 0x3f80\n mtc1\t$at, $f14\n slt\t$at, $a2, $a1\n beqz\t$at, .L20\n mov.s\t$f2, $f14\n mtc1\t$zero, $f2\n jr\t$ra\n mov.s\t$f0, $f2\n.L20:\n slt\t$at, $a2, $a0\n beqz\t$at, .L70\n subu\t$t6, $a0, $a1\n mtc1\t$t6, $f4\n mtc1\t$zero, $f6\n subu\t$t7, $a2, $a1\n cvt.s.w\t$f0, $f4\n c.eq.s\t$f6, $f0\n nop\n bc1t\t.L70\n nop\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f10, $f8\n div.s\t$f2, $f10, $f0\n c.lt.s\t$f14, $f2\n nop\n bc1f\t.L70\n nop\n mov.s\t$f2, $f14\n.L70:\n jr\t$ra\n mov.s\t$f0, $f2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:gfxopen:ido7.1","sym":"gfxopen","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","arithmetic"],"loc":3,"refSource":"Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 gfxopen(u32 a0) {\n return a0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gfxopen(s32 arg0) {\n return arg0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gfxopen\n jr\t$ra\n addiu\t$v0, $a0, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gfxopen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:inter_float:ido7.1","sym":"inter_float","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inter_float\n mtc1\t$a1, $f12\n bgtzl\t$a2, .L18\n mtc1\t$a2, $f4\n jr\t$ra\n swc1\t$f12, 0($a0)\n mtc1\t$a2, $f4\n.L18:\n lwc1\t$f2, 0($a0)\n cvt.s.w\t$f6, $f4\n sub.s\t$f0, $f12, $f2\n div.s\t$f8, $f0, $f6\n add.s\t$f10, $f2, $f8\n swc1\t$f10, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inter_float # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsKyuurekiLeapYear:ido7.1","sym":"lbRk_IsKyuurekiLeapYear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year - lbRk_YEAR_MIN] != 0) {\n return 1;\n };\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(u32 a0) {\n if (((s32 *)(0 + (a0 << 2)))[-2000] != 0) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year] != 0) {\n return 1;\n }\n return 0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsKyuurekiLeapYear\n sll\t$t6, $a0, 0x2\n lui\t$t7, %hi(l_lbRk_leapdays)\n addu\t$t7, $t7, $t6\n lw\t$t7, %lo(l_lbRk_leapdays)($t7)\n move\t$v0, $zero\n beqz\t$t7, .L24\n nop\n jr\t$ra\n li\t$v0, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_IsKyuurekiLeapYear(s32 year);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsKyuurekiLeapYear # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsLeapMonth:ido7.1","sym":"lbRk_IsLeapMonth","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsLeapMonth\n li\t$at, 13\n bne\t$a0, $at, .L14\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsLeapMonth # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_SeirekiDays:ido7.1","sym":"lbRk_SeirekiDays","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":9,"refSource":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 idx = 0;\n\n if ((year % 4) == 0) {\n idx = 1;\n }\n\n return t_seiyo_days_tbl[idx][month];\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'lbRk_SeirekiDays' — lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\tt6,a0,0x3 */\n/* 4:\tbnez\tt6,10 */\n/* 8:\tmove\tv1,zero */\n/* c:\tli\tv1,1 */\n/* 10:\tsll\tt7,v1,0x2 */\n/* 14:\tsubu\tt7,t7,v1 */\n/* 18:\tsll\tt7,t7,0x2 */\n/* 1c:\taddu\tt7,t7,v1 */\n/* 20:\taddu\tt8,t7,a1 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t8 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* \t... */\nvoid lbRk_SeirekiDays(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 var_v1;\n\n var_v1 = 0;\n if (!(year & 3)) {\n var_v1 = 1;\n }\n return (s32) (*t_seiyo_days_tbl)[(var_v1 * 0xD) + month];\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_SeirekiDays\n andi\t$t6, $a0, 0x3\n bnez\t$t6, .L10\n move\t$v1, $zero\n li\t$v1, 1\n.L10:\n sll\t$t7, $v1, 0x2\n subu\t$t7, $t7, $v1\n sll\t$t7, $t7, 0x2\n addu\t$t7, $t7, $v1\n addu\t$t8, $t7, $a1\n lui\t$v0, %hi(t_seiyo_days_tbl)\n addu\t$v0, $v0, $t8\n jr\t$ra\n lbu\t$v0, %lo(t_seiyo_days_tbl)($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_SeirekiDays(s32 year, s32 month);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_SeirekiDays # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:limiter:ido7.1","sym":"limiter","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 limiter(f32 val, f32 max) {\n if (val < 0.0f) {\n return CLAMP_MIN(val, -max);\n } else {\n return CLAMP_MAX(val, max);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f14,$f12 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f12,$f0 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f14,$f12 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid limiter(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 limiter(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (arg0 < temp_f0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg1 < arg0) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel limiter\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f14, $f12\n neg.s\t$f0, $f14\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f14, $f12\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function limiter # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:limiter:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.pprev = NULL;\n this->next = NULL;\n return this;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 * ListAlloc_Init(s32 * a0) {\n *a0 = 0;\n a0[1] = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *ListAlloc_Init(void *arg0) {\n arg0->unk0 = 0;\n arg0->unk4 = 0;\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ListAlloc_Init\n sw\t$zero, 0($a0)\n sw\t$zero, 4($a0)\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ListAlloc_Init # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_clear:ido7.1","sym":"mem_clear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","memory","loop"],"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":4,"quality":{"score":88,"lines":35,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 27: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 28: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 29: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 30: Selector requires struct/union pointer as left hand side"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_clear\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n beqz\t$a1, .L4c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L30\n move\t$v1, $a3\n.L1c:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($a0)\n bne\t$v1, $v0, .L1c\n addiu\t$a0, $a0, 1\n beq\t$v0, $a1, .L4c\n.L30:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($a0)\n sb\t$a2, 1($a0)\n sb\t$a2, 2($a0)\n sb\t$a2, 3($a0)\n bne\t$v0, $a1, .L30\n addiu\t$a0, $a0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_clear # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_cmp:ido7.1","sym":"mem_cmp","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","branch","loop"],"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 40: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Unacceptable operand of '+'.","cfe: Error: /c.i, line 49: Unacceptable operand of '+'.","cfe: Error: /c.i, line 50: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_cmp\n beqz\t$a2, .Lc8\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L44\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a0)\n lbu\t$t7, 0($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a2, $a2, -1\n beq\t$t6, $t7, .L34\n nop\n jr\t$ra\n move\t$v0, $zero\n.L34:\n bne\t$v0, $a2, .L14\n addiu\t$a1, $a1, 1\n beqzl\t$a2, .Lcc\n li\t$v0, 1\n.L44:\n lbu\t$t8, 0($a0)\n lbu\t$t9, 0($a1)\n addiu\t$a2, $a2, -4\n beql\t$t8, $t9, .L64\n lbu\t$t0, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t0, 1($a0)\n.L64:\n lbu\t$t1, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t0, $t1, .L84\n lbu\t$t2, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t2, 1($a0)\n.L84:\n lbu\t$t3, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t2, $t3, .La4\n lbu\t$t4, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t4, 1($a0)\n.La4:\n lbu\t$t5, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a0, $a0, 1\n beq\t$t4, $t5, .Lc0\n addiu\t$a1, $a1, 1\n jr\t$ra\n move\t$v0, $zero\n.Lc0:\n bnez\t$a2, .L44\n addiu\t$a1, $a1, 1\n.Lc8:\n li\t$v0, 1\n.Lcc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_cmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_copy:ido7.1","sym":"mem_copy","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","memory","loop"],"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":4,"quality":{"score":86,"lines":40,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 23: Syntax Error","cfe: Error: /c.i, line 36: Syntax Error","cfe: Error: /c.i, line 37: Syntax Error","cfe: Error: /c.i, line 38: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_copy\n beqz\t$a2, .L64\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L34\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a1)\n addiu\t$a2, $a2, -1\n addiu\t$a1, $a1, 1\n addiu\t$a0, $a0, 1\n bne\t$v0, $a2, .L14\n sb\t$t6, -1($a0)\n beqz\t$a2, .L64\n nop\n.L34:\n lbu\t$t7, 0($a1)\n addiu\t$a2, $a2, -4\n addiu\t$a1, $a1, 4\n sb\t$t7, 0($a0)\n lbu\t$t8, -3($a1)\n addiu\t$a0, $a0, 4\n sb\t$t8, -3($a0)\n lbu\t$t9, -2($a1)\n sb\t$t9, -2($a0)\n lbu\t$t0, -1($a1)\n bnez\t$a2, .L34\n sb\t$t0, -1($a0)\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_copy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mRmTp_ItemNo2FtrSize:ido7.1","sym":"mRmTp_ItemNo2FtrSize","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mRmTp_ItemNo2FtrSize\n sw\t$a0, 0($sp)\n andi\t$a0, $a0, 0xffff\n slti\t$at, $a0, 4096\n bnez\t$at, .L34\n move\t$v0, $zero\n slti\t$at, $a0, 7885\n beqz\t$at, .L34\n addiu\t$t6, $a0, -4096\n sra\t$t7, $t6, 0x2\n lui\t$v0, %hi(mRmTp_ftr_size)\n addu\t$v0, $v0, $t7\n jr\t$ra\n lbu\t$v0, %lo(mRmTp_ftr_size)($v0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 mRmTp_ItemNo2FtrSize(u16 name);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mRmTp_ItemNo2FtrSize # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:never_zero:ido7.1","sym":"never_zero","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 never_zero(f32 val, f32 min) {\n if (val < 0.0f) {\n return CLAMP_MAX(val, -min);\n } else {\n return CLAMP_MIN(val, min);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f12,$f14 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f0,$f12 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f12,$f14 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid never_zero(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 never_zero(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (temp_f0 < arg0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg0 < arg1) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel never_zero\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f12, $f14\n neg.s\t$f0, $f14\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f12, $f14\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function never_zero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:never_zero:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`r = src->r;\n dest->g = src->g;\n dest->b = src->b;\n dest->a = src->a;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\n","proto":{"rgba_t_move":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void rgba_t_move(u8 * a0, u8 * a1) {\n *a0 = *a1;\n a0[1] = a1[1];\n a0[2] = a1[2];\n a0[3] = a1[3];\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void rgba_t_move(void *arg0, void *arg1) {\n arg0->unk0 = (u8) arg1->unk0;\n arg0->unk1 = (u8) arg1->unk1;\n arg0->unk2 = (u8) arg1->unk2;\n arg0->unk3 = (u8) arg1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":96,"lines":6,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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","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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rgba_t_move\n lbu\t$t6, 0($a1)\n sb\t$t6, 0($a0)\n lbu\t$t7, 1($a1)\n sb\t$t7, 1($a0)\n lbu\t$t8, 2($a1)\n sb\t$t8, 2($a0)\n lbu\t$t9, 3($a1)\n jr\t$ra\n sb\t$t9, 3($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rgba_t_move # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:sAdo_Get_KokeruLabel:ido7.1","sym":"sAdo_Get_KokeruLabel","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","switch","call","jump-table"],"loc":43,"refSource":"s32 sAdo_Get_KokeruLabel(s32 type) {\n u16 label = sAdo_Get_WalkLabel(type);\n s32 ret;\n\n switch (label) {\n case 0x201:\n ret = 0xe;\n break;\n\n case 0x206:\n ret = 0x13;\n break;\n\n case 0x202:\n ret = 0xf;\n break;\n\n case 0x203:\n ret = 0x10;\n break;\n\n case 0x204:\n ret = 0x11;\n break;\n\n case 0x205:\n ret = 0x12;\n break;\n\n case 0x208:\n ret = 0x156;\n break;\n\n case 0x209:\n ret = 0x157;\n break;\n\n default:\n ret = 15;\n break;\n }\n return ret;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/audio.c#L382-L424","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:\tjal\t0 \n c:\tnop\n 10:\tandi\tt6,v0,0xffff\n 14:\taddiu\tt7,t6,-513\n 18:\tsltiu\tat,t7,9\n 1c:\tbeqz\tat,78 \n 20:\tsll\tt7,t7,0x2\n 24:\tlui\tat,0x0\n 28:\taddu\tat,at,t7\n 2c:\tlw\tt7,0(at)\n 30:\tjr\tt7\n 34:\tnop\n 38:\tb\t7c \n 3c:\tli\tv1,14\n 40:\tb\t7c \n 44:\tli\tv1,19\n 48:\tb\t7c \n 4c:\tli\tv1,15\n 50:\tb\t7c \n 54:\tli\tv1,16\n 58:\tb\t7c \n 5c:\tli\tv1,17\n 60:\tb\t7c \n 64:\tli\tv1,18\n 68:\tb\t7c \n 6c:\tli\tv1,342\n 70:\tb\t7c \n 74:\tli\tv1,343\n 78:\tli\tv1,15\n 7c:\tlw\tra,20(sp)\n 80:\taddiu\tsp,sp,24\n 84:\tmove\tv0,v1\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 l d .rodata\t00000030 .rodata\n00000000 g F .text\t00000090 sAdo_Get_KokeruLabel\n00000000 F *UND*\t00000000 sAdo_Get_WalkLabel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sAdo_Get_WalkLabel\n00000024 R_MIPS_HI16 .rodata\n0000002c 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\n00000020 R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 0c000000 00000000 '...............\n 0010 304effff 25cffdff 2de10009 10200016 0N..%...-.... ..\n 0020 000f7880 3c010000 002f0821 8c2f0000 ..x.<..../.!./..\n 0030 01e00008 00000000 10000010 2403000e ............$...\n 0040 1000000e 24030013 1000000c 2403000f ....$.......$...\n 0050 1000000a 24030010 10000008 24030011 ....$.......$...\n 0060 10000006 24030012 10000004 24030156 ....$.......$..V\n 0070 10000002 24030157 2403000f 8fbf0014 ....$..W$.......\n 0080 27bd0018 00601025 03e00008 00000000 '....`.%........\nContents of section .rodata:\n 0000 00000038 00000048 00000050 00000058 ...8...H...P...X\n 0010 00000060 00000040 00000078 00000068 ...`...@...x...h\n 0020 00000070 00000000 00000000 00000000 ...p............\nContents of section .options:\n 0000 01200000 00000000 a000c00e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c00e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000018 000002f8 p......$........\n 0010 00000006 00000488 00000001 00000310 ................\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000040 000003b8 .......t...@....\n 0040 00000028 000003f8 00000001 00000420 ...(........... \n 0050 00000000 00000000 00000002 00000468 ...............h\n 0060 01112800 30f040f0 40f040f0 40f040f0 ..(.0.@.@.@.@.@.\n 0070 40f040f0 30340000 00000000 00000001 @.@.04..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00000000 00000000 00000018 001d001f ................\n 00a0 0000001b 0000003b 00000000 00000001 .......;........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000090 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 2d313762 65373530 62643033 -ido-17be750bd03\n 0140 34333463 392f752e 69007341 646f5f47 434c9/u.i.sAdo_G\n 0150 65745f4b 6f6b6572 754c6162 656c0000 et_KokeruLabel..\n 0160 7341646f 5f476574 5f4b6f6b 6572754c sAdo_Get_KokeruL\n 0170 6162656c 00734164 6f5f4765 745f5761 abel.sAdo_Get_Wa\n 0180 6c6b4c61 62656c00 00000000 00000001 lkLabel.........\n 0190 00000000 0000003f 00000000 00000004 .......?........\n 01a0 00000000 00000024 00000000 00000000 .......$........\n 01b0 00000001 00000000 00000011 00000000 ................\n 01c0 00000000 01800000 00000000 00000016 ................\n 01d0 00000000 00000000 00000000 18200001 ............. ..\n 01e0 00000000 00000015 00000000 18cfffff ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 00000000 00000000 7fffffff 00000000 ................\n 0210 7fffffff 00000001 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sAdo_Get_KokeruLabel' — lift: cannot lift 'sAdo_Get_KokeruLabel': 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,20(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tandi\tt6,v0,0xffff */\n/* 14:\taddiu\tt7,t6,-513 */\n/* 18:\tsltiu\tat,t7,9 */\n/* 1c:\tbeqz\tat,78 */\n/* 20:\tsll\tt7,t7,0x2 */\n/* 24:\tlui\tat,0x0 */\n/* 28:\taddu\tat,at,t7 */\n/* 2c:\tlw\tt7,0(at) */\n/* 30:\tjr\tt7 */\n/* 34:\tnop */\n/* 38:\tb\t7c */\n/* 3c:\tli\tv1,14 */\n/* 40:\tb\t7c */\n/* 44:\tli\tv1,19 */\n/* 48:\tb\t7c */\n/* 4c:\tli\tv1,15 */\n/* 50:\tb\t7c */\n/* 54:\tli\tv1,16 */\n/* 58:\tb\t7c */\n/* 5c:\tli\tv1,17 */\n/* 60:\tb\t7c */\n/* 64:\tli\tv1,18 */\n/* 68:\tb\t7c */\n/* 6c:\tli\tv1,342 */\n/* 70:\tb\t7c */\n/* 74:\tli\tv1,343 */\n/* 78:\tli\tv1,15 */\n/* 7c:\tlw\tra,20(sp) */\n/* 80:\taddiu\tsp,sp,24 */\n/* 84:\tmove\tv0,v1 */\n/* 88:\tjr\tra */\n/* 8c:\tnop */\nvoid sAdo_Get_KokeruLabel(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sAdo_Get_KokeruLabel': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\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 'sAdo_Get_KokeruLabel': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sAdo_Get_WalkLabel(); /* extern */\n\ns32 sAdo_Get_KokeruLabel(void) {\n s32 temp_t6;\n s32 var_v1;\n\n temp_t6 = sAdo_Get_WalkLabel() & 0xFFFF;\n switch (temp_t6) {\n case 0x201:\n var_v1 = 0xE;\n break;\n case 0x206:\n var_v1 = 0x13;\n break;\n default:\n var_v1 = 0xF;\n break;\n case 0x203:\n var_v1 = 0x10;\n break;\n case 0x204:\n var_v1 = 0x11;\n break;\n case 0x205:\n var_v1 = 0x12;\n break;\n case 0x208:\n var_v1 = 0x156;\n break;\n case 0x209:\n var_v1 = 0x157;\n break;\n }\n return var_v1;\n}\n","score":4,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":36,"ratio":0.1111111111111111,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sAdo_Get_KokeruLabel` — benchmark function af:sAdo_Get_KokeruLabel:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sAdo_Get_KokeruLabel\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n jal\tsAdo_Get_WalkLabel\n nop\n andi\t$t6, $v0, 0xffff\n addiu\t$t7, $t6, -513\n sltiu\t$at, $t7, 9\n beqz\t$at, .L78\n sll\t$t7, $t7, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $t7\n lw\t$t7, %lo(jtbl_rodata_0)($at)\n jr\t$t7\n nop\n.L38:\n b\t.L7c\n li\t$v1, 14\n.L40:\n b\t.L7c\n li\t$v1, 19\n.L48:\n b\t.L7c\n li\t$v1, 15\n.L50:\n b\t.L7c\n li\t$v1, 16\n.L58:\n b\t.L7c\n li\t$v1, 17\n.L60:\n b\t.L7c\n li\t$v1, 18\n.L68:\n b\t.L7c\n li\t$v1, 342\n.L70:\n b\t.L7c\n li\t$v1, 343\n.L78:\n li\t$v1, 15\n.L7c:\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n move\t$v0, $v1\n jr\t$ra\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L38\n.word .L48\n.word .L50\n.word .L58\n.word .L60\n.word .L40\n.word .L78\n.word .L68\n.word .L70\n.word 0x0\n.word 0x0\n.word 0x0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sAdo_Get_KokeruLabel # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sAdo_Get_KokeruLabel` — benchmark function af:sAdo_Get_KokeruLabel:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:sAdo_Get_KokeruLabel: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:\tjal\t0 \n c:\tnop\n 10:\tandi\tt6,v0,0xffff\n 14:\taddiu\tt7,t6,-513\n 18:\tsltiu\tat,t7,9\n 1c:\tbeqz\tat,78 \n 20:\tsll\tt7,t7,0x2\n 24:\tlui\tat,0x0\n 28:\taddu\tat,at,t7\n 2c:\tlw\tt7,0(at)\n 30:\tjr\tt7\n 34:\tnop\n 38:\tb\t7c \n 3c:\tli\tv1,14\n 40:\tb\t7c \n 44:\tli\tv1,19\n 48:\tb\t7c \n 4c:\tli\tv1,15\n 50:\tb\t7c \n 54:\tli\tv1,16\n 58:\tb\t7c \n 5c:\tli\tv1,17\n 60:\tb\t7c \n 64:\tli\tv1,18\n 68:\tb\t7c \n 6c:\tli\tv1,342\n 70:\tb\t7c \n 74:\tli\tv1,343\n 78:\tli\tv1,15\n 7c:\tlw\tra,20(sp)\n 80:\taddiu\tsp,sp,24\n 84:\tmove\tv0,v1\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 l d .rodata\t00000030 .rodata\n00000000 g F .text\t00000090 sAdo_Get_KokeruLabel\n00000000 F *UND*\t00000000 sAdo_Get_WalkLabel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sAdo_Get_WalkLabel\n00000024 R_MIPS_HI16 .rodata\n0000002c 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\n00000020 R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 0c000000 00000000 '...............\n 0010 304effff 25cffdff 2de10009 10200016 0N..%...-.... ..\n 0020 000f7880 3c010000 002f0821 8c2f0000 ..x.<..../.!./..\n 0030 01e00008 00000000 10000010 2403000e ............$...\n 0040 1000000e 24030013 1000000c 2403000f ....$.......$...\n 0050 1000000a 24030010 10000008 24030011 ....$.......$...\n 0060 10000006 24030012 10000004 24030156 ....$.......$..V\n 0070 10000002 24030157 2403000f 8fbf0014 ....$..W$.......\n 0080 27bd0018 00601025 03e00008 00000000 '....`.%........\nContents of section .rodata:\n 0000 00000038 00000048 00000050 00000058 ...8...H...P...X\n 0010 00000060 00000040 00000078 00000068 ...`...@...x...h\n 0020 00000070 00000000 00000000 00000000 ...p............\nContents of section .options:\n 0000 01200000 00000000 a000c00e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c00e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000018 000002f8 p......$........\n 0010 00000006 00000488 00000001 00000310 ................\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000040 000003b8 .......t...@....\n 0040 00000028 000003f8 00000001 00000420 ...(........... \n 0050 00000000 00000000 00000002 00000468 ...............h\n 0060 01112800 30f040f0 40f040f0 40f040f0 ..(.0.@.@.@.@.@.\n 0070 40f040f0 30340000 00000000 00000001 @.@.04..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00000000 00000000 00000018 001d001f ................\n 00a0 0000001b 0000003b 00000000 00000001 .......;........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000090 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 2d313762 65373530 62643033 -ido-17be750bd03\n 0140 34333463 392f752e 69007341 646f5f47 434c9/u.i.sAdo_G\n 0150 65745f4b 6f6b6572 754c6162 656c0000 et_KokeruLabel..\n 0160 7341646f 5f476574 5f4b6f6b 6572754c sAdo_Get_KokeruL\n 0170 6162656c 00734164 6f5f4765 745f5761 abel.sAdo_Get_Wa\n 0180 6c6b4c61 62656c00 00000000 00000001 lkLabel.........\n 0190 00000000 0000003f 00000000 00000004 .......?........\n 01a0 00000000 00000024 00000000 00000000 .......$........\n 01b0 00000001 00000000 00000011 00000000 ................\n 01c0 00000000 01800000 00000000 00000016 ................\n 01d0 00000000 00000000 00000000 18200001 ............. ..\n 01e0 00000000 00000015 00000000 18cfffff ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 00000000 00000000 7fffffff 00000000 ................\n 0210 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 sAdo_Get_KokeruLabel # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel search_position_angleY\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n lwc1\t$f6, 0($a0)\n lwc1\t$f4, 0($a1)\n lwc1\t$f10, 8($a0)\n lwc1\t$f8, 8($a1)\n sub.s\t$f14, $f4, $f6\n jal\tatans_table\n sub.s\t$f12, $f8, $f10\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function search_position_angleY # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:Skin_Matrix_MulMatrix:ido7.1","sym":"Skin_Matrix_MulMatrix","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","matrix","arithmetic"],"loc":122,"refSource":"void Skin_Matrix_MulMatrix(MtxF* mfA, MtxF* mfB, MtxF* dest) {\n f32 cx;\n f32 cy;\n f32 cz;\n f32 cw;\n\n f32 rx = mfA->xx;\n f32 ry = mfA->xy;\n f32 rz = mfA->xz;\n f32 rw = mfA->xw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->xx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->xy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->xz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->xw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->yx;\n ry = mfA->yy;\n rz = mfA->yz;\n rw = mfA->yw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->yx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->yy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->yz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->yw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->zx;\n ry = mfA->zy;\n rz = mfA->zz;\n rw = mfA->zw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->zx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->zy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->zz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->zw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->wx;\n ry = mfA->wy;\n rz = mfA->wz;\n rw = mfA->ww;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->wx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->wy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->wz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->ww = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_skin_matrix.c#L32-L153","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsdc1\t$f22,16(sp)\n 8:\tsdc1\t$f20,8(sp)\n c:\tlwc1\t$f0,0(a0)\n 10:\tlwc1\t$f16,0(a1)\n 14:\tlwc1\t$f2,16(a0)\n 18:\tlwc1\t$f18,4(a1)\n 1c:\tmul.s\t$f4,$f0,$f16\n 20:\tlwc1\t$f12,32(a0)\n 24:\tlwc1\t$f20,8(a1)\n 28:\tmul.s\t$f6,$f2,$f18\n 2c:\tlwc1\t$f14,48(a0)\n 30:\tlwc1\t$f22,12(a1)\n 34:\tmul.s\t$f10,$f12,$f20\n 38:\tadd.s\t$f8,$f4,$f6\n 3c:\tmul.s\t$f6,$f14,$f22\n 40:\tadd.s\t$f4,$f8,$f10\n 44:\tadd.s\t$f8,$f4,$f6\n 48:\tswc1\t$f8,0(a2)\n 4c:\tlwc1\t$f16,16(a1)\n 50:\tlwc1\t$f18,20(a1)\n 54:\tlwc1\t$f20,24(a1)\n 58:\tmul.s\t$f10,$f0,$f16\n 5c:\tlwc1\t$f22,28(a1)\n 60:\tmul.s\t$f4,$f2,$f18\n 64:\tmul.s\t$f8,$f12,$f20\n 68:\tadd.s\t$f6,$f10,$f4\n 6c:\tmul.s\t$f4,$f14,$f22\n 70:\tadd.s\t$f10,$f6,$f8\n 74:\tadd.s\t$f6,$f10,$f4\n 78:\tswc1\t$f6,16(a2)\n 7c:\tlwc1\t$f16,32(a1)\n 80:\tlwc1\t$f18,36(a1)\n 84:\tlwc1\t$f20,40(a1)\n 88:\tmul.s\t$f8,$f0,$f16\n 8c:\tlwc1\t$f22,44(a1)\n 90:\tmul.s\t$f10,$f2,$f18\n 94:\tmul.s\t$f6,$f12,$f20\n 98:\tadd.s\t$f4,$f8,$f10\n 9c:\tmul.s\t$f10,$f14,$f22\n a0:\tadd.s\t$f8,$f4,$f6\n a4:\tadd.s\t$f4,$f8,$f10\n a8:\tswc1\t$f4,32(a2)\n ac:\tlwc1\t$f16,48(a1)\n b0:\tlwc1\t$f18,52(a1)\n b4:\tlwc1\t$f20,56(a1)\n b8:\tmul.s\t$f6,$f0,$f16\n bc:\tlwc1\t$f22,60(a1)\n c0:\tmul.s\t$f8,$f2,$f18\n c4:\tmul.s\t$f4,$f12,$f20\n c8:\tadd.s\t$f10,$f6,$f8\n cc:\tmul.s\t$f8,$f14,$f22\n d0:\tadd.s\t$f6,$f10,$f4\n d4:\tadd.s\t$f10,$f6,$f8\n d8:\tswc1\t$f10,48(a2)\n dc:\tlwc1\t$f0,4(a0)\n e0:\tlwc1\t$f16,0(a1)\n e4:\tlwc1\t$f2,20(a0)\n e8:\tlwc1\t$f18,4(a1)\n ec:\tmul.s\t$f4,$f0,$f16\n f0:\tlwc1\t$f12,36(a0)\n f4:\tlwc1\t$f20,8(a1)\n f8:\tmul.s\t$f6,$f2,$f18\n fc:\tlwc1\t$f14,52(a0)\n 100:\tlwc1\t$f22,12(a1)\n 104:\tmul.s\t$f10,$f12,$f20\n 108:\tadd.s\t$f8,$f4,$f6\n 10c:\tmul.s\t$f6,$f14,$f22\n 110:\tadd.s\t$f4,$f8,$f10\n 114:\tadd.s\t$f8,$f4,$f6\n 118:\tswc1\t$f8,4(a2)\n 11c:\tlwc1\t$f16,16(a1)\n 120:\tlwc1\t$f18,20(a1)\n 124:\tlwc1\t$f20,24(a1)\n 128:\tmul.s\t$f10,$f0,$f16\n 12c:\tlwc1\t$f22,28(a1)\n 130:\tmul.s\t$f4,$f2,$f18\n 134:\tmul.s\t$f8,$f12,$f20\n 138:\tadd.s\t$f6,$f10,$f4\n 13c:\tmul.s\t$f4,$f14,$f22\n 140:\tadd.s\t$f10,$f6,$f8\n 144:\tadd.s\t$f6,$f10,$f4\n 148:\tswc1\t$f6,20(a2)\n 14c:\tlwc1\t$f16,32(a1)\n 150:\tlwc1\t$f18,36(a1)\n 154:\tlwc1\t$f20,40(a1)\n 158:\tmul.s\t$f8,$f0,$f16\n 15c:\tlwc1\t$f22,44(a1)\n 160:\tmul.s\t$f10,$f2,$f18\n 164:\tmul.s\t$f6,$f12,$f20\n 168:\tadd.s\t$f4,$f8,$f10\n 16c:\tmul.s\t$f10,$f14,$f22\n 170:\tadd.s\t$f8,$f4,$f6\n 174:\tadd.s\t$f4,$f8,$f10\n 178:\tswc1\t$f4,36(a2)\n 17c:\tlwc1\t$f16,48(a1)\n 180:\tlwc1\t$f18,52(a1)\n 184:\tlwc1\t$f20,56(a1)\n 188:\tmul.s\t$f6,$f0,$f16\n 18c:\tlwc1\t$f22,60(a1)\n 190:\tmul.s\t$f8,$f2,$f18\n 194:\tmul.s\t$f4,$f12,$f20\n 198:\tadd.s\t$f10,$f6,$f8\n 19c:\tmul.s\t$f8,$f14,$f22\n 1a0:\tadd.s\t$f6,$f10,$f4\n 1a4:\tadd.s\t$f10,$f6,$f8\n 1a8:\tswc1\t$f10,52(a2)\n 1ac:\tlwc1\t$f0,8(a0)\n 1b0:\tlwc1\t$f16,0(a1)\n 1b4:\tlwc1\t$f2,24(a0)\n 1b8:\tlwc1\t$f18,4(a1)\n 1bc:\tmul.s\t$f4,$f0,$f16\n 1c0:\tlwc1\t$f12,40(a0)\n 1c4:\tlwc1\t$f20,8(a1)\n 1c8:\tmul.s\t$f6,$f2,$f18\n 1cc:\tlwc1\t$f14,56(a0)\n 1d0:\tlwc1\t$f22,12(a1)\n 1d4:\tmul.s\t$f10,$f12,$f20\n 1d8:\tadd.s\t$f8,$f4,$f6\n 1dc:\tmul.s\t$f6,$f14,$f22\n 1e0:\tadd.s\t$f4,$f8,$f10\n 1e4:\tadd.s\t$f8,$f4,$f6\n 1e8:\tswc1\t$f8,8(a2)\n 1ec:\tlwc1\t$f16,16(a1)\n 1f0:\tlwc1\t$f18,20(a1)\n 1f4:\tlwc1\t$f20,24(a1)\n 1f8:\tmul.s\t$f10,$f0,$f16\n 1fc:\tlwc1\t$f22,28(a1)\n 200:\tmul.s\t$f4,$f2,$f18\n 204:\tmul.s\t$f8,$f12,$f20\n 208:\tadd.s\t$f6,$f10,$f4\n 20c:\tmul.s\t$f4,$f14,$f22\n 210:\tadd.s\t$f10,$f6,$f8\n 214:\tadd.s\t$f6,$f10,$f4\n 218:\tswc1\t$f6,24(a2)\n 21c:\tlwc1\t$f16,32(a1)\n 220:\tlwc1\t$f18,36(a1)\n 224:\tlwc1\t$f20,40(a1)\n 228:\tmul.s\t$f8,$f0,$f16\n 22c:\tlwc1\t$f22,44(a1)\n 230:\tmul.s\t$f10,$f2,$f18\n 234:\tmul.s\t$f6,$f12,$f20\n 238:\tadd.s\t$f4,$f8,$f10\n 23c:\tmul.s\t$f10,$f14,$f22\n 240:\tadd.s\t$f8,$f4,$f6\n 244:\tadd.s\t$f4,$f8,$f10\n 248:\tswc1\t$f4,40(a2)\n 24c:\tlwc1\t$f16,48(a1)\n 250:\tlwc1\t$f18,52(a1)\n 254:\tlwc1\t$f20,56(a1)\n 258:\tmul.s\t$f6,$f0,$f16\n 25c:\tlwc1\t$f22,60(a1)\n 260:\tmul.s\t$f8,$f2,$f18\n 264:\tmul.s\t$f4,$f12,$f20\n 268:\tadd.s\t$f10,$f6,$f8\n 26c:\tmul.s\t$f8,$f14,$f22\n 270:\tadd.s\t$f6,$f10,$f4\n 274:\tadd.s\t$f10,$f6,$f8\n 278:\tswc1\t$f10,56(a2)\n 27c:\tlwc1\t$f0,12(a0)\n 280:\tlwc1\t$f16,0(a1)\n 284:\tlwc1\t$f2,28(a0)\n 288:\tlwc1\t$f18,4(a1)\n 28c:\tmul.s\t$f4,$f0,$f16\n 290:\tlwc1\t$f12,44(a0)\n 294:\tlwc1\t$f20,8(a1)\n 298:\tmul.s\t$f6,$f2,$f18\n 29c:\tlwc1\t$f14,60(a0)\n 2a0:\tlwc1\t$f22,12(a1)\n 2a4:\tmul.s\t$f10,$f12,$f20\n 2a8:\tadd.s\t$f8,$f4,$f6\n 2ac:\tmul.s\t$f6,$f14,$f22\n 2b0:\tadd.s\t$f4,$f8,$f10\n 2b4:\tadd.s\t$f8,$f4,$f6\n 2b8:\tswc1\t$f8,12(a2)\n 2bc:\tlwc1\t$f16,16(a1)\n 2c0:\tlwc1\t$f18,20(a1)\n 2c4:\tlwc1\t$f20,24(a1)\n 2c8:\tmul.s\t$f10,$f0,$f16\n 2cc:\tlwc1\t$f22,28(a1)\n 2d0:\tmul.s\t$f4,$f2,$f18\n 2d4:\tmul.s\t$f8,$f12,$f20\n 2d8:\tadd.s\t$f6,$f10,$f4\n 2dc:\tmul.s\t$f4,$f14,$f22\n 2e0:\tadd.s\t$f10,$f6,$f8\n 2e4:\tadd.s\t$f6,$f10,$f4\n 2e8:\tswc1\t$f6,28(a2)\n 2ec:\tlwc1\t$f16,32(a1)\n 2f0:\tlwc1\t$f18,36(a1)\n 2f4:\tlwc1\t$f20,40(a1)\n 2f8:\tmul.s\t$f8,$f0,$f16\n 2fc:\tlwc1\t$f22,44(a1)\n 300:\tmul.s\t$f10,$f2,$f18\n 304:\tmul.s\t$f6,$f12,$f20\n 308:\tadd.s\t$f4,$f8,$f10\n 30c:\tmul.s\t$f10,$f14,$f22\n 310:\tadd.s\t$f8,$f4,$f6\n 314:\tadd.s\t$f4,$f8,$f10\n 318:\tswc1\t$f4,44(a2)\n 31c:\tlwc1\t$f16,48(a1)\n 320:\tlwc1\t$f18,52(a1)\n 324:\tlwc1\t$f20,56(a1)\n 328:\tmul.s\t$f6,$f0,$f16\n 32c:\tlwc1\t$f22,60(a1)\n 330:\tmul.s\t$f8,$f2,$f18\n 334:\tmul.s\t$f4,$f12,$f20\n 338:\tadd.s\t$f10,$f6,$f8\n 33c:\tmul.s\t$f8,$f14,$f22\n 340:\tadd.s\t$f6,$f10,$f4\n 344:\tadd.s\t$f10,$f6,$f8\n 348:\tswc1\t$f10,60(a2)\n 34c:\tldc1\t$f22,16(sp)\n 350:\tldc1\t$f20,8(sp)\n 354:\tjr\tra\n 358:\taddiu\tsp,sp,24\n 35c:\tnop\n","proto":{"Skin_Matrix_MulMatrix":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000360 .text\n00000000 g F .text\t0000035c Skin_Matrix_MulMatrix\n\n\nContents of section .text:\n 0000 27bdffe8 f7b60010 f7b40008 c4800000 '...............\n 0010 c4b00000 c4820010 c4b20004 46100102 ............F...\n 0020 c48c0020 c4b40008 46121182 c48e0030 ... ....F......0\n 0030 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0040 460a4100 46062200 e4c80000 c4b00010 F.A.F.\".........\n 0050 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0060 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0070 46083280 46045180 e4c60010 c4b00020 F.2.F.Q........ \n 0080 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0090 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 00a0 46062200 460a4100 e4c40020 c4b00030 F.\".F.A.... ...0\n 00b0 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 00c0 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 00d0 46045180 46083280 e4ca0030 c4800004 F.Q.F.2....0....\n 00e0 c4b00000 c4820014 c4b20004 46100102 ............F...\n 00f0 c48c0024 c4b40008 46121182 c48e0034 ...$....F......4\n 0100 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0110 460a4100 46062200 e4c80004 c4b00010 F.A.F.\".........\n 0120 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0130 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0140 46083280 46045180 e4c60014 c4b00020 F.2.F.Q........ \n 0150 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0160 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0170 46062200 460a4100 e4c40024 c4b00030 F.\".F.A....$...0\n 0180 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0190 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 01a0 46045180 46083280 e4ca0034 c4800008 F.Q.F.2....4....\n 01b0 c4b00000 c4820018 c4b20004 46100102 ............F...\n 01c0 c48c0028 c4b40008 46121182 c48e0038 ...(....F......8\n 01d0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 01e0 460a4100 46062200 e4c80008 c4b00010 F.A.F.\".........\n 01f0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0200 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0210 46083280 46045180 e4c60018 c4b00020 F.2.F.Q........ \n 0220 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0230 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0240 46062200 460a4100 e4c40028 c4b00030 F.\".F.A....(...0\n 0250 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0260 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0270 46045180 46083280 e4ca0038 c480000c F.Q.F.2....8....\n 0280 c4b00000 c482001c c4b20004 46100102 ............F...\n 0290 c48c002c c4b40008 46121182 c48e003c ...,....F......<\n 02a0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 02b0 460a4100 46062200 e4c8000c c4b00010 F.A.F.\".........\n 02c0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 02d0 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 02e0 46083280 46045180 e4c6001c c4b00020 F.2.F.Q........ \n 02f0 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0300 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0310 46062200 460a4100 e4c4002c c4b00030 F.\".F.A....,...0\n 0320 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0330 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0340 46045180 46083280 e4ca003c d7b60010 F.Q.F.2....<....\n 0350 d7b40008 03e00008 27bd0018 00000000 ........'.......\nContents of section .options:\n 0000 01200000 00000000 a0000070 00000000 . .........p....\n 0010 00f55ff5 00000000 00000000 00007ff0 .._.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000070 00000000 00f55ff5 00000000 ...p......_.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000d7 00000078 000004d8 p..........x....\n 0010 00000005 000006a8 00000001 00000550 ...............P\n 0020 00000004 00000584 00000000 00000000 ................\n 0030 00000011 000005b4 00000040 000005f8 ...........@....\n 0040 00000018 00000638 00000001 00000650 .......8.......P\n 0050 00000000 00000000 00000001 00000698 ................\n 0060 025040d0 4030a040 20b04015 10101020 .P@.@0.@ .@.... \n 0070 f0161010 1020f016 10101020 f0161040 ..... ..... ...@\n 0080 d04030a0 4020b040 15101010 20f01610 .@0.@ .@.... ...\n 0090 101020f0 16101010 20f01610 40d04030 .. ..... ...@.@0\n 00a0 a04020b0 40151010 1020f016 10101020 .@ .@.... ..... \n 00b0 f0161010 1020f016 1040d040 30a04020 ..... ...@.@0.@ \n 00c0 b0401510 101020f0 16101010 20f01610 .@.... ..... ...\n 00d0 101020f0 16130000 00000000 00000001 .. .............\n 00e0 00000000 00000000 00000000 ffffffff ................\n 00f0 00f00000 fffffff8 00000018 001d001f ................\n 0100 0000001b 00000080 00000000 00000001 ................\n 0110 00000000 2c200004 0000002a 00000000 ...., .....*....\n 0120 1820000f 0000002a 0000035c 20200001 . .....*...\\ ..\n 0130 00000001 00000000 20200000 02000000 ........ ......\n 0140 03000000 04000000 05000000 06000000 ................\n 0150 07000000 08000000 09000000 20000000 ............ ...\n 0160 21000000 0a000000 0b000000 0b000000 !...............\n 0170 1a000000 00000000 00000003 06000000 ................\n 0180 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0190 2d69646f 2d393839 35333264 66373437 -ido-989532df747\n 01a0 65343033 612f752e 6900536b 696e5f4d e403a/u.i.Skin_M\n 01b0 61747269 785f4d75 6c4d6174 72697800 atrix_MulMatrix.\n 01c0 536b696e 5f4d6174 7269785f 4d756c4d Skin_Matrix_MulM\n 01d0 61747269 78000000 00000000 00000001 atrix...........\n 01e0 00000000 00000040 00000000 00000004 .......@........\n 01f0 00000000 000000d7 00000000 00000000 ................\n 0200 00000001 00000000 00000011 00000000 ................\n 0210 00000000 01800000 00000000 00000076 ...............v\n 0220 00000000 00000000 00000000 18200001 ............. ..\n 0230 00000000 00000000 00000000 00000000 ................\n 0240 00000000 00000000 7fffffff 00000000 ................\n 0250 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Skin_Matrix_MulMatrix' — lift: cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque */\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:\tsdc1\t$f22,16(sp) */\n/* 8:\tsdc1\t$f20,8(sp) */\n/* c:\tlwc1\t$f0,0(a0) */\n/* 10:\tlwc1\t$f16,0(a1) */\n/* 14:\tlwc1\t$f2,16(a0) */\n/* 18:\tlwc1\t$f18,4(a1) */\n/* 1c:\tmul.s\t$f4,$f0,$f16 */\n/* 20:\tlwc1\t$f12,32(a0) */\n/* 24:\tlwc1\t$f20,8(a1) */\n/* 28:\tmul.s\t$f6,$f2,$f18 */\n/* 2c:\tlwc1\t$f14,48(a0) */\n/* 30:\tlwc1\t$f22,12(a1) */\n/* 34:\tmul.s\t$f10,$f12,$f20 */\n/* 38:\tadd.s\t$f8,$f4,$f6 */\n/* 3c:\tmul.s\t$f6,$f14,$f22 */\n/* 40:\tadd.s\t$f4,$f8,$f10 */\n/* 44:\tadd.s\t$f8,$f4,$f6 */\n/* 48:\tswc1\t$f8,0(a2) */\n/* 4c:\tlwc1\t$f16,16(a1) */\n/* 50:\tlwc1\t$f18,20(a1) */\n/* 54:\tlwc1\t$f20,24(a1) */\n/* 58:\tmul.s\t$f10,$f0,$f16 */\n/* 5c:\tlwc1\t$f22,28(a1) */\n/* 60:\tmul.s\t$f4,$f2,$f18 */\n/* 64:\tmul.s\t$f8,$f12,$f20 */\n/* 68:\tadd.s\t$f6,$f10,$f4 */\n/* 6c:\tmul.s\t$f4,$f14,$f22 */\n/* 70:\tadd.s\t$f10,$f6,$f8 */\n/* 74:\tadd.s\t$f6,$f10,$f4 */\n/* 78:\tswc1\t$f6,16(a2) */\n/* 7c:\tlwc1\t$f16,32(a1) */\n/* 80:\tlwc1\t$f18,36(a1) */\n/* 84:\tlwc1\t$f20,40(a1) */\n/* 88:\tmul.s\t$f8,$f0,$f16 */\n/* 8c:\tlwc1\t$f22,44(a1) */\n/* 90:\tmul.s\t$f10,$f2,$f18 */\n/* 94:\tmul.s\t$f6,$f12,$f20 */\n/* 98:\tadd.s\t$f4,$f8,$f10 */\n/* 9c:\tmul.s\t$f10,$f14,$f22 */\n/* a0:\tadd.s\t$f8,$f4,$f6 */\n/* a4:\tadd.s\t$f4,$f8,$f10 */\n/* a8:\tswc1\t$f4,32(a2) */\n/* ac:\tlwc1\t$f16,48(a1) */\n/* b0:\tlwc1\t$f18,52(a1) */\n/* b4:\tlwc1\t$f20,56(a1) */\n/* b8:\tmul.s\t$f6,$f0,$f16 */\n/* bc:\tlwc1\t$f22,60(a1) */\n/* c0:\tmul.s\t$f8,$f2,$f18 */\n/* c4:\tmul.s\t$f4,$f12,$f20 */\n/* c8:\tadd.s\t$f10,$f6,$f8 */\n/* cc:\tmul.s\t$f8,$f14,$f22 */\n/* d0:\tadd.s\t$f6,$f10,$f4 */\n/* d4:\tadd.s\t$f10,$f6,$f8 */\n/* d8:\tswc1\t$f10,48(a2) */\n/* dc:\tlwc1\t$f0,4(a0) */\n/* e0:\tlwc1\t$f16,0(a1) */\n/* e4:\tlwc1\t$f2,20(a0) */\n/* e8:\tlwc1\t$f18,4(a1) */\n/* ec:\tmul.s\t$f4,$f0,$f16 */\n/* f0:\tlwc1\t$f12,36(a0) */\n/* f4:\tlwc1\t$f20,8(a1) */\n/* f8:\tmul.s\t$f6,$f2,$f18 */\n/* fc:\tlwc1\t$f14,52(a0) */\n/* 100:\tlwc1\t$f22,12(a1) */\n/* 104:\tmul.s\t$f10,$f12,$f20 */\n/* 108:\tadd.s\t$f8,$f4,$f6 */\n/* 10c:\tmul.s\t$f6,$f14,$f22 */\n/* 110:\tadd.s\t$f4,$f8,$f10 */\n/* 114:\tadd.s\t$f8,$f4,$f6 */\n/* 118:\tswc1\t$f8,4(a2) */\n/* 11c:\tlwc1\t$f16,16(a1) */\n/* 120:\tlwc1\t$f18,20(a1) */\n/* 124:\tlwc1\t$f20,24(a1) */\n/* 128:\tmul.s\t$f10,$f0,$f16 */\n/* 12c:\tlwc1\t$f22,28(a1) */\n/* 130:\tmul.s\t$f4,$f2,$f18 */\n/* 134:\tmul.s\t$f8,$f12,$f20 */\n/* 138:\tadd.s\t$f6,$f10,$f4 */\n/* 13c:\tmul.s\t$f4,$f14,$f22 */\n/* 140:\tadd.s\t$f10,$f6,$f8 */\n/* 144:\tadd.s\t$f6,$f10,$f4 */\n/* 148:\tswc1\t$f6,20(a2) */\n/* 14c:\tlwc1\t$f16,32(a1) */\n/* 150:\tlwc1\t$f18,36(a1) */\n/* 154:\tlwc1\t$f20,40(a1) */\n/* 158:\tmul.s\t$f8,$f0,$f16 */\n/* 15c:\tlwc1\t$f22,44(a1) */\n/* 160:\tmul.s\t$f10,$f2,$f18 */\n/* 164:\tmul.s\t$f6,$f12,$f20 */\n/* 168:\tadd.s\t$f4,$f8,$f10 */\n/* 16c:\tmul.s\t$f10,$f14,$f22 */\n/* 170:\tadd.s\t$f8,$f4,$f6 */\n/* 174:\tadd.s\t$f4,$f8,$f10 */\n/* 178:\tswc1\t$f4,36(a2) */\n/* 17c:\tlwc1\t$f16,48(a1) */\n/* 180:\tlwc1\t$f18,52(a1) */\n/* 184:\tlwc1\t$f20,56(a1) */\n/* 188:\tmul.s\t$f6,$f0,$f16 */\n/* 18c:\tlwc1\t$f22,60(a1) */\n/* 190:\tmul.s\t$f8,$f2,$f18 */\n/* 194:\tmul.s\t$f4,$f12,$f20 */\n/* 198:\tadd.s\t$f10,$f6,$f8 */\n/* 19c:\tmul.s\t$f8,$f14,$f22 */\n/* 1a0:\tadd.s\t$f6,$f10,$f4 */\n/* 1a4:\tadd.s\t$f10,$f6,$f8 */\n/* 1a8:\tswc1\t$f10,52(a2) */\n/* 1ac:\tlwc1\t$f0,8(a0) */\n/* 1b0:\tlwc1\t$f16,0(a1) */\n/* 1b4:\tlwc1\t$f2,24(a0) */\n/* 1b8:\tlwc1\t$f18,4(a1) */\n/* 1bc:\tmul.s\t$f4,$f0,$f16 */\n/* 1c0:\tlwc1\t$f12,40(a0) */\n/* 1c4:\tlwc1\t$f20,8(a1) */\n/* 1c8:\tmul.s\t$f6,$f2,$f18 */\n/* 1cc:\tlwc1\t$f14,56(a0) */\n/* 1d0:\tlwc1\t$f22,12(a1) */\n/* 1d4:\tmul.s\t$f10,$f12,$f20 */\n/* 1d8:\tadd.s\t$f8,$f4,$f6 */\n/* 1dc:\tmul.s\t$f6,$f14,$f22 */\n/* 1e0:\tadd.s\t$f4,$f8,$f10 */\n/* 1e4:\tadd.s\t$f8,$f4,$f6 */\n/* 1e8:\tswc1\t$f8,8(a2) */\n/* 1ec:\tlwc1\t$f16,16(a1) */\n/* 1f0:\tlwc1\t$f18,20(a1) */\n/* 1f4:\tlwc1\t$f20,24(a1) */\n/* 1f8:\tmul.s\t$f10,$f0,$f16 */\n/* 1fc:\tlwc1\t$f22,28(a1) */\n/* 200:\tmul.s\t$f4,$f2,$f18 */\n/* 204:\tmul.s\t$f8,$f12,$f20 */\n/* 208:\tadd.s\t$f6,$f10,$f4 */\n/* 20c:\tmul.s\t$f4,$f14,$f22 */\n/* 210:\tadd.s\t$f10,$f6,$f8 */\n/* 214:\tadd.s\t$f6,$f10,$f4 */\n/* 218:\tswc1\t$f6,24(a2) */\n/* 21c:\tlwc1\t$f16,32(a1) */\n/* 220:\tlwc1\t$f18,36(a1) */\n/* 224:\tlwc1\t$f20,40(a1) */\n/* 228:\tmul.s\t$f8,$f0,$f16 */\n/* 22c:\tlwc1\t$f22,44(a1) */\n/* 230:\tmul.s\t$f10,$f2,$f18 */\n/* 234:\tmul.s\t$f6,$f12,$f20 */\n/* 238:\tadd.s\t$f4,$f8,$f10 */\n/* 23c:\tmul.s\t$f10,$f14,$f22 */\n/* 240:\tadd.s\t$f8,$f4,$f6 */\n/* 244:\tadd.s\t$f4,$f8,$f10 */\n/* 248:\tswc1\t$f4,40(a2) */\n/* 24c:\tlwc1\t$f16,48(a1) */\n/* 250:\tlwc1\t$f18,52(a1) */\n/* 254:\tlwc1\t$f20,56(a1) */\n/* 258:\tmul.s\t$f6,$f0,$f16 */\n/* 25c:\tlwc1\t$f22,60(a1) */\n/* 260:\tmul.s\t$f8,$f2,$f18 */\n/* 264:\tmul.s\t$f4,$f12,$f20 */\n/* 268:\tadd.s\t$f10,$f6,$f8 */\n/* 26c:\tmul.s\t$f8,$f14,$f22 */\n/* 270:\tadd.s\t$f6,$f10,$f4 */\n/* 274:\tadd.s\t$f10,$f6,$f8 */\n/* 278:\tswc1\t$f10,56(a2) */\n/* 27c:\tlwc1\t$f0,12(a0) */\n/* 280:\tlwc1\t$f16,0(a1) */\n/* 284:\tlwc1\t$f2,28(a0) */\n/* 288:\tlwc1\t$f18,4(a1) */\n/* 28c:\tmul.s\t$f4,$f0,$f16 */\n/* 290:\tlwc1\t$f12,44(a0) */\n/* 294:\tlwc1\t$f20,8(a1) */\n/* 298:\tmul.s\t$f6,$f2,$f18 */\n/* 29c:\tlwc1\t$f14,60(a0) */\n/* 2a0:\tlwc1\t$f22,12(a1) */\n/* 2a4:\tmul.s\t$f10,$f12,$f20 */\n/* 2a8:\tadd.s\t$f8,$f4,$f6 */\n/* 2ac:\tmul.s\t$f6,$f14,$f22 */\n/* 2b0:\tadd.s\t$f4,$f8,$f10 */\n/* 2b4:\tadd.s\t$f8,$f4,$f6 */\n/* 2b8:\tswc1\t$f8,12(a2) */\n/* 2bc:\tlwc1\t$f16,16(a1) */\n/* 2c0:\tlwc1\t$f18,20(a1) */\n/* 2c4:\tlwc1\t$f20,24(a1) */\n/* 2c8:\tmul.s\t$f10,$f0,$f16 */\n/* 2cc:\tlwc1\t$f22,28(a1) */\n/* 2d0:\tmul.s\t$f4,$f2,$f18 */\n/* 2d4:\tmul.s\t$f8,$f12,$f20 */\n/* 2d8:\tadd.s\t$f6,$f10,$f4 */\n/* 2dc:\tmul.s\t$f4,$f14,$f22 */\n/* 2e0:\tadd.s\t$f10,$f6,$f8 */\n/* 2e4:\tadd.s\t$f6,$f10,$f4 */\n/* 2e8:\tswc1\t$f6,28(a2) */\n/* 2ec:\tlwc1\t$f16,32(a1) */\n/* 2f0:\tlwc1\t$f18,36(a1) */\n/* 2f4:\tlwc1\t$f20,40(a1) */\n/* 2f8:\tmul.s\t$f8,$f0,$f16 */\n/* 2fc:\tlwc1\t$f22,44(a1) */\n/* 300:\tmul.s\t$f10,$f2,$f18 */\n/* 304:\tmul.s\t$f6,$f12,$f20 */\n/* 308:\tadd.s\t$f4,$f8,$f10 */\n/* 30c:\tmul.s\t$f10,$f14,$f22 */\n/* 310:\tadd.s\t$f8,$f4,$f6 */\n/* 314:\tadd.s\t$f4,$f8,$f10 */\n/* 318:\tswc1\t$f4,44(a2) */\n/* 31c:\tlwc1\t$f16,48(a1) */\n/* 320:\tlwc1\t$f18,52(a1) */\n/* 324:\tlwc1\t$f20,56(a1) */\n/* 328:\tmul.s\t$f6,$f0,$f16 */\n/* 32c:\tlwc1\t$f22,60(a1) */\n/* 330:\tmul.s\t$f8,$f2,$f18 */\n/* 334:\tmul.s\t$f4,$f12,$f20 */\n/* 338:\tadd.s\t$f10,$f6,$f8 */\n/* 33c:\tmul.s\t$f8,$f14,$f22 */\n/* 340:\tadd.s\t$f6,$f10,$f4 */\n/* 344:\tadd.s\t$f10,$f6,$f8 */\n/* 348:\tswc1\t$f10,60(a2) */\n/* 34c:\tldc1\t$f22,16(sp) */\n/* 350:\tldc1\t$f20,8(sp) */\n/* 354:\tjr\tra */\n/* 358:\taddiu\tsp,sp,24 */\n/* 35c:\tnop */\nvoid Skin_Matrix_MulMatrix(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":224,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Skin_Matrix_MulMatrix(void *arg0, void *arg1, void *arg2) {\n f32 temp_f0;\n f32 temp_f0_2;\n f32 temp_f0_3;\n f32 temp_f0_4;\n f32 temp_f12;\n f32 temp_f12_2;\n f32 temp_f12_3;\n f32 temp_f12_4;\n f32 temp_f14;\n f32 temp_f14_2;\n f32 temp_f14_3;\n f32 temp_f14_4;\n f32 temp_f2;\n f32 temp_f2_2;\n f32 temp_f2_3;\n f32 temp_f2_4;\n\n temp_f0 = arg0->unk0;\n temp_f2 = arg0->unk10;\n temp_f12 = arg0->unk20;\n temp_f14 = arg0->unk30;\n arg2->unk0 = (f32) ((temp_f0 * arg1->unk0) + (temp_f2 * arg1->unk4) + (temp_f12 * arg1->unk8) + (temp_f14 * arg1->unkC));\n arg2->unk10 = (f32) ((temp_f0 * arg1->unk10) + (temp_f2 * arg1->unk14) + (temp_f12 * arg1->unk18) + (temp_f14 * arg1->unk1C));\n arg2->unk20 = (f32) ((temp_f0 * arg1->unk20) + (temp_f2 * arg1->unk24) + (temp_f12 * arg1->unk28) + (temp_f14 * arg1->unk2C));\n arg2->unk30 = (f32) ((temp_f0 * arg1->unk30) + (temp_f2 * arg1->unk34) + (temp_f12 * arg1->unk38) + (temp_f14 * arg1->unk3C));\n temp_f0_2 = arg0->unk4;\n temp_f2_2 = arg0->unk14;\n temp_f12_2 = arg0->unk24;\n temp_f14_2 = arg0->unk34;\n arg2->unk4 = (f32) ((temp_f0_2 * arg1->unk0) + (temp_f2_2 * arg1->unk4) + (temp_f12_2 * arg1->unk8) + (temp_f14_2 * arg1->unkC));\n arg2->unk14 = (f32) ((temp_f0_2 * arg1->unk10) + (temp_f2_2 * arg1->unk14) + (temp_f12_2 * arg1->unk18) + (temp_f14_2 * arg1->unk1C));\n arg2->unk24 = (f32) ((temp_f0_2 * arg1->unk20) + (temp_f2_2 * arg1->unk24) + (temp_f12_2 * arg1->unk28) + (temp_f14_2 * arg1->unk2C));\n arg2->unk34 = (f32) ((temp_f0_2 * arg1->unk30) + (temp_f2_2 * arg1->unk34) + (temp_f12_2 * arg1->unk38) + (temp_f14_2 * arg1->unk3C));\n temp_f0_3 = arg0->unk8;\n temp_f2_3 = arg0->unk18;\n temp_f12_3 = arg0->unk28;\n temp_f14_3 = arg0->unk38;\n arg2->unk8 = (f32) ((temp_f0_3 * arg1->unk0) + (temp_f2_3 * arg1->unk4) + (temp_f12_3 * arg1->unk8) + (temp_f14_3 * arg1->unkC));\n arg2->unk18 = (f32) ((temp_f0_3 * arg1->unk10) + (temp_f2_3 * arg1->unk14) + (temp_f12_3 * arg1->unk18) + (temp_f14_3 * arg1->unk1C));\n arg2->unk28 = (f32) ((temp_f0_3 * arg1->unk20) + (temp_f2_3 * arg1->unk24) + (temp_f12_3 * arg1->unk28) + (temp_f14_3 * arg1->unk2C));\n arg2->unk38 = (f32) ((temp_f0_3 * arg1->unk30) + (temp_f2_3 * arg1->unk34) + (temp_f12_3 * arg1->unk38) + (temp_f14_3 * arg1->unk3C));\n temp_f0_4 = arg0->unkC;\n temp_f2_4 = arg0->unk1C;\n temp_f12_4 = arg0->unk2C;\n temp_f14_4 = arg0->unk3C;\n arg2->unkC = (f32) ((temp_f0_4 * arg1->unk0) + (temp_f2_4 * arg1->unk4) + (temp_f12_4 * arg1->unk8) + (temp_f14_4 * arg1->unkC));\n arg2->unk1C = (f32) ((temp_f0_4 * arg1->unk10) + (temp_f2_4 * arg1->unk14) + (temp_f12_4 * arg1->unk18) + (temp_f14_4 * arg1->unk1C));\n arg2->unk2C = (f32) ((temp_f0_4 * arg1->unk20) + (temp_f2_4 * arg1->unk24) + (temp_f12_4 * arg1->unk28) + (temp_f14_4 * arg1->unk2C));\n arg2->unk3C = (f32) ((temp_f0_4 * arg1->unk30) + (temp_f2_4 * arg1->unk34) + (temp_f12_4 * arg1->unk38) + (temp_f14_4 * arg1->unk3C));\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":50,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Skin_Matrix_MulMatrix` — benchmark function af:Skin_Matrix_MulMatrix:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Skin_Matrix_MulMatrix\n addiu\t$sp, $sp, -24\n sdc1\t$f22, 16($sp)\n sdc1\t$f20, 8($sp)\n lwc1\t$f0, 0($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 16($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 32($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 48($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 16($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 32($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 48($a2)\n lwc1\t$f0, 4($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 20($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 36($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 52($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 4($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 20($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 36($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 52($a2)\n lwc1\t$f0, 8($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 24($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 40($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 56($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 8($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 24($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 40($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 56($a2)\n lwc1\t$f0, 12($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 28($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 44($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 60($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 12($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 28($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 44($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 60($a2)\n ldc1\t$f22, 16($sp)\n ldc1\t$f20, 8($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Skin_Matrix_MulMatrix # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Skin_Matrix_MulMatrix` — benchmark function af:Skin_Matrix_MulMatrix:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:Skin_Matrix_MulMatrix: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:\tsdc1\t$f22,16(sp)\n 8:\tsdc1\t$f20,8(sp)\n c:\tlwc1\t$f0,0(a0)\n 10:\tlwc1\t$f16,0(a1)\n 14:\tlwc1\t$f2,16(a0)\n 18:\tlwc1\t$f18,4(a1)\n 1c:\tmul.s\t$f4,$f0,$f16\n 20:\tlwc1\t$f12,32(a0)\n 24:\tlwc1\t$f20,8(a1)\n 28:\tmul.s\t$f6,$f2,$f18\n 2c:\tlwc1\t$f14,48(a0)\n 30:\tlwc1\t$f22,12(a1)\n 34:\tmul.s\t$f10,$f12,$f20\n 38:\tadd.s\t$f8,$f4,$f6\n 3c:\tmul.s\t$f6,$f14,$f22\n 40:\tadd.s\t$f4,$f8,$f10\n 44:\tadd.s\t$f8,$f4,$f6\n 48:\tswc1\t$f8,0(a2)\n 4c:\tlwc1\t$f16,16(a1)\n 50:\tlwc1\t$f18,20(a1)\n 54:\tlwc1\t$f20,24(a1)\n 58:\tmul.s\t$f10,$f0,$f16\n 5c:\tlwc1\t$f22,28(a1)\n 60:\tmul.s\t$f4,$f2,$f18\n 64:\tmul.s\t$f8,$f12,$f20\n 68:\tadd.s\t$f6,$f10,$f4\n 6c:\tmul.s\t$f4,$f14,$f22\n 70:\tadd.s\t$f10,$f6,$f8\n 74:\tadd.s\t$f6,$f10,$f4\n 78:\tswc1\t$f6,16(a2)\n 7c:\tlwc1\t$f16,32(a1)\n 80:\tlwc1\t$f18,36(a1)\n 84:\tlwc1\t$f20,40(a1)\n 88:\tmul.s\t$f8,$f0,$f16\n 8c:\tlwc1\t$f22,44(a1)\n 90:\tmul.s\t$f10,$f2,$f18\n 94:\tmul.s\t$f6,$f12,$f20\n 98:\tadd.s\t$f4,$f8,$f10\n 9c:\tmul.s\t$f10,$f14,$f22\n a0:\tadd.s\t$f8,$f4,$f6\n a4:\tadd.s\t$f4,$f8,$f10\n a8:\tswc1\t$f4,32(a2)\n ac:\tlwc1\t$f16,48(a1)\n b0:\tlwc1\t$f18,52(a1)\n b4:\tlwc1\t$f20,56(a1)\n b8:\tmul.s\t$f6,$f0,$f16\n bc:\tlwc1\t$f22,60(a1)\n c0:\tmul.s\t$f8,$f2,$f18\n c4:\tmul.s\t$f4,$f12,$f20\n c8:\tadd.s\t$f10,$f6,$f8\n cc:\tmul.s\t$f8,$f14,$f22\n d0:\tadd.s\t$f6,$f10,$f4\n d4:\tadd.s\t$f10,$f6,$f8\n d8:\tswc1\t$f10,48(a2)\n dc:\tlwc1\t$f0,4(a0)\n e0:\tlwc1\t$f16,0(a1)\n e4:\tlwc1\t$f2,20(a0)\n e8:\tlwc1\t$f18,4(a1)\n ec:\tmul.s\t$f4,$f0,$f16\n f0:\tlwc1\t$f12,36(a0)\n f4:\tlwc1\t$f20,8(a1)\n f8:\tmul.s\t$f6,$f2,$f18\n fc:\tlwc1\t$f14,52(a0)\n 100:\tlwc1\t$f22,12(a1)\n 104:\tmul.s\t$f10,$f12,$f20\n 108:\tadd.s\t$f8,$f4,$f6\n 10c:\tmul.s\t$f6,$f14,$f22\n 110:\tadd.s\t$f4,$f8,$f10\n 114:\tadd.s\t$f8,$f4,$f6\n 118:\tswc1\t$f8,4(a2)\n 11c:\tlwc1\t$f16,16(a1)\n 120:\tlwc1\t$f18,20(a1)\n 124:\tlwc1\t$f20,24(a1)\n 128:\tmul.s\t$f10,$f0,$f16\n 12c:\tlwc1\t$f22,28(a1)\n 130:\tmul.s\t$f4,$f2,$f18\n 134:\tmul.s\t$f8,$f12,$f20\n 138:\tadd.s\t$f6,$f10,$f4\n 13c:\tmul.s\t$f4,$f14,$f22\n 140:\tadd.s\t$f10,$f6,$f8\n 144:\tadd.s\t$f6,$f10,$f4\n 148:\tswc1\t$f6,20(a2)\n 14c:\tlwc1\t$f16,32(a1)\n 150:\tlwc1\t$f18,36(a1)\n 154:\tlwc1\t$f20,40(a1)\n 158:\tmul.s\t$f8,$f0,$f16\n 15c:\tlwc1\t$f22,44(a1)\n 160:\tmul.s\t$f10,$f2,$f18\n 164:\tmul.s\t$f6,$f12,$f20\n 168:\tadd.s\t$f4,$f8,$f10\n 16c:\tmul.s\t$f10,$f14,$f22\n 170:\tadd.s\t$f8,$f4,$f6\n 174:\tadd.s\t$f4,$f8,$f10\n 178:\tswc1\t$f4,36(a2)\n 17c:\tlwc1\t$f16,48(a1)\n 180:\tlwc1\t$f18,52(a1)\n 184:\tlwc1\t$f20,56(a1)\n 188:\tmul.s\t$f6,$f0,$f16\n 18c:\tlwc1\t$f22,60(a1)\n 190:\tmul.s\t$f8,$f2,$f18\n 194:\tmul.s\t$f4,$f12,$f20\n 198:\tadd.s\t$f10,$f6,$f8\n 19c:\tmul.s\t$f8,$f14,$f22\n 1a0:\tadd.s\t$f6,$f10,$f4\n 1a4:\tadd.s\t$f10,$f6,$f8\n 1a8:\tswc1\t$f10,52(a2)\n 1ac:\tlwc1\t$f0,8(a0)\n 1b0:\tlwc1\t$f16,0(a1)\n 1b4:\tlwc1\t$f2,24(a0)\n 1b8:\tlwc1\t$f18,4(a1)\n 1bc:\tmul.s\t$f4,$f0,$f16\n 1c0:\tlwc1\t$f12,40(a0)\n 1c4:\tlwc1\t$f20,8(a1)\n 1c8:\tmul.s\t$f6,$f2,$f18\n 1cc:\tlwc1\t$f14,56(a0)\n 1d0:\tlwc1\t$f22,12(a1)\n 1d4:\tmul.s\t$f10,$f12,$f20\n 1d8:\tadd.s\t$f8,$f4,$f6\n 1dc:\tmul.s\t$f6,$f14,$f22\n 1e0:\tadd.s\t$f4,$f8,$f10\n 1e4:\tadd.s\t$f8,$f4,$f6\n 1e8:\tswc1\t$f8,8(a2)\n 1ec:\tlwc1\t$f16,16(a1)\n 1f0:\tlwc1\t$f18,20(a1)\n 1f4:\tlwc1\t$f20,24(a1)\n 1f8:\tmul.s\t$f10,$f0,$f16\n 1fc:\tlwc1\t$f22,28(a1)\n 200:\tmul.s\t$f4,$f2,$f18\n 204:\tmul.s\t$f8,$f12,$f20\n 208:\tadd.s\t$f6,$f10,$f4\n 20c:\tmul.s\t$f4,$f14,$f22\n 210:\tadd.s\t$f10,$f6,$f8\n 214:\tadd.s\t$f6,$f10,$f4\n 218:\tswc1\t$f6,24(a2)\n 21c:\tlwc1\t$f16,32(a1)\n 220:\tlwc1\t$f18,36(a1)\n 224:\tlwc1\t$f20,40(a1)\n 228:\tmul.s\t$f8,$f0,$f16\n 22c:\tlwc1\t$f22,44(a1)\n 230:\tmul.s\t$f10,$f2,$f18\n 234:\tmul.s\t$f6,$f12,$f20\n 238:\tadd.s\t$f4,$f8,$f10\n 23c:\tmul.s\t$f10,$f14,$f22\n 240:\tadd.s\t$f8,$f4,$f6\n 244:\tadd.s\t$f4,$f8,$f10\n 248:\tswc1\t$f4,40(a2)\n 24c:\tlwc1\t$f16,48(a1)\n 250:\tlwc1\t$f18,52(a1)\n 254:\tlwc1\t$f20,56(a1)\n 258:\tmul.s\t$f6,$f0,$f16\n 25c:\tlwc1\t$f22,60(a1)\n 260:\tmul.s\t$f8,$f2,$f18\n 264:\tmul.s\t$f4,$f12,$f20\n 268:\tadd.s\t$f10,$f6,$f8\n 26c:\tmul.s\t$f8,$f14,$f22\n 270:\tadd.s\t$f6,$f10,$f4\n 274:\tadd.s\t$f10,$f6,$f8\n 278:\tswc1\t$f10,56(a2)\n 27c:\tlwc1\t$f0,12(a0)\n 280:\tlwc1\t$f16,0(a1)\n 284:\tlwc1\t$f2,28(a0)\n 288:\tlwc1\t$f18,4(a1)\n 28c:\tmul.s\t$f4,$f0,$f16\n 290:\tlwc1\t$f12,44(a0)\n 294:\tlwc1\t$f20,8(a1)\n 298:\tmul.s\t$f6,$f2,$f18\n 29c:\tlwc1\t$f14,60(a0)\n 2a0:\tlwc1\t$f22,12(a1)\n 2a4:\tmul.s\t$f10,$f12,$f20\n 2a8:\tadd.s\t$f8,$f4,$f6\n 2ac:\tmul.s\t$f6,$f14,$f22\n 2b0:\tadd.s\t$f4,$f8,$f10\n 2b4:\tadd.s\t$f8,$f4,$f6\n 2b8:\tswc1\t$f8,12(a2)\n 2bc:\tlwc1\t$f16,16(a1)\n 2c0:\tlwc1\t$f18,20(a1)\n 2c4:\tlwc1\t$f20,24(a1)\n 2c8:\tmul.s\t$f10,$f0,$f16\n 2cc:\tlwc1\t$f22,28(a1)\n 2d0:\tmul.s\t$f4,$f2,$f18\n 2d4:\tmul.s\t$f8,$f12,$f20\n 2d8:\tadd.s\t$f6,$f10,$f4\n 2dc:\tmul.s\t$f4,$f14,$f22\n 2e0:\tadd.s\t$f10,$f6,$f8\n 2e4:\tadd.s\t$f6,$f10,$f4\n 2e8:\tswc1\t$f6,28(a2)\n 2ec:\tlwc1\t$f16,32(a1)\n 2f0:\tlwc1\t$f18,36(a1)\n 2f4:\tlwc1\t$f20,40(a1)\n 2f8:\tmul.s\t$f8,$f0,$f16\n 2fc:\tlwc1\t$f22,44(a1)\n 300:\tmul.s\t$f10,$f2,$f18\n 304:\tmul.s\t$f6,$f12,$f20\n 308:\tadd.s\t$f4,$f8,$f10\n 30c:\tmul.s\t$f10,$f14,$f22\n 310:\tadd.s\t$f8,$f4,$f6\n 314:\tadd.s\t$f4,$f8,$f10\n 318:\tswc1\t$f4,44(a2)\n 31c:\tlwc1\t$f16,48(a1)\n 320:\tlwc1\t$f18,52(a1)\n 324:\tlwc1\t$f20,56(a1)\n 328:\tmul.s\t$f6,$f0,$f16\n 32c:\tlwc1\t$f22,60(a1)\n 330:\tmul.s\t$f8,$f2,$f18\n 334:\tmul.s\t$f4,$f12,$f20\n 338:\tadd.s\t$f10,$f6,$f8\n 33c:\tmul.s\t$f8,$f14,$f22\n 340:\tadd.s\t$f6,$f10,$f4\n 344:\tadd.s\t$f10,$f6,$f8\n 348:\tswc1\t$f10,60(a2)\n 34c:\tldc1\t$f22,16(sp)\n 350:\tldc1\t$f20,8(sp)\n 354:\tjr\tra\n 358:\taddiu\tsp,sp,24\n 35c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000360 .text\n00000000 g F .text\t0000035c Skin_Matrix_MulMatrix\n\n\nContents of section .text:\n 0000 27bdffe8 f7b60010 f7b40008 c4800000 '...............\n 0010 c4b00000 c4820010 c4b20004 46100102 ............F...\n 0020 c48c0020 c4b40008 46121182 c48e0030 ... ....F......0\n 0030 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0040 460a4100 46062200 e4c80000 c4b00010 F.A.F.\".........\n 0050 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0060 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0070 46083280 46045180 e4c60010 c4b00020 F.2.F.Q........ \n 0080 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0090 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 00a0 46062200 460a4100 e4c40020 c4b00030 F.\".F.A.... ...0\n 00b0 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 00c0 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 00d0 46045180 46083280 e4ca0030 c4800004 F.Q.F.2....0....\n 00e0 c4b00000 c4820014 c4b20004 46100102 ............F...\n 00f0 c48c0024 c4b40008 46121182 c48e0034 ...$....F......4\n 0100 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0110 460a4100 46062200 e4c80004 c4b00010 F.A.F.\".........\n 0120 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0130 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0140 46083280 46045180 e4c60014 c4b00020 F.2.F.Q........ \n 0150 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0160 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0170 46062200 460a4100 e4c40024 c4b00030 F.\".F.A....$...0\n 0180 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0190 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 01a0 46045180 46083280 e4ca0034 c4800008 F.Q.F.2....4....\n 01b0 c4b00000 c4820018 c4b20004 46100102 ............F...\n 01c0 c48c0028 c4b40008 46121182 c48e0038 ...(....F......8\n 01d0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 01e0 460a4100 46062200 e4c80008 c4b00010 F.A.F.\".........\n 01f0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0200 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0210 46083280 46045180 e4c60018 c4b00020 F.2.F.Q........ \n 0220 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0230 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0240 46062200 460a4100 e4c40028 c4b00030 F.\".F.A....(...0\n 0250 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0260 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0270 46045180 46083280 e4ca0038 c480000c F.Q.F.2....8....\n 0280 c4b00000 c482001c c4b20004 46100102 ............F...\n 0290 c48c002c c4b40008 46121182 c48e003c ...,....F......<\n 02a0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 02b0 460a4100 46062200 e4c8000c c4b00010 F.A.F.\".........\n 02c0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 02d0 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 02e0 46083280 46045180 e4c6001c c4b00020 F.2.F.Q........ \n 02f0 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0300 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0310 46062200 460a4100 e4c4002c c4b00030 F.\".F.A....,...0\n 0320 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0330 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0340 46045180 46083280 e4ca003c d7b60010 F.Q.F.2....<....\n 0350 d7b40008 03e00008 27bd0018 00000000 ........'.......\nContents of section .options:\n 0000 01200000 00000000 a0000070 00000000 . .........p....\n 0010 00f55ff5 00000000 00000000 00007ff0 .._.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000070 00000000 00f55ff5 00000000 ...p......_.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000d7 00000078 000004d8 p..........x....\n 0010 00000005 000006a8 00000001 00000550 ...............P\n 0020 00000004 00000584 00000000 00000000 ................\n 0030 00000011 000005b4 00000040 000005f8 ...........@....\n 0040 00000018 00000638 00000001 00000650 .......8.......P\n 0050 00000000 00000000 00000001 00000698 ................\n 0060 025040d0 4030a040 20b04015 10101020 .P@.@0.@ .@.... \n 0070 f0161010 1020f016 10101020 f0161040 ..... ..... ...@\n 0080 d04030a0 4020b040 15101010 20f01610 .@0.@ .@.... ...\n 0090 101020f0 16101010 20f01610 40d04030 .. ..... ...@.@0\n 00a0 a04020b0 40151010 1020f016 10101020 .@ .@.... ..... \n 00b0 f0161010 1020f016 1040d040 30a04020 ..... ...@.@0.@ \n 00c0 b0401510 101020f0 16101010 20f01610 .@.... ..... ...\n 00d0 101020f0 16130000 00000000 00000001 .. .............\n 00e0 00000000 00000000 00000000 ffffffff ................\n 00f0 00f00000 fffffff8 00000018 001d001f ................\n 0100 0000001b 00000080 00000000 00000001 ................\n 0110 00000000 2c200004 0000002a 00000000 ...., .....*....\n 0120 1820000f 0000002a 0000035c 20200001 . .....*...\\ ..\n 0130 00000001 00000000 20200000 02000000 ........ ......\n 0140 03000000 04000000 05000000 06000000 ................\n 0150 07000000 08000000 09000000 20000000 ............ ...\n 0160 21000000 0a000000 0b000000 0b000000 !...............\n 0170 1a000000 00000000 00000003 06000000 ................\n 0180 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0190 2d69646f 2d393839 35333264 66373437 -ido-989532df747\n 01a0 65343033 612f752e 6900536b 696e5f4d e403a/u.i.Skin_M\n 01b0 61747269 785f4d75 6c4d6174 72697800 atrix_MulMatrix.\n 01c0 536b696e 5f4d6174 7269785f 4d756c4d Skin_Matrix_MulM\n 01d0 61747269 78000000 00000000 00000001 atrix...........\n 01e0 00000000 00000040 00000000 00000004 .......@........\n 01f0 00000000 000000d7 00000000 00000000 ................\n 0200 00000001 00000000 00000011 00000000 ................\n 0210 00000000 01800000 00000000 00000076 ...............v\n 0220 00000000 00000000 00000000 18200001 ............. ..\n 0230 00000000 00000000 00000000 00000000 ................\n 0240 00000000 00000000 7fffffff 00000000 ................\n 0250 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Skin_Matrix_MulMatrix\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 Skin_Matrix_MulMatrix # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:Skin_Matrix_SetQuaternion:ido7.1","sym":"Skin_Matrix_SetQuaternion","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","matrix","arithmetic"],"loc":47,"refSource":"void Skin_Matrix_SetQuaternion(MtxF* mf, f32* q) {\n f32 n;\n f32 xNorm;\n f32 yNorm;\n f32 zNorm;\n f32 wxNorm;\n f32 wyNorm;\n f32 wzNorm;\n f32 xxNorm;\n f32 xyNorm;\n f32 xzNorm;\n f32 yyNorm;\n f32 yzNorm;\n f32 zzNorm;\n\n n = 2.0f / ((q[3] * q[3]) + ((q[2] * q[2]) + ((q[1] * q[1]) + (q[0] * q[0]))));\n xNorm = q[0] * n;\n yNorm = q[1] * n;\n zNorm = q[2] * n;\n\n wxNorm = q[3] * xNorm;\n wyNorm = q[3] * yNorm;\n wzNorm = q[3] * zNorm;\n xxNorm = q[0] * xNorm;\n xyNorm = q[0] * yNorm;\n xzNorm = q[0] * zNorm;\n yyNorm = q[1] * yNorm;\n yzNorm = q[1] * zNorm;\n zzNorm = q[2] * zNorm;\n\n mf->xx = (1.0f - (yyNorm + zzNorm));\n mf->yx = (xyNorm + wzNorm);\n mf->zx = (xzNorm - wyNorm);\n mf->wx = 0.0f;\n mf->xy = (xyNorm - wzNorm);\n mf->yy = (1.0f - (xxNorm + zzNorm));\n mf->zy = (yzNorm + wxNorm);\n mf->wy = 0.0f;\n mf->xz = (yzNorm + wyNorm);\n mf->yz = (yzNorm - wxNorm);\n mf->zz = (1.0f - (xxNorm + yyNorm));\n mf->wz = 0.0f;\n mf->xw = 0.0f;\n mf->yw = 0.0f;\n mf->ww = 1.0f;\n mf->zw = 0.0f;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_skin_matrix.c#L581-L627","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-72\n 4:\tsdc1\t$f20,8(sp)\n 8:\tlwc1\t$f0,0(a1)\n c:\tlwc1\t$f2,4(a1)\n 10:\tlwc1\t$f12,8(a1)\n 14:\tmul.s\t$f4,$f0,$f0\n 18:\tlwc1\t$f20,12(a1)\n 1c:\tlui\tat,0x4000\n 20:\tmul.s\t$f6,$f2,$f2\n 24:\tmul.s\t$f10,$f12,$f12\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tmul.s\t$f6,$f20,$f20\n 30:\tadd.s\t$f4,$f8,$f10\n 34:\tmtc1\tat,$f10\n 38:\tlui\tat,0x3f80\n 3c:\tadd.s\t$f8,$f4,$f6\n 40:\tdiv.s\t$f18,$f10,$f8\n 44:\tmul.s\t$f4,$f0,$f18\n 48:\tmul.s\t$f16,$f2,$f18\n 4c:\tmul.s\t$f14,$f12,$f18\n 50:\tswc1\t$f4,64(sp)\n 54:\tlwc1\t$f6,64(sp)\n 58:\tmul.s\t$f10,$f20,$f6\n 5c:\tmul.s\t$f8,$f20,$f16\n 60:\tmul.s\t$f4,$f20,$f14\n 64:\tswc1\t$f10,52(sp)\n 68:\tmul.s\t$f10,$f0,$f6\n 6c:\tswc1\t$f8,48(sp)\n 70:\tmul.s\t$f8,$f0,$f16\n 74:\tswc1\t$f4,44(sp)\n 78:\tmul.s\t$f18,$f0,$f14\n 7c:\tswc1\t$f10,40(sp)\n 80:\tmtc1\tzero,$f0\n 84:\tmul.s\t$f4,$f2,$f16\n 88:\tswc1\t$f8,36(sp)\n 8c:\tmtc1\tat,$f16\n 90:\tmul.s\t$f6,$f2,$f14\n 94:\tmul.s\t$f10,$f12,$f14\n 98:\tswc1\t$f4,28(sp)\n 9c:\tlwc1\t$f8,28(sp)\n a0:\tswc1\t$f6,24(sp)\n a4:\tswc1\t$f10,20(sp)\n a8:\tlwc1\t$f4,20(sp)\n ac:\tmtc1\tat,$f10\n b0:\tadd.s\t$f6,$f8,$f4\n b4:\tsub.s\t$f8,$f10,$f6\n b8:\tswc1\t$f8,0(a0)\n bc:\tlwc1\t$f10,44(sp)\n c0:\tlwc1\t$f4,36(sp)\n c4:\tadd.s\t$f6,$f4,$f10\n c8:\tswc1\t$f6,4(a0)\n cc:\tlwc1\t$f8,48(sp)\n d0:\tsub.s\t$f4,$f18,$f8\n d4:\tswc1\t$f4,8(a0)\n d8:\tlwc1\t$f14,40(sp)\n dc:\tlwc1\t$f12,52(sp)\n e0:\tlwc1\t$f2,24(sp)\n e4:\tswc1\t$f0,12(a0)\n e8:\tlwc1\t$f6,44(sp)\n ec:\tlwc1\t$f10,36(sp)\n f0:\tsub.s\t$f8,$f10,$f6\n f4:\tswc1\t$f8,16(a0)\n f8:\tlwc1\t$f4,20(sp)\n fc:\tadd.s\t$f8,$f2,$f12\n 100:\tswc1\t$f0,28(a0)\n 104:\tadd.s\t$f10,$f14,$f4\n 108:\tswc1\t$f8,24(a0)\n 10c:\tsub.s\t$f6,$f16,$f10\n 110:\tswc1\t$f6,20(a0)\n 114:\tlwc1\t$f4,48(sp)\n 118:\tsub.s\t$f6,$f2,$f12\n 11c:\tadd.s\t$f10,$f2,$f4\n 120:\tswc1\t$f6,36(a0)\n 124:\tswc1\t$f10,32(a0)\n 128:\tlwc1\t$f8,28(sp)\n 12c:\tswc1\t$f0,44(a0)\n 130:\tswc1\t$f0,48(a0)\n 134:\tadd.s\t$f4,$f14,$f8\n 138:\tswc1\t$f0,52(a0)\n 13c:\tswc1\t$f0,56(a0)\n 140:\tswc1\t$f16,60(a0)\n 144:\tsub.s\t$f10,$f16,$f4\n 148:\tswc1\t$f10,40(a0)\n 14c:\tldc1\t$f20,8(sp)\n 150:\tjr\tra\n 154:\taddiu\tsp,sp,72\n\t...\n","proto":{"Skin_Matrix_SetQuaternion":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000160 .text\n00000000 g F .text\t00000158 Skin_Matrix_SetQuaternion\n\n\nContents of section .text:\n 0000 27bdffb8 f7b40008 c4a00000 c4a20004 '...............\n 0010 c4ac0008 46000102 c4b4000c 3c014000 ....F.......<.@.\n 0020 46021182 460c6282 46062200 4614a182 F...F.b.F.\".F...\n 0030 460a4100 44815000 3c013f80 46062200 F.A.D.P.<.?.F.\".\n 0040 46085483 46120102 46121402 46126382 F.T.F...F...F.c.\n 0050 e7a40040 c7a60040 4606a282 4610a202 ...@...@F...F...\n 0060 460ea102 e7aa0034 46060282 e7a80030 F......4F......0\n 0070 46100202 e7a4002c 460e0482 e7aa0028 F......,F......(\n 0080 44800000 46101102 e7a80024 44818000 D...F......$D...\n 0090 460e1182 460e6282 e7a4001c c7a8001c F...F.b.........\n 00a0 e7a60018 e7aa0014 c7a40014 44815000 ............D.P.\n 00b0 46044180 46065201 e4880000 c7aa002c F.A.F.R........,\n 00c0 c7a40024 460a2180 e4860004 c7a80030 ...$F.!........0\n 00d0 46089101 e4840008 c7ae0028 c7ac0034 F..........(...4\n 00e0 c7a20018 e480000c c7a6002c c7aa0024 ...........,...$\n 00f0 46065201 e4880010 c7a40014 460c1200 F.R.........F...\n 0100 e480001c 46047280 e4880018 460a8181 ....F.r.....F...\n 0110 e4860014 c7a40030 460c1181 46041280 .......0F...F...\n 0120 e4860024 e48a0020 c7a8001c e480002c ...$... .......,\n 0130 e4800030 46087100 e4800034 e4800038 ...0F.q....4...8\n 0140 e490003c 46048281 e48a0028 d7b40008 ...\n 01f0 00000000 00000000 00000000 18200001 ............. ..\n 0200 00000000 00000000 00000000 00000000 ................\n 0210 00000000 00000000 7fffffff 00000000 ................\n 0220 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Skin_Matrix_SetQuaternion' — lift: cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-72 */\n/* 4:\tsdc1\t$f20,8(sp) */\n/* 8:\tlwc1\t$f0,0(a1) */\n/* c:\tlwc1\t$f2,4(a1) */\n/* 10:\tlwc1\t$f12,8(a1) */\n/* 14:\tmul.s\t$f4,$f0,$f0 */\n/* 18:\tlwc1\t$f20,12(a1) */\n/* 1c:\tlui\tat,0x4000 */\n/* 20:\tmul.s\t$f6,$f2,$f2 */\n/* 24:\tmul.s\t$f10,$f12,$f12 */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tmul.s\t$f6,$f20,$f20 */\n/* 30:\tadd.s\t$f4,$f8,$f10 */\n/* 34:\tmtc1\tat,$f10 */\n/* 38:\tlui\tat,0x3f80 */\n/* 3c:\tadd.s\t$f8,$f4,$f6 */\n/* 40:\tdiv.s\t$f18,$f10,$f8 */\n/* 44:\tmul.s\t$f4,$f0,$f18 */\n/* 48:\tmul.s\t$f16,$f2,$f18 */\n/* 4c:\tmul.s\t$f14,$f12,$f18 */\n/* 50:\tswc1\t$f4,64(sp) */\n/* 54:\tlwc1\t$f6,64(sp) */\n/* 58:\tmul.s\t$f10,$f20,$f6 */\n/* 5c:\tmul.s\t$f8,$f20,$f16 */\n/* 60:\tmul.s\t$f4,$f20,$f14 */\n/* 64:\tswc1\t$f10,52(sp) */\n/* 68:\tmul.s\t$f10,$f0,$f6 */\n/* 6c:\tswc1\t$f8,48(sp) */\n/* 70:\tmul.s\t$f8,$f0,$f16 */\n/* 74:\tswc1\t$f4,44(sp) */\n/* 78:\tmul.s\t$f18,$f0,$f14 */\n/* 7c:\tswc1\t$f10,40(sp) */\n/* 80:\tmtc1\tzero,$f0 */\n/* 84:\tmul.s\t$f4,$f2,$f16 */\n/* 88:\tswc1\t$f8,36(sp) */\n/* 8c:\tmtc1\tat,$f16 */\n/* 90:\tmul.s\t$f6,$f2,$f14 */\n/* 94:\tmul.s\t$f10,$f12,$f14 */\n/* 98:\tswc1\t$f4,28(sp) */\n/* 9c:\tlwc1\t$f8,28(sp) */\n/* a0:\tswc1\t$f6,24(sp) */\n/* a4:\tswc1\t$f10,20(sp) */\n/* a8:\tlwc1\t$f4,20(sp) */\n/* ac:\tmtc1\tat,$f10 */\n/* b0:\tadd.s\t$f6,$f8,$f4 */\n/* b4:\tsub.s\t$f8,$f10,$f6 */\n/* b8:\tswc1\t$f8,0(a0) */\n/* bc:\tlwc1\t$f10,44(sp) */\n/* c0:\tlwc1\t$f4,36(sp) */\n/* c4:\tadd.s\t$f6,$f4,$f10 */\n/* c8:\tswc1\t$f6,4(a0) */\n/* cc:\tlwc1\t$f8,48(sp) */\n/* d0:\tsub.s\t$f4,$f18,$f8 */\n/* d4:\tswc1\t$f4,8(a0) */\n/* d8:\tlwc1\t$f14,40(sp) */\n/* dc:\tlwc1\t$f12,52(sp) */\n/* e0:\tlwc1\t$f2,24(sp) */\n/* e4:\tswc1\t$f0,12(a0) */\n/* e8:\tlwc1\t$f6,44(sp) */\n/* ec:\tlwc1\t$f10,36(sp) */\n/* f0:\tsub.s\t$f8,$f10,$f6 */\n/* f4:\tswc1\t$f8,16(a0) */\n/* f8:\tlwc1\t$f4,20(sp) */\n/* fc:\tadd.s\t$f8,$f2,$f12 */\n/* 100:\tswc1\t$f0,28(a0) */\n/* 104:\tadd.s\t$f10,$f14,$f4 */\n/* 108:\tswc1\t$f8,24(a0) */\n/* 10c:\tsub.s\t$f6,$f16,$f10 */\n/* 110:\tswc1\t$f6,20(a0) */\n/* 114:\tlwc1\t$f4,48(sp) */\n/* 118:\tsub.s\t$f6,$f2,$f12 */\n/* 11c:\tadd.s\t$f10,$f2,$f4 */\n/* 120:\tswc1\t$f6,36(a0) */\n/* 124:\tswc1\t$f10,32(a0) */\n/* 128:\tlwc1\t$f8,28(sp) */\n/* 12c:\tswc1\t$f0,44(a0) */\n/* 130:\tswc1\t$f0,48(a0) */\n/* 134:\tadd.s\t$f4,$f14,$f8 */\n/* 138:\tswc1\t$f0,52(a0) */\n/* 13c:\tswc1\t$f0,56(a0) */\n/* 140:\tswc1\t$f16,60(a0) */\n/* 144:\tsub.s\t$f10,$f16,$f4 */\n/* 148:\tswc1\t$f10,40(a0) */\n/* 14c:\tldc1\t$f20,8(sp) */\n/* 150:\tjr\tra */\n/* 154:\taddiu\tsp,sp,72 */\n/* \t... */\nvoid Skin_Matrix_SetQuaternion(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":95,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Skin_Matrix_SetQuaternion(void *arg0, void *arg1) {\n f32 sp40;\n f32 sp34;\n f32 sp30;\n f32 sp2C;\n f32 sp28;\n f32 sp24;\n f32 sp1C;\n f32 sp18;\n f32 sp14;\n f32 temp_f0;\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f16;\n f32 temp_f18;\n f32 temp_f20;\n f32 temp_f2;\n f32 temp_f8;\n\n temp_f0 = arg1->unk0;\n temp_f2 = arg1->unk4;\n temp_f12 = arg1->unk8;\n temp_f20 = arg1->unkC;\n temp_f18 = 2.0f / ((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f12 * temp_f12) + (temp_f20 * temp_f20));\n temp_f16 = temp_f2 * temp_f18;\n temp_f14 = temp_f12 * temp_f18;\n sp40 = temp_f0 * temp_f18;\n temp_f8 = temp_f20 * temp_f16;\n sp34 = temp_f20 * sp40;\n sp30 = temp_f8;\n sp2C = temp_f20 * temp_f14;\n sp28 = temp_f0 * sp40;\n sp24 = temp_f0 * temp_f16;\n sp1C = temp_f2 * temp_f16;\n sp18 = temp_f2 * temp_f14;\n sp14 = temp_f12 * temp_f14;\n arg0->unk0 = (f32) (1.0f - (sp1C + sp14));\n arg0->unk4 = (f32) (sp24 + sp2C);\n arg0->unk8 = (f32) ((temp_f0 * temp_f14) - temp_f8);\n arg0->unkC = 0.0f;\n arg0->unk10 = (f32) (sp24 - sp2C);\n arg0->unk1C = 0.0f;\n arg0->unk18 = (f32) (sp18 + sp34);\n arg0->unk14 = (f32) (1.0f - (sp28 + sp14));\n arg0->unk24 = (f32) (sp18 - sp34);\n arg0->unk20 = (f32) (sp18 + sp30);\n arg0->unk2C = 0.0f;\n arg0->unk30 = 0.0f;\n arg0->unk34 = 0.0f;\n arg0->unk38 = 0.0f;\n arg0->unk3C = 1.0f;\n arg0->unk28 = (f32) (1.0f - (sp28 + sp1C));\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":52,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 62: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Skin_Matrix_SetQuaternion` — benchmark function af:Skin_Matrix_SetQuaternion:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Skin_Matrix_SetQuaternion\n addiu\t$sp, $sp, -72\n sdc1\t$f20, 8($sp)\n lwc1\t$f0, 0($a1)\n lwc1\t$f2, 4($a1)\n lwc1\t$f12, 8($a1)\n mul.s\t$f4, $f0, $f0\n lwc1\t$f20, 12($a1)\n lui\t$at, 0x4000\n mul.s\t$f6, $f2, $f2\n mul.s\t$f10, $f12, $f12\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f20, $f20\n add.s\t$f4, $f8, $f10\n mtc1\t$at, $f10\n lui\t$at, 0x3f80\n add.s\t$f8, $f4, $f6\n div.s\t$f18, $f10, $f8\n mul.s\t$f4, $f0, $f18\n mul.s\t$f16, $f2, $f18\n mul.s\t$f14, $f12, $f18\n swc1\t$f4, 64($sp)\n lwc1\t$f6, 64($sp)\n mul.s\t$f10, $f20, $f6\n mul.s\t$f8, $f20, $f16\n mul.s\t$f4, $f20, $f14\n swc1\t$f10, 52($sp)\n mul.s\t$f10, $f0, $f6\n swc1\t$f8, 48($sp)\n mul.s\t$f8, $f0, $f16\n swc1\t$f4, 44($sp)\n mul.s\t$f18, $f0, $f14\n swc1\t$f10, 40($sp)\n mtc1\t$zero, $f0\n mul.s\t$f4, $f2, $f16\n swc1\t$f8, 36($sp)\n mtc1\t$at, $f16\n mul.s\t$f6, $f2, $f14\n mul.s\t$f10, $f12, $f14\n swc1\t$f4, 28($sp)\n lwc1\t$f8, 28($sp)\n swc1\t$f6, 24($sp)\n swc1\t$f10, 20($sp)\n lwc1\t$f4, 20($sp)\n mtc1\t$at, $f10\n add.s\t$f6, $f8, $f4\n sub.s\t$f8, $f10, $f6\n swc1\t$f8, 0($a0)\n lwc1\t$f10, 44($sp)\n lwc1\t$f4, 36($sp)\n add.s\t$f6, $f4, $f10\n swc1\t$f6, 4($a0)\n lwc1\t$f8, 48($sp)\n sub.s\t$f4, $f18, $f8\n swc1\t$f4, 8($a0)\n lwc1\t$f14, 40($sp)\n lwc1\t$f12, 52($sp)\n lwc1\t$f2, 24($sp)\n swc1\t$f0, 12($a0)\n lwc1\t$f6, 44($sp)\n lwc1\t$f10, 36($sp)\n sub.s\t$f8, $f10, $f6\n swc1\t$f8, 16($a0)\n lwc1\t$f4, 20($sp)\n add.s\t$f8, $f2, $f12\n swc1\t$f0, 28($a0)\n add.s\t$f10, $f14, $f4\n swc1\t$f8, 24($a0)\n sub.s\t$f6, $f16, $f10\n swc1\t$f6, 20($a0)\n lwc1\t$f4, 48($sp)\n sub.s\t$f6, $f2, $f12\n add.s\t$f10, $f2, $f4\n swc1\t$f6, 36($a0)\n swc1\t$f10, 32($a0)\n lwc1\t$f8, 28($sp)\n swc1\t$f0, 44($a0)\n swc1\t$f0, 48($a0)\n add.s\t$f4, $f14, $f8\n swc1\t$f0, 52($a0)\n swc1\t$f0, 56($a0)\n swc1\t$f16, 60($a0)\n sub.s\t$f10, $f16, $f4\n swc1\t$f10, 40($a0)\n ldc1\t$f20, 8($sp)\n jr\t$ra\n addiu\t$sp, $sp, 72\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Skin_Matrix_SetQuaternion # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Skin_Matrix_SetQuaternion` — benchmark function af:Skin_Matrix_SetQuaternion:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:Skin_Matrix_SetQuaternion: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,-72\n 4:\tsdc1\t$f20,8(sp)\n 8:\tlwc1\t$f0,0(a1)\n c:\tlwc1\t$f2,4(a1)\n 10:\tlwc1\t$f12,8(a1)\n 14:\tmul.s\t$f4,$f0,$f0\n 18:\tlwc1\t$f20,12(a1)\n 1c:\tlui\tat,0x4000\n 20:\tmul.s\t$f6,$f2,$f2\n 24:\tmul.s\t$f10,$f12,$f12\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tmul.s\t$f6,$f20,$f20\n 30:\tadd.s\t$f4,$f8,$f10\n 34:\tmtc1\tat,$f10\n 38:\tlui\tat,0x3f80\n 3c:\tadd.s\t$f8,$f4,$f6\n 40:\tdiv.s\t$f18,$f10,$f8\n 44:\tmul.s\t$f4,$f0,$f18\n 48:\tmul.s\t$f16,$f2,$f18\n 4c:\tmul.s\t$f14,$f12,$f18\n 50:\tswc1\t$f4,64(sp)\n 54:\tlwc1\t$f6,64(sp)\n 58:\tmul.s\t$f10,$f20,$f6\n 5c:\tmul.s\t$f8,$f20,$f16\n 60:\tmul.s\t$f4,$f20,$f14\n 64:\tswc1\t$f10,52(sp)\n 68:\tmul.s\t$f10,$f0,$f6\n 6c:\tswc1\t$f8,48(sp)\n 70:\tmul.s\t$f8,$f0,$f16\n 74:\tswc1\t$f4,44(sp)\n 78:\tmul.s\t$f18,$f0,$f14\n 7c:\tswc1\t$f10,40(sp)\n 80:\tmtc1\tzero,$f0\n 84:\tmul.s\t$f4,$f2,$f16\n 88:\tswc1\t$f8,36(sp)\n 8c:\tmtc1\tat,$f16\n 90:\tmul.s\t$f6,$f2,$f14\n 94:\tmul.s\t$f10,$f12,$f14\n 98:\tswc1\t$f4,28(sp)\n 9c:\tlwc1\t$f8,28(sp)\n a0:\tswc1\t$f6,24(sp)\n a4:\tswc1\t$f10,20(sp)\n a8:\tlwc1\t$f4,20(sp)\n ac:\tmtc1\tat,$f10\n b0:\tadd.s\t$f6,$f8,$f4\n b4:\tsub.s\t$f8,$f10,$f6\n b8:\tswc1\t$f8,0(a0)\n bc:\tlwc1\t$f10,44(sp)\n c0:\tlwc1\t$f4,36(sp)\n c4:\tadd.s\t$f6,$f4,$f10\n c8:\tswc1\t$f6,4(a0)\n cc:\tlwc1\t$f8,48(sp)\n d0:\tsub.s\t$f4,$f18,$f8\n d4:\tswc1\t$f4,8(a0)\n d8:\tlwc1\t$f14,40(sp)\n dc:\tlwc1\t$f12,52(sp)\n e0:\tlwc1\t$f2,24(sp)\n e4:\tswc1\t$f0,12(a0)\n e8:\tlwc1\t$f6,44(sp)\n ec:\tlwc1\t$f10,36(sp)\n f0:\tsub.s\t$f8,$f10,$f6\n f4:\tswc1\t$f8,16(a0)\n f8:\tlwc1\t$f4,20(sp)\n fc:\tadd.s\t$f8,$f2,$f12\n 100:\tswc1\t$f0,28(a0)\n 104:\tadd.s\t$f10,$f14,$f4\n 108:\tswc1\t$f8,24(a0)\n 10c:\tsub.s\t$f6,$f16,$f10\n 110:\tswc1\t$f6,20(a0)\n 114:\tlwc1\t$f4,48(sp)\n 118:\tsub.s\t$f6,$f2,$f12\n 11c:\tadd.s\t$f10,$f2,$f4\n 120:\tswc1\t$f6,36(a0)\n 124:\tswc1\t$f10,32(a0)\n 128:\tlwc1\t$f8,28(sp)\n 12c:\tswc1\t$f0,44(a0)\n 130:\tswc1\t$f0,48(a0)\n 134:\tadd.s\t$f4,$f14,$f8\n 138:\tswc1\t$f0,52(a0)\n 13c:\tswc1\t$f0,56(a0)\n 140:\tswc1\t$f16,60(a0)\n 144:\tsub.s\t$f10,$f16,$f4\n 148:\tswc1\t$f10,40(a0)\n 14c:\tldc1\t$f20,8(sp)\n 150:\tjr\tra\n 154:\taddiu\tsp,sp,72\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000160 .text\n00000000 g F .text\t00000158 Skin_Matrix_SetQuaternion\n\n\nContents of section .text:\n 0000 27bdffb8 f7b40008 c4a00000 c4a20004 '...............\n 0010 c4ac0008 46000102 c4b4000c 3c014000 ....F.......<.@.\n 0020 46021182 460c6282 46062200 4614a182 F...F.b.F.\".F...\n 0030 460a4100 44815000 3c013f80 46062200 F.A.D.P.<.?.F.\".\n 0040 46085483 46120102 46121402 46126382 F.T.F...F...F.c.\n 0050 e7a40040 c7a60040 4606a282 4610a202 ...@...@F...F...\n 0060 460ea102 e7aa0034 46060282 e7a80030 F......4F......0\n 0070 46100202 e7a4002c 460e0482 e7aa0028 F......,F......(\n 0080 44800000 46101102 e7a80024 44818000 D...F......$D...\n 0090 460e1182 460e6282 e7a4001c c7a8001c F...F.b.........\n 00a0 e7a60018 e7aa0014 c7a40014 44815000 ............D.P.\n 00b0 46044180 46065201 e4880000 c7aa002c F.A.F.R........,\n 00c0 c7a40024 460a2180 e4860004 c7a80030 ...$F.!........0\n 00d0 46089101 e4840008 c7ae0028 c7ac0034 F..........(...4\n 00e0 c7a20018 e480000c c7a6002c c7aa0024 ...........,...$\n 00f0 46065201 e4880010 c7a40014 460c1200 F.R.........F...\n 0100 e480001c 46047280 e4880018 460a8181 ....F.r.....F...\n 0110 e4860014 c7a40030 460c1181 46041280 .......0F...F...\n 0120 e4860024 e48a0020 c7a8001c e480002c ...$... .......,\n 0130 e4800030 46087100 e4800034 e4800038 ...0F.q....4...8\n 0140 e490003c 46048281 e48a0028 d7b40008 ...\n 01f0 00000000 00000000 00000000 18200001 ............. ..\n 0200 00000000 00000000 00000000 00000000 ................\n 0210 00000000 00000000 7fffffff 00000000 ................\n 0220 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Skin_Matrix_SetQuaternion\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 Skin_Matrix_SetQuaternion # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":5,"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 17: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 18: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 19: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 20: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 21: Selector requires struct/union pointer as left hand side"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel spolar2world\n addiu\t$sp, $sp, -64\n sw\t$ra, 28($sp)\n sw\t$s0, 24($sp)\n sw\t$a0, 64($sp)\n move\t$s0, $a1\n jal\tcos_s\n lh\t$a0, 4($a1)\n swc1\t$f0, 44($sp)\n jal\tcos_s\n lh\t$a0, 6($s0)\n swc1\t$f0, 36($sp)\n jal\tsin_s\n lh\t$a0, 4($s0)\n lh\t$a0, 6($s0)\n jal\tsin_s\n swc1\t$f0, 48($sp)\n lwc1\t$f2, 48($sp)\n lwc1\t$f4, 0($s0)\n lwc1\t$f16, 44($sp)\n addiu\t$t6, $sp, 52\n mul.s\t$f6, $f4, $f2\n lw\t$v0, 64($sp)\n mul.s\t$f8, $f6, $f0\n swc1\t$f8, 52($sp)\n lwc1\t$f10, 0($s0)\n lwc1\t$f8, 36($sp)\n mul.s\t$f18, $f10, $f16\n swc1\t$f18, 56($sp)\n lwc1\t$f4, 0($s0)\n mul.s\t$f6, $f4, $f2\n mul.s\t$f10, $f6, $f8\n swc1\t$f10, 60($sp)\n lw\t$t8, 0($t6)\n sw\t$t8, 0($v0)\n lw\t$t7, 4($t6)\n sw\t$t7, 4($v0)\n lw\t$t8, 8($t6)\n sw\t$t8, 8($v0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n addiu\t$sp, $sp, 64\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function spolar2world # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:suMtxMakeSRT:ido7.1","sym":"suMtxMakeSRT","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","array","matrix","shift","bitwise","call"],"loc":67,"refSource":"void suMtxMakeSRT(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX,\n f32 translateY, f32 translateZ) {\n struct {\n s16 intPart[4][4];\n u16 fracPart[4][4];\n }* mu = (void*)mtx;\n s32 fp;\n f32 sinX = sin_s(rotX);\n f32 sinY = sin_s(rotY);\n f32 sinZ = sin_s(rotZ);\n f32 cosX = cos_s(rotX);\n f32 cosY = cos_s(rotY);\n f32 cosZ = cos_s(rotZ);\n\n fp = cosY * cosZ * scaleX * 0x10000;\n mu->intPart[0][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][0] = fp & 0xFFFF;\n\n fp = cosY * sinZ * scaleX * 0x10000;\n mu->intPart[0][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][1] = fp & 0xFFFF;\n\n fp = -sinY * scaleX * 0x10000;\n mu->intPart[0][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][2] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * cosZ) - (cosX * sinZ)) * scaleY * 0x10000;\n mu->intPart[1][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][0] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * sinZ) + (cosX * cosZ)) * scaleY * 0x10000;\n mu->intPart[1][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][1] = fp & 0xFFFF;\n\n fp = sinX * cosY * scaleY * 0x10000;\n mu->intPart[1][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][2] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * cosZ) + (sinX * sinZ)) * scaleZ * 0x10000;\n mu->intPart[2][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][0] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * sinZ) - (sinX * cosZ)) * scaleZ * 0x10000;\n mu->intPart[2][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][1] = fp & 0xFFFF;\n\n fp = cosX * cosY * scaleZ * 0x10000;\n mu->intPart[2][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][2] = fp & 0xFFFF;\n\n fp = translateX * 0x10000;\n mu->intPart[3][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][0] = fp & 0xFFFF;\n\n fp = translateY * 0x10000;\n mu->intPart[3][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][1] = fp & 0xFFFF;\n\n fp = translateZ * 0x10000;\n mu->intPart[3][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][2] = fp & 0xFFFF;\n\n mu->intPart[0][3] = mu->intPart[1][3] = mu->intPart[2][3] = 0;\n mu->fracPart[0][3] = mu->fracPart[1][3] = mu->fracPart[2][3] = 0;\n mu->intPart[3][3] = 1;\n mu->fracPart[3][3] = 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_matrix.c#L1448-L1514","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-88\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,36(sp)\n 10:\tsdc1\t$f20,24(sp)\n 14:\tsw\ta1,92(sp)\n 18:\tsw\ta2,96(sp)\n 1c:\tsw\ta3,100(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,106(sp)\n 28:\tmtc1\tv0,$f4\n 2c:\tlh\ta0,110(sp)\n 30:\tjal\t0 \n 34:\tcvt.s.w\t$f20,$f4\n 38:\tmtc1\tv0,$f6\n 3c:\tlh\ta0,114(sp)\n 40:\tcvt.s.w\t$f8,$f6\n 44:\tjal\t0 \n 48:\tswc1\t$f8,72(sp)\n 4c:\tmtc1\tv0,$f10\n 50:\tlh\ta0,106(sp)\n 54:\tcvt.s.w\t$f16,$f10\n 58:\tjal\t0 \n 5c:\tswc1\t$f16,68(sp)\n 60:\tmtc1\tv0,$f4\n 64:\tlh\ta0,110(sp)\n 68:\tcvt.s.w\t$f12,$f4\n 6c:\tjal\t0 \n 70:\tswc1\t$f12,64(sp)\n 74:\tmtc1\tv0,$f6\n 78:\tlh\ta0,114(sp)\n 7c:\tcvt.s.w\t$f14,$f6\n 80:\tjal\t0 \n 84:\tswc1\t$f14,60(sp)\n 88:\tmtc1\tv0,$f8\n 8c:\tlwc1\t$f14,60(sp)\n 90:\tlwc1\t$f4,92(sp)\n 94:\tcvt.s.w\t$f18,$f8\n 98:\tlui\tat,0x4780\n 9c:\tmtc1\tat,$f0\n a0:\tlwc1\t$f16,68(sp)\n a4:\tlwc1\t$f12,64(sp)\n a8:\tmul.s\t$f10,$f14,$f18\n ac:\tmul.s\t$f6,$f10,$f4\n b0:\tmul.s\t$f8,$f6,$f0\n b4:\tmul.s\t$f4,$f14,$f16\n b8:\ttrunc.w.s\t$f10,$f8\n bc:\tmfc1\tt9,$f10\n c0:\tnop\n c4:\tsrl\tt8,t9,0x10\n c8:\tsh\tt8,0(s0)\n cc:\tsh\tt9,32(s0)\n d0:\tlwc1\t$f6,92(sp)\n d4:\tmul.s\t$f8,$f4,$f6\n d8:\tmul.s\t$f10,$f8,$f0\n dc:\ttrunc.w.s\t$f4,$f10\n e0:\tmfc1\tt3,$f4\n e4:\tnop\n e8:\tsrl\tt2,t3,0x10\n ec:\tsh\tt2,2(s0)\n f0:\tsh\tt3,34(s0)\n f4:\tlwc1\t$f6,72(sp)\n f8:\tlwc1\t$f10,92(sp)\n fc:\tneg.s\t$f8,$f6\n 100:\tmul.s\t$f4,$f8,$f10\n 104:\tmul.s\t$f6,$f4,$f0\n 108:\ttrunc.w.s\t$f8,$f6\n 10c:\tmfc1\tt7,$f8\n 110:\tnop\n 114:\tsrl\tt6,t7,0x10\n 118:\tsh\tt6,4(s0)\n 11c:\tsh\tt7,36(s0)\n 120:\tlwc1\t$f10,72(sp)\n 124:\tmul.s\t$f4,$f20,$f10\n 128:\tswc1\t$f4,44(sp)\n 12c:\tlwc1\t$f6,44(sp)\n 130:\tmul.s\t$f8,$f6,$f18\n 134:\tlwc1\t$f6,96(sp)\n 138:\tmul.s\t$f10,$f12,$f16\n 13c:\tsub.s\t$f4,$f8,$f10\n 140:\tmul.s\t$f8,$f4,$f6\n 144:\tmul.s\t$f10,$f8,$f0\n 148:\ttrunc.w.s\t$f4,$f10\n 14c:\tmfc1\tt1,$f4\n 150:\tnop\n 154:\tsrl\tt0,t1,0x10\n 158:\tsh\tt0,8(s0)\n 15c:\tsh\tt1,40(s0)\n 160:\tlwc1\t$f6,44(sp)\n 164:\tmul.s\t$f8,$f6,$f16\n 168:\tlwc1\t$f6,96(sp)\n 16c:\tmul.s\t$f10,$f12,$f18\n 170:\tadd.s\t$f4,$f8,$f10\n 174:\tmul.s\t$f8,$f4,$f6\n 178:\tmul.s\t$f10,$f8,$f0\n 17c:\tmul.s\t$f6,$f20,$f14\n 180:\ttrunc.w.s\t$f4,$f10\n 184:\tmfc1\tt5,$f4\n 188:\tnop\n 18c:\tsrl\tt4,t5,0x10\n 190:\tsh\tt4,10(s0)\n 194:\tsh\tt5,42(s0)\n 198:\tlwc1\t$f8,96(sp)\n 19c:\tmul.s\t$f10,$f6,$f8\n 1a0:\tmul.s\t$f4,$f10,$f0\n 1a4:\ttrunc.w.s\t$f6,$f4\n 1a8:\tmfc1\tt9,$f6\n 1ac:\tnop\n 1b0:\tsrl\tt8,t9,0x10\n 1b4:\tsh\tt8,12(s0)\n 1b8:\tsh\tt9,44(s0)\n 1bc:\tlwc1\t$f8,72(sp)\n 1c0:\tmul.s\t$f2,$f12,$f8\n 1c4:\tlwc1\t$f8,100(sp)\n 1c8:\tmul.s\t$f10,$f2,$f18\n 1cc:\tmul.s\t$f4,$f20,$f16\n 1d0:\tadd.s\t$f6,$f10,$f4\n 1d4:\tmul.s\t$f10,$f6,$f8\n 1d8:\tmul.s\t$f4,$f10,$f0\n 1dc:\tmul.s\t$f8,$f2,$f16\n 1e0:\tmul.s\t$f10,$f20,$f18\n 1e4:\ttrunc.w.s\t$f6,$f4\n 1e8:\tsub.s\t$f4,$f8,$f10\n 1ec:\tmfc1\tt3,$f6\n 1f0:\tnop\n 1f4:\tsrl\tt2,t3,0x10\n 1f8:\tsh\tt2,16(s0)\n 1fc:\tsh\tt3,48(s0)\n 200:\tlwc1\t$f6,100(sp)\n 204:\tmul.s\t$f8,$f4,$f6\n 208:\tmul.s\t$f10,$f8,$f0\n 20c:\tmul.s\t$f6,$f12,$f14\n 210:\ttrunc.w.s\t$f4,$f10\n 214:\tmfc1\tt7,$f4\n 218:\tnop\n 21c:\tsrl\tt6,t7,0x10\n 220:\tsh\tt6,18(s0)\n 224:\tsh\tt7,50(s0)\n 228:\tlwc1\t$f8,100(sp)\n 22c:\tmul.s\t$f10,$f6,$f8\n 230:\tmul.s\t$f4,$f10,$f0\n 234:\ttrunc.w.s\t$f6,$f4\n 238:\tmfc1\tt1,$f6\n 23c:\tnop\n 240:\tsrl\tt0,t1,0x10\n 244:\tsh\tt0,20(s0)\n 248:\tsh\tt1,52(s0)\n 24c:\tlwc1\t$f8,116(sp)\n 250:\tmul.s\t$f10,$f8,$f0\n 254:\ttrunc.w.s\t$f4,$f10\n 258:\tmfc1\tt5,$f4\n 25c:\tnop\n 260:\tsrl\tt4,t5,0x10\n 264:\tsh\tt4,24(s0)\n 268:\tsh\tt5,56(s0)\n 26c:\tlwc1\t$f6,120(sp)\n 270:\tli\tt4,1\n 274:\tmul.s\t$f8,$f6,$f0\n 278:\ttrunc.w.s\t$f10,$f8\n 27c:\tmfc1\tt9,$f10\n 280:\tnop\n 284:\tsrl\tt8,t9,0x10\n 288:\tsh\tt8,26(s0)\n 28c:\tsh\tt9,58(s0)\n 290:\tlwc1\t$f4,124(sp)\n 294:\tsh\tzero,22(s0)\n 298:\tlh\tv0,22(s0)\n 29c:\tmul.s\t$f6,$f4,$f0\n 2a0:\tsh\tzero,38(s0)\n 2a4:\tsh\tzero,46(s0)\n 2a8:\tsh\tzero,54(s0)\n 2ac:\tsh\tt4,30(s0)\n 2b0:\tsh\tzero,62(s0)\n 2b4:\tsh\tv0,14(s0)\n 2b8:\ttrunc.w.s\t$f8,$f6\n 2bc:\tsh\tv0,6(s0)\n 2c0:\tmfc1\tt3,$f8\n 2c4:\tnop\n 2c8:\tsrl\tt2,t3,0x10\n 2cc:\tsh\tt2,28(s0)\n 2d0:\tsh\tt3,60(s0)\n 2d4:\tlw\tra,36(sp)\n 2d8:\tlw\ts0,32(sp)\n 2dc:\tldc1\t$f20,24(sp)\n 2e0:\tjr\tra\n 2e4:\taddiu\tsp,sp,88\n\t...\n","proto":{"suMtxMakeSRT":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000002f0 .text\n00000000 g F .text\t000002e8 suMtxMakeSRT\n00000000 F *UND*\t00000000 sin_s\n00000000 F *UND*\t00000000 cos_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 sin_s\n00000030 R_MIPS_26 sin_s\n00000044 R_MIPS_26 sin_s\n00000058 R_MIPS_26 cos_s\n0000006c R_MIPS_26 cos_s\n00000080 R_MIPS_26 cos_s\n\n\nContents of section .text:\n 0000 27bdffa8 afb00020 00808025 afbf0024 '...... ...%...$\n 0010 f7b40018 afa5005c afa60060 afa70064 .......\\...`...d\n 0020 0c000000 87a4006a 44822000 87a4006e .......jD. ....n\n 0030 0c000000 46802520 44823000 87a40072 ....F.% D.0....r\n 0040 46803220 0c000000 e7a80048 44825000 F.2 .......HD.P.\n 0050 87a4006a 46805420 0c000000 e7b00044 ...jF.T .......D\n 0060 44822000 87a4006e 46802320 0c000000 D. ....nF.# ....\n 0070 e7ac0040 44823000 87a40072 468033a0 ...@D.0....rF.3.\n 0080 0c000000 e7ae003c 44824000 c7ae003c ...........F.2.....\n 02c0 440b4000 00000000 000b5402 a60a001c D.@.......T.....\n 02d0 a60b003c 8fbf0024 8fb00020 d7b40018 ...<...$... ....\n 02e0 03e00008 27bd0058 00000000 00000000 ....'..X........\nContents of section .options:\n 0000 01200000 00000000 a301fff6 00000000 . ..............\n 0010 003ffffd 00000000 00000000 00007ff0 .?..............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a301fff6 00000000 003ffffd 00000000 .........?......\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000ba 00000048 000004c8 p..........H....\n 0010 00000007 00000684 00000001 00000510 ................\n 0020 00000004 00000544 00000000 00000000 .......D........\n 0030 00000011 00000574 00000038 000005b8 .......t...8....\n 0040 0000001c 000005f0 00000001 0000060c ................\n 0050 00000000 00000000 00000003 00000654 ...............T\n 0060 076211f0 1010f010 f01010f0 1210f012 .b..............\n 0070 10f01320 e42230d4 10271028 00102805 ... .\"0..'.(..(.\n 0080 102630d4 10271027 31d030d3 102230d4 .&0..'.'1.0..\"0.\n 0090 10271026 10207095 102021e0 321010d0 .'.&. p.. !.2...\n 00a0 e020e310 54000000 00000000 00000001 . ..T...........\n 00b0 00000000 80010000 ffffffcc ffffffff ................\n 00c0 00300000 ffffffc0 00000058 001d001f .0.........X....\n 00d0 0000001c 00000050 00000000 00000001 .......P........\n 00e0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00f0 1820000f 0000002a 000002e8 20200001 . .....*.... ..\n 0100 00000001 00000000 20200000 02000000 ........ ......\n 0110 03000000 04000000 05000000 06000000 ................\n 0120 07000000 08000000 09000000 20000000 ............ ...\n 0130 21000000 0a000000 0b000000 0b000000 !...............\n 0140 1a000000 00000000 00000003 06000000 ................\n 0150 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0160 2d69646f 2d323332 39393131 62336262 -ido-2329911b3bb\n 0170 35316331 342f752e 69007375 4d74784d 51c14/u.i.suMtxM\n 0180 616b6553 52540000 73754d74 784d616b akeSRT..suMtxMak\n 0190 65535254 0073696e 5f730063 6f735f73 eSRT.sin_s.cos_s\n 01a0 00000000 00000000 00000001 00000000 ................\n 01b0 00000037 00000000 00000004 00000000 ...7............\n 01c0 000000ba 00000000 00000000 00000001 ................\n 01d0 00000000 00000011 00000000 00000000 ................\n 01e0 01800000 00000000 00000045 00000000 ...........E....\n 01f0 00000000 00000000 18200001 00000000 ......... ......\n 0200 0000000d 00000000 18cfffff 00000000 ................\n 0210 00000013 00000000 18cfffff 00000000 ................\n 0220 00000000 00000000 00000000 00000000 ................\n 0230 00000000 7fffffff 00000000 7fffffff ................\n 0240 00000001 7fffffff 00000002 00000000 ................\n 0250 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'suMtxMakeSRT' — lift: cannot lift 'suMtxMakeSRT': 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,-88 */\n/* 4:\tsw\ts0,32(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,36(sp) */\n/* 10:\tsdc1\t$f20,24(sp) */\n/* 14:\tsw\ta1,92(sp) */\n/* 18:\tsw\ta2,96(sp) */\n/* 1c:\tsw\ta3,100(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tlh\ta0,106(sp) */\n/* 28:\tmtc1\tv0,$f4 */\n/* 2c:\tlh\ta0,110(sp) */\n/* 30:\tjal\t0 */\n/* 34:\tcvt.s.w\t$f20,$f4 */\n/* 38:\tmtc1\tv0,$f6 */\n/* 3c:\tlh\ta0,114(sp) */\n/* 40:\tcvt.s.w\t$f8,$f6 */\n/* 44:\tjal\t0 */\n/* 48:\tswc1\t$f8,72(sp) */\n/* 4c:\tmtc1\tv0,$f10 */\n/* 50:\tlh\ta0,106(sp) */\n/* 54:\tcvt.s.w\t$f16,$f10 */\n/* 58:\tjal\t0 */\n/* 5c:\tswc1\t$f16,68(sp) */\n/* 60:\tmtc1\tv0,$f4 */\n/* 64:\tlh\ta0,110(sp) */\n/* 68:\tcvt.s.w\t$f12,$f4 */\n/* 6c:\tjal\t0 */\n/* 70:\tswc1\t$f12,64(sp) */\n/* 74:\tmtc1\tv0,$f6 */\n/* 78:\tlh\ta0,114(sp) */\n/* 7c:\tcvt.s.w\t$f14,$f6 */\n/* 80:\tjal\t0 */\n/* 84:\tswc1\t$f14,60(sp) */\n/* 88:\tmtc1\tv0,$f8 */\n/* 8c:\tlwc1\t$f14,60(sp) */\n/* 90:\tlwc1\t$f4,92(sp) */\n/* 94:\tcvt.s.w\t$f18,$f8 */\n/* 98:\tlui\tat,0x4780 */\n/* 9c:\tmtc1\tat,$f0 */\n/* a0:\tlwc1\t$f16,68(sp) */\n/* a4:\tlwc1\t$f12,64(sp) */\n/* a8:\tmul.s\t$f10,$f14,$f18 */\n/* ac:\tmul.s\t$f6,$f10,$f4 */\n/* b0:\tmul.s\t$f8,$f6,$f0 */\n/* b4:\tmul.s\t$f4,$f14,$f16 */\n/* b8:\ttrunc.w.s\t$f10,$f8 */\n/* bc:\tmfc1\tt9,$f10 */\n/* c0:\tnop */\n/* c4:\tsrl\tt8,t9,0x10 */\n/* c8:\tsh\tt8,0(s0) */\n/* cc:\tsh\tt9,32(s0) */\n/* d0:\tlwc1\t$f6,92(sp) */\n/* d4:\tmul.s\t$f8,$f4,$f6 */\n/* d8:\tmul.s\t$f10,$f8,$f0 */\n/* dc:\ttrunc.w.s\t$f4,$f10 */\n/* e0:\tmfc1\tt3,$f4 */\n/* e4:\tnop */\n/* e8:\tsrl\tt2,t3,0x10 */\n/* ec:\tsh\tt2,2(s0) */\n/* f0:\tsh\tt3,34(s0) */\n/* f4:\tlwc1\t$f6,72(sp) */\n/* f8:\tlwc1\t$f10,92(sp) */\n/* fc:\tneg.s\t$f8,$f6 */\n/* 100:\tmul.s\t$f4,$f8,$f10 */\n/* 104:\tmul.s\t$f6,$f4,$f0 */\n/* 108:\ttrunc.w.s\t$f8,$f6 */\n/* 10c:\tmfc1\tt7,$f8 */\n/* 110:\tnop */\n/* 114:\tsrl\tt6,t7,0x10 */\n/* 118:\tsh\tt6,4(s0) */\n/* 11c:\tsh\tt7,36(s0) */\n/* 120:\tlwc1\t$f10,72(sp) */\n/* 124:\tmul.s\t$f4,$f20,$f10 */\n/* 128:\tswc1\t$f4,44(sp) */\n/* 12c:\tlwc1\t$f6,44(sp) */\n/* 130:\tmul.s\t$f8,$f6,$f18 */\n/* 134:\tlwc1\t$f6,96(sp) */\n/* 138:\tmul.s\t$f10,$f12,$f16 */\n/* 13c:\tsub.s\t$f4,$f8,$f10 */\n/* 140:\tmul.s\t$f8,$f4,$f6 */\n/* 144:\tmul.s\t$f10,$f8,$f0 */\n/* 148:\ttrunc.w.s\t$f4,$f10 */\n/* 14c:\tmfc1\tt1,$f4 */\n/* 150:\tnop */\n/* 154:\tsrl\tt0,t1,0x10 */\n/* 158:\tsh\tt0,8(s0) */\n/* 15c:\tsh\tt1,40(s0) */\n/* 160:\tlwc1\t$f6,44(sp) */\n/* 164:\tmul.s\t$f8,$f6,$f16 */\n/* 168:\tlwc1\t$f6,96(sp) */\n/* 16c:\tmul.s\t$f10,$f12,$f18 */\n/* 170:\tadd.s\t$f4,$f8,$f10 */\n/* 174:\tmul.s\t$f8,$f4,$f6 */\n/* 178:\tmul.s\t$f10,$f8,$f0 */\n/* 17c:\tmul.s\t$f6,$f20,$f14 */\n/* 180:\ttrunc.w.s\t$f4,$f10 */\n/* 184:\tmfc1\tt5,$f4 */\n/* 188:\tnop */\n/* 18c:\tsrl\tt4,t5,0x10 */\n/* 190:\tsh\tt4,10(s0) */\n/* 194:\tsh\tt5,42(s0) */\n/* 198:\tlwc1\t$f8,96(sp) */\n/* 19c:\tmul.s\t$f10,$f6,$f8 */\n/* 1a0:\tmul.s\t$f4,$f10,$f0 */\n/* 1a4:\ttrunc.w.s\t$f6,$f4 */\n/* 1a8:\tmfc1\tt9,$f6 */\n/* 1ac:\tnop */\n/* 1b0:\tsrl\tt8,t9,0x10 */\n/* 1b4:\tsh\tt8,12(s0) */\n/* 1b8:\tsh\tt9,44(s0) */\n/* 1bc:\tlwc1\t$f8,72(sp) */\n/* 1c0:\tmul.s\t$f2,$f12,$f8 */\n/* 1c4:\tlwc1\t$f8,100(sp) */\n/* 1c8:\tmul.s\t$f10,$f2,$f18 */\n/* 1cc:\tmul.s\t$f4,$f20,$f16 */\n/* 1d0:\tadd.s\t$f6,$f10,$f4 */\n/* 1d4:\tmul.s\t$f10,$f6,$f8 */\n/* 1d8:\tmul.s\t$f4,$f10,$f0 */\n/* 1dc:\tmul.s\t$f8,$f2,$f16 */\n/* 1e0:\tmul.s\t$f10,$f20,$f18 */\n/* 1e4:\ttrunc.w.s\t$f6,$f4 */\n/* 1e8:\tsub.s\t$f4,$f8,$f10 */\n/* 1ec:\tmfc1\tt3,$f6 */\n/* 1f0:\tnop */\n/* 1f4:\tsrl\tt2,t3,0x10 */\n/* 1f8:\tsh\tt2,16(s0) */\n/* 1fc:\tsh\tt3,48(s0) */\n/* 200:\tlwc1\t$f6,100(sp) */\n/* 204:\tmul.s\t$f8,$f4,$f6 */\n/* 208:\tmul.s\t$f10,$f8,$f0 */\n/* 20c:\tmul.s\t$f6,$f12,$f14 */\n/* 210:\ttrunc.w.s\t$f4,$f10 */\n/* 214:\tmfc1\tt7,$f4 */\n/* 218:\tnop */\n/* 21c:\tsrl\tt6,t7,0x10 */\n/* 220:\tsh\tt6,18(s0) */\n/* 224:\tsh\tt7,50(s0) */\n/* 228:\tlwc1\t$f8,100(sp) */\n/* 22c:\tmul.s\t$f10,$f6,$f8 */\n/* 230:\tmul.s\t$f4,$f10,$f0 */\n/* 234:\ttrunc.w.s\t$f6,$f4 */\n/* 238:\tmfc1\tt1,$f6 */\n/* 23c:\tnop */\n/* 240:\tsrl\tt0,t1,0x10 */\n/* 244:\tsh\tt0,20(s0) */\n/* 248:\tsh\tt1,52(s0) */\n/* 24c:\tlwc1\t$f8,116(sp) */\n/* 250:\tmul.s\t$f10,$f8,$f0 */\n/* 254:\ttrunc.w.s\t$f4,$f10 */\n/* 258:\tmfc1\tt5,$f4 */\n/* 25c:\tnop */\n/* 260:\tsrl\tt4,t5,0x10 */\n/* 264:\tsh\tt4,24(s0) */\n/* 268:\tsh\tt5,56(s0) */\n/* 26c:\tlwc1\t$f6,120(sp) */\n/* 270:\tli\tt4,1 */\n/* 274:\tmul.s\t$f8,$f6,$f0 */\n/* 278:\ttrunc.w.s\t$f10,$f8 */\n/* 27c:\tmfc1\tt9,$f10 */\n/* 280:\tnop */\n/* 284:\tsrl\tt8,t9,0x10 */\n/* 288:\tsh\tt8,26(s0) */\n/* 28c:\tsh\tt9,58(s0) */\n/* 290:\tlwc1\t$f4,124(sp) */\n/* 294:\tsh\tzero,22(s0) */\n/* 298:\tlh\tv0,22(s0) */\n/* 29c:\tmul.s\t$f6,$f4,$f0 */\n/* 2a0:\tsh\tzero,38(s0) */\n/* 2a4:\tsh\tzero,46(s0) */\n/* 2a8:\tsh\tzero,54(s0) */\n/* 2ac:\tsh\tt4,30(s0) */\n/* 2b0:\tsh\tzero,62(s0) */\n/* 2b4:\tsh\tv0,14(s0) */\n/* 2b8:\ttrunc.w.s\t$f8,$f6 */\n/* 2bc:\tsh\tv0,6(s0) */\n/* 2c0:\tmfc1\tt3,$f8 */\n/* 2c4:\tnop */\n/* 2c8:\tsrl\tt2,t3,0x10 */\n/* 2cc:\tsh\tt2,28(s0) */\n/* 2d0:\tsh\tt3,60(s0) */\n/* 2d4:\tlw\tra,36(sp) */\n/* 2d8:\tlw\ts0,32(sp) */\n/* 2dc:\tldc1\t$f20,24(sp) */\n/* 2e0:\tjr\tra */\n/* 2e4:\taddiu\tsp,sp,88 */\n/* \t... */\nvoid suMtxMakeSRT(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'suMtxMakeSRT': function call 'jal' at 0x20 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":195,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'suMtxMakeSRT': function call 'jal' at 0x20 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 cos_s(s16, s16); /* extern */\ns32 sin_s(s16); /* extern */\n\nvoid suMtxMakeSRT(void *arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6, f32 arg7, f32 arg8, f32 arg9) {\n f32 sp48;\n f32 sp44;\n f32 sp40;\n f32 sp3C;\n f32 sp2C;\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f16;\n f32 temp_f18;\n f32 temp_f20;\n f32 temp_f2;\n f32 temp_f8;\n s16 temp_v0;\n s32 temp_f10;\n s32 temp_f10_2;\n s32 temp_f4;\n s32 temp_f4_2;\n s32 temp_f4_3;\n s32 temp_f4_4;\n s32 temp_f4_5;\n s32 temp_f6;\n s32 temp_f6_2;\n s32 temp_f6_3;\n s32 temp_f8_2;\n s32 temp_f8_3;\n\n temp_f20 = (f32) sin_s(arg4);\n temp_f8 = (f32) sin_s(arg5);\n sp48 = temp_f8;\n temp_f16 = (f32) sin_s(arg6);\n sp44 = temp_f16;\n temp_f12 = (f32) cos_s(arg4);\n sp40 = temp_f12;\n temp_f14 = (f32) cos_s((bitwise s16) temp_f12, arg5);\n sp3C = temp_f14;\n temp_f18 = (f32) cos_s(arg6);\n temp_f10 = (s32) (temp_f14 * temp_f18 * arg1 * 65536.0f);\n arg0->unk0 = (s16) ((u32) temp_f10 >> 0x10);\n arg0->unk20 = (s16) temp_f10;\n temp_f4 = (s32) (temp_f14 * temp_f16 * arg1 * 65536.0f);\n arg0->unk2 = (s16) ((u32) temp_f4 >> 0x10);\n arg0->unk22 = (s16) temp_f4;\n temp_f8_2 = (s32) (-sp48 * arg1 * 65536.0f);\n arg0->unk4 = (s16) ((u32) temp_f8_2 >> 0x10);\n arg0->unk24 = (s16) temp_f8_2;\n sp2C = temp_f20 * sp48;\n temp_f4_2 = (s32) (((sp2C * temp_f18) - (temp_f12 * temp_f16)) * arg2 * 65536.0f);\n arg0->unk8 = (s16) ((u32) temp_f4_2 >> 0x10);\n arg0->unk28 = (s16) temp_f4_2;\n temp_f4_3 = (s32) (((sp2C * temp_f16) + (temp_f12 * temp_f18)) * arg2 * 65536.0f);\n arg0->unkA = (s16) ((u32) temp_f4_3 >> 0x10);\n arg0->unk2A = (s16) temp_f4_3;\n temp_f6 = (s32) (temp_f20 * temp_f14 * arg2 * 65536.0f);\n arg0->unkC = (s16) ((u32) temp_f6 >> 0x10);\n arg0->unk2C = (s16) temp_f6;\n temp_f2 = temp_f12 * temp_f8;\n temp_f6_2 = (s32) (((temp_f2 * temp_f18) + (temp_f20 * temp_f16)) * arg3 * 65536.0f);\n arg0->unk10 = (s16) ((u32) temp_f6_2 >> 0x10);\n arg0->unk30 = (s16) temp_f6_2;\n temp_f4_4 = (s32) (((temp_f2 * temp_f16) - (temp_f20 * temp_f18)) * arg3 * 65536.0f);\n arg0->unk12 = (s16) ((u32) temp_f4_4 >> 0x10);\n arg0->unk32 = (s16) temp_f4_4;\n temp_f6_3 = (s32) (temp_f12 * temp_f14 * arg3 * 65536.0f);\n arg0->unk14 = (s16) ((u32) temp_f6_3 >> 0x10);\n arg0->unk34 = (s16) temp_f6_3;\n temp_f4_5 = (s32) (arg7 * 65536.0f);\n arg0->unk18 = (s16) ((u32) temp_f4_5 >> 0x10);\n arg0->unk38 = (s16) temp_f4_5;\n temp_f10_2 = (s32) (arg8 * 65536.0f);\n arg0->unk1A = (s16) ((u32) temp_f10_2 >> 0x10);\n arg0->unk3A = (s16) temp_f10_2;\n arg0->unk16 = 0;\n temp_v0 = arg0->unk16;\n arg0->unk26 = 0;\n arg0->unk2E = 0;\n arg0->unk36 = 0;\n arg0->unk1E = 1;\n arg0->unk3E = 0;\n arg0->unkE = temp_v0;\n temp_f8_3 = (s32) (arg9 * 65536.0f);\n arg0->unk6 = temp_v0;\n arg0->unk1C = (s16) ((u32) temp_f8_3 >> 0x10);\n arg0->unk3C = (s16) temp_f8_3;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":49,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `suMtxMakeSRT` — benchmark function af:suMtxMakeSRT:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel suMtxMakeSRT\n addiu\t$sp, $sp, -88\n sw\t$s0, 32($sp)\n move\t$s0, $a0\n sw\t$ra, 36($sp)\n sdc1\t$f20, 24($sp)\n sw\t$a1, 92($sp)\n sw\t$a2, 96($sp)\n sw\t$a3, 100($sp)\n jal\tsin_s\n lh\t$a0, 106($sp)\n mtc1\t$v0, $f4\n lh\t$a0, 110($sp)\n jal\tsin_s\n cvt.s.w\t$f20, $f4\n mtc1\t$v0, $f6\n lh\t$a0, 114($sp)\n cvt.s.w\t$f8, $f6\n jal\tsin_s\n swc1\t$f8, 72($sp)\n mtc1\t$v0, $f10\n lh\t$a0, 106($sp)\n cvt.s.w\t$f16, $f10\n jal\tcos_s\n swc1\t$f16, 68($sp)\n mtc1\t$v0, $f4\n lh\t$a0, 110($sp)\n cvt.s.w\t$f12, $f4\n jal\tcos_s\n swc1\t$f12, 64($sp)\n mtc1\t$v0, $f6\n lh\t$a0, 114($sp)\n cvt.s.w\t$f14, $f6\n jal\tcos_s\n swc1\t$f14, 60($sp)\n mtc1\t$v0, $f8\n lwc1\t$f14, 60($sp)\n lwc1\t$f4, 92($sp)\n cvt.s.w\t$f18, $f8\n lui\t$at, 0x4780\n mtc1\t$at, $f0\n lwc1\t$f16, 68($sp)\n lwc1\t$f12, 64($sp)\n mul.s\t$f10, $f14, $f18\n mul.s\t$f6, $f10, $f4\n mul.s\t$f8, $f6, $f0\n mul.s\t$f4, $f14, $f16\n trunc.w.s\t$f10, $f8\n mfc1\t$t9, $f10\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 0($s0)\n sh\t$t9, 32($s0)\n lwc1\t$f6, 92($sp)\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t3, $f4\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 2($s0)\n sh\t$t3, 34($s0)\n lwc1\t$f6, 72($sp)\n lwc1\t$f10, 92($sp)\n neg.s\t$f8, $f6\n mul.s\t$f4, $f8, $f10\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t7, $f8\n nop\n srl\t$t6, $t7, 0x10\n sh\t$t6, 4($s0)\n sh\t$t7, 36($s0)\n lwc1\t$f10, 72($sp)\n mul.s\t$f4, $f20, $f10\n swc1\t$f4, 44($sp)\n lwc1\t$f6, 44($sp)\n mul.s\t$f8, $f6, $f18\n lwc1\t$f6, 96($sp)\n mul.s\t$f10, $f12, $f16\n sub.s\t$f4, $f8, $f10\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t1, $f4\n nop\n srl\t$t0, $t1, 0x10\n sh\t$t0, 8($s0)\n sh\t$t1, 40($s0)\n lwc1\t$f6, 44($sp)\n mul.s\t$f8, $f6, $f16\n lwc1\t$f6, 96($sp)\n mul.s\t$f10, $f12, $f18\n add.s\t$f4, $f8, $f10\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n mul.s\t$f6, $f20, $f14\n trunc.w.s\t$f4, $f10\n mfc1\t$t5, $f4\n nop\n srl\t$t4, $t5, 0x10\n sh\t$t4, 10($s0)\n sh\t$t5, 42($s0)\n lwc1\t$f8, 96($sp)\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n trunc.w.s\t$f6, $f4\n mfc1\t$t9, $f6\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 12($s0)\n sh\t$t9, 44($s0)\n lwc1\t$f8, 72($sp)\n mul.s\t$f2, $f12, $f8\n lwc1\t$f8, 100($sp)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f4, $f20, $f16\n add.s\t$f6, $f10, $f4\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n mul.s\t$f8, $f2, $f16\n mul.s\t$f10, $f20, $f18\n trunc.w.s\t$f6, $f4\n sub.s\t$f4, $f8, $f10\n mfc1\t$t3, $f6\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 16($s0)\n sh\t$t3, 48($s0)\n lwc1\t$f6, 100($sp)\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n mul.s\t$f6, $f12, $f14\n trunc.w.s\t$f4, $f10\n mfc1\t$t7, $f4\n nop\n srl\t$t6, $t7, 0x10\n sh\t$t6, 18($s0)\n sh\t$t7, 50($s0)\n lwc1\t$f8, 100($sp)\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n trunc.w.s\t$f6, $f4\n mfc1\t$t1, $f6\n nop\n srl\t$t0, $t1, 0x10\n sh\t$t0, 20($s0)\n sh\t$t1, 52($s0)\n lwc1\t$f8, 116($sp)\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t5, $f4\n nop\n srl\t$t4, $t5, 0x10\n sh\t$t4, 24($s0)\n sh\t$t5, 56($s0)\n lwc1\t$f6, 120($sp)\n li\t$t4, 1\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t9, $f10\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 26($s0)\n sh\t$t9, 58($s0)\n lwc1\t$f4, 124($sp)\n sh\t$zero, 22($s0)\n lh\t$v0, 22($s0)\n mul.s\t$f6, $f4, $f0\n sh\t$zero, 38($s0)\n sh\t$zero, 46($s0)\n sh\t$zero, 54($s0)\n sh\t$t4, 30($s0)\n sh\t$zero, 62($s0)\n sh\t$v0, 14($s0)\n trunc.w.s\t$f8, $f6\n sh\t$v0, 6($s0)\n mfc1\t$t3, $f8\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 28($s0)\n sh\t$t3, 60($s0)\n lw\t$ra, 36($sp)\n lw\t$s0, 32($sp)\n ldc1\t$f20, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 88\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function suMtxMakeSRT # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `suMtxMakeSRT` — benchmark function af:suMtxMakeSRT:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:suMtxMakeSRT: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,-88\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,36(sp)\n 10:\tsdc1\t$f20,24(sp)\n 14:\tsw\ta1,92(sp)\n 18:\tsw\ta2,96(sp)\n 1c:\tsw\ta3,100(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,106(sp)\n 28:\tmtc1\tv0,$f4\n 2c:\tlh\ta0,110(sp)\n 30:\tjal\t0 \n 34:\tcvt.s.w\t$f20,$f4\n 38:\tmtc1\tv0,$f6\n 3c:\tlh\ta0,114(sp)\n 40:\tcvt.s.w\t$f8,$f6\n 44:\tjal\t0 \n 48:\tswc1\t$f8,72(sp)\n 4c:\tmtc1\tv0,$f10\n 50:\tlh\ta0,106(sp)\n 54:\tcvt.s.w\t$f16,$f10\n 58:\tjal\t0 \n 5c:\tswc1\t$f16,68(sp)\n 60:\tmtc1\tv0,$f4\n 64:\tlh\ta0,110(sp)\n 68:\tcvt.s.w\t$f12,$f4\n 6c:\tjal\t0 \n 70:\tswc1\t$f12,64(sp)\n 74:\tmtc1\tv0,$f6\n 78:\tlh\ta0,114(sp)\n 7c:\tcvt.s.w\t$f14,$f6\n 80:\tjal\t0 \n 84:\tswc1\t$f14,60(sp)\n 88:\tmtc1\tv0,$f8\n 8c:\tlwc1\t$f14,60(sp)\n 90:\tlwc1\t$f4,92(sp)\n 94:\tcvt.s.w\t$f18,$f8\n 98:\tlui\tat,0x4780\n 9c:\tmtc1\tat,$f0\n a0:\tlwc1\t$f16,68(sp)\n a4:\tlwc1\t$f12,64(sp)\n a8:\tmul.s\t$f10,$f14,$f18\n ac:\tmul.s\t$f6,$f10,$f4\n b0:\tmul.s\t$f8,$f6,$f0\n b4:\tmul.s\t$f4,$f14,$f16\n b8:\ttrunc.w.s\t$f10,$f8\n bc:\tmfc1\tt9,$f10\n c0:\tnop\n c4:\tsrl\tt8,t9,0x10\n c8:\tsh\tt8,0(s0)\n cc:\tsh\tt9,32(s0)\n d0:\tlwc1\t$f6,92(sp)\n d4:\tmul.s\t$f8,$f4,$f6\n d8:\tmul.s\t$f10,$f8,$f0\n dc:\ttrunc.w.s\t$f4,$f10\n e0:\tmfc1\tt3,$f4\n e4:\tnop\n e8:\tsrl\tt2,t3,0x10\n ec:\tsh\tt2,2(s0)\n f0:\tsh\tt3,34(s0)\n f4:\tlwc1\t$f6,72(sp)\n f8:\tlwc1\t$f10,92(sp)\n fc:\tneg.s\t$f8,$f6\n 100:\tmul.s\t$f4,$f8,$f10\n 104:\tmul.s\t$f6,$f4,$f0\n 108:\ttrunc.w.s\t$f8,$f6\n 10c:\tmfc1\tt7,$f8\n 110:\tnop\n 114:\tsrl\tt6,t7,0x10\n 118:\tsh\tt6,4(s0)\n 11c:\tsh\tt7,36(s0)\n 120:\tlwc1\t$f10,72(sp)\n 124:\tmul.s\t$f4,$f20,$f10\n 128:\tswc1\t$f4,44(sp)\n 12c:\tlwc1\t$f6,44(sp)\n 130:\tmul.s\t$f8,$f6,$f18\n 134:\tlwc1\t$f6,96(sp)\n 138:\tmul.s\t$f10,$f12,$f16\n 13c:\tsub.s\t$f4,$f8,$f10\n 140:\tmul.s\t$f8,$f4,$f6\n 144:\tmul.s\t$f10,$f8,$f0\n 148:\ttrunc.w.s\t$f4,$f10\n 14c:\tmfc1\tt1,$f4\n 150:\tnop\n 154:\tsrl\tt0,t1,0x10\n 158:\tsh\tt0,8(s0)\n 15c:\tsh\tt1,40(s0)\n 160:\tlwc1\t$f6,44(sp)\n 164:\tmul.s\t$f8,$f6,$f16\n 168:\tlwc1\t$f6,96(sp)\n 16c:\tmul.s\t$f10,$f12,$f18\n 170:\tadd.s\t$f4,$f8,$f10\n 174:\tmul.s\t$f8,$f4,$f6\n 178:\tmul.s\t$f10,$f8,$f0\n 17c:\tmul.s\t$f6,$f20,$f14\n 180:\ttrunc.w.s\t$f4,$f10\n 184:\tmfc1\tt5,$f4\n 188:\tnop\n 18c:\tsrl\tt4,t5,0x10\n 190:\tsh\tt4,10(s0)\n 194:\tsh\tt5,42(s0)\n 198:\tlwc1\t$f8,96(sp)\n 19c:\tmul.s\t$f10,$f6,$f8\n 1a0:\tmul.s\t$f4,$f10,$f0\n 1a4:\ttrunc.w.s\t$f6,$f4\n 1a8:\tmfc1\tt9,$f6\n 1ac:\tnop\n 1b0:\tsrl\tt8,t9,0x10\n 1b4:\tsh\tt8,12(s0)\n 1b8:\tsh\tt9,44(s0)\n 1bc:\tlwc1\t$f8,72(sp)\n 1c0:\tmul.s\t$f2,$f12,$f8\n 1c4:\tlwc1\t$f8,100(sp)\n 1c8:\tmul.s\t$f10,$f2,$f18\n 1cc:\tmul.s\t$f4,$f20,$f16\n 1d0:\tadd.s\t$f6,$f10,$f4\n 1d4:\tmul.s\t$f10,$f6,$f8\n 1d8:\tmul.s\t$f4,$f10,$f0\n 1dc:\tmul.s\t$f8,$f2,$f16\n 1e0:\tmul.s\t$f10,$f20,$f18\n 1e4:\ttrunc.w.s\t$f6,$f4\n 1e8:\tsub.s\t$f4,$f8,$f10\n 1ec:\tmfc1\tt3,$f6\n 1f0:\tnop\n 1f4:\tsrl\tt2,t3,0x10\n 1f8:\tsh\tt2,16(s0)\n 1fc:\tsh\tt3,48(s0)\n 200:\tlwc1\t$f6,100(sp)\n 204:\tmul.s\t$f8,$f4,$f6\n 208:\tmul.s\t$f10,$f8,$f0\n 20c:\tmul.s\t$f6,$f12,$f14\n 210:\ttrunc.w.s\t$f4,$f10\n 214:\tmfc1\tt7,$f4\n 218:\tnop\n 21c:\tsrl\tt6,t7,0x10\n 220:\tsh\tt6,18(s0)\n 224:\tsh\tt7,50(s0)\n 228:\tlwc1\t$f8,100(sp)\n 22c:\tmul.s\t$f10,$f6,$f8\n 230:\tmul.s\t$f4,$f10,$f0\n 234:\ttrunc.w.s\t$f6,$f4\n 238:\tmfc1\tt1,$f6\n 23c:\tnop\n 240:\tsrl\tt0,t1,0x10\n 244:\tsh\tt0,20(s0)\n 248:\tsh\tt1,52(s0)\n 24c:\tlwc1\t$f8,116(sp)\n 250:\tmul.s\t$f10,$f8,$f0\n 254:\ttrunc.w.s\t$f4,$f10\n 258:\tmfc1\tt5,$f4\n 25c:\tnop\n 260:\tsrl\tt4,t5,0x10\n 264:\tsh\tt4,24(s0)\n 268:\tsh\tt5,56(s0)\n 26c:\tlwc1\t$f6,120(sp)\n 270:\tli\tt4,1\n 274:\tmul.s\t$f8,$f6,$f0\n 278:\ttrunc.w.s\t$f10,$f8\n 27c:\tmfc1\tt9,$f10\n 280:\tnop\n 284:\tsrl\tt8,t9,0x10\n 288:\tsh\tt8,26(s0)\n 28c:\tsh\tt9,58(s0)\n 290:\tlwc1\t$f4,124(sp)\n 294:\tsh\tzero,22(s0)\n 298:\tlh\tv0,22(s0)\n 29c:\tmul.s\t$f6,$f4,$f0\n 2a0:\tsh\tzero,38(s0)\n 2a4:\tsh\tzero,46(s0)\n 2a8:\tsh\tzero,54(s0)\n 2ac:\tsh\tt4,30(s0)\n 2b0:\tsh\tzero,62(s0)\n 2b4:\tsh\tv0,14(s0)\n 2b8:\ttrunc.w.s\t$f8,$f6\n 2bc:\tsh\tv0,6(s0)\n 2c0:\tmfc1\tt3,$f8\n 2c4:\tnop\n 2c8:\tsrl\tt2,t3,0x10\n 2cc:\tsh\tt2,28(s0)\n 2d0:\tsh\tt3,60(s0)\n 2d4:\tlw\tra,36(sp)\n 2d8:\tlw\ts0,32(sp)\n 2dc:\tldc1\t$f20,24(sp)\n 2e0:\tjr\tra\n 2e4:\taddiu\tsp,sp,88\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000002f0 .text\n00000000 g F .text\t000002e8 suMtxMakeSRT\n00000000 F *UND*\t00000000 sin_s\n00000000 F *UND*\t00000000 cos_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 sin_s\n00000030 R_MIPS_26 sin_s\n00000044 R_MIPS_26 sin_s\n00000058 R_MIPS_26 cos_s\n0000006c R_MIPS_26 cos_s\n00000080 R_MIPS_26 cos_s\n\n\nContents of section .text:\n 0000 27bdffa8 afb00020 00808025 afbf0024 '...... ...%...$\n 0010 f7b40018 afa5005c afa60060 afa70064 .......\\...`...d\n 0020 0c000000 87a4006a 44822000 87a4006e .......jD. ....n\n 0030 0c000000 46802520 44823000 87a40072 ....F.% D.0....r\n 0040 46803220 0c000000 e7a80048 44825000 F.2 .......HD.P.\n 0050 87a4006a 46805420 0c000000 e7b00044 ...jF.T .......D\n 0060 44822000 87a4006e 46802320 0c000000 D. ....nF.# ....\n 0070 e7ac0040 44823000 87a40072 468033a0 ...@D.0....rF.3.\n 0080 0c000000 e7ae003c 44824000 c7ae003c ...........F.2.....\n 02c0 440b4000 00000000 000b5402 a60a001c D.@.......T.....\n 02d0 a60b003c 8fbf0024 8fb00020 d7b40018 ...<...$... ....\n 02e0 03e00008 27bd0058 00000000 00000000 ....'..X........\nContents of section .options:\n 0000 01200000 00000000 a301fff6 00000000 . ..............\n 0010 003ffffd 00000000 00000000 00007ff0 .?..............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a301fff6 00000000 003ffffd 00000000 .........?......\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000ba 00000048 000004c8 p..........H....\n 0010 00000007 00000684 00000001 00000510 ................\n 0020 00000004 00000544 00000000 00000000 .......D........\n 0030 00000011 00000574 00000038 000005b8 .......t...8....\n 0040 0000001c 000005f0 00000001 0000060c ................\n 0050 00000000 00000000 00000003 00000654 ...............T\n 0060 076211f0 1010f010 f01010f0 1210f012 .b..............\n 0070 10f01320 e42230d4 10271028 00102805 ... .\"0..'.(..(.\n 0080 102630d4 10271027 31d030d3 102230d4 .&0..'.'1.0..\"0.\n 0090 10271026 10207095 102021e0 321010d0 .'.&. p.. !.2...\n 00a0 e020e310 54000000 00000000 00000001 . ..T...........\n 00b0 00000000 80010000 ffffffcc ffffffff ................\n 00c0 00300000 ffffffc0 00000058 001d001f .0.........X....\n 00d0 0000001c 00000050 00000000 00000001 .......P........\n 00e0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00f0 1820000f 0000002a 000002e8 20200001 . .....*.... ..\n 0100 00000001 00000000 20200000 02000000 ........ ......\n 0110 03000000 04000000 05000000 06000000 ................\n 0120 07000000 08000000 09000000 20000000 ............ ...\n 0130 21000000 0a000000 0b000000 0b000000 !...............\n 0140 1a000000 00000000 00000003 06000000 ................\n 0150 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0160 2d69646f 2d323332 39393131 62336262 -ido-2329911b3bb\n 0170 35316331 342f752e 69007375 4d74784d 51c14/u.i.suMtxM\n 0180 616b6553 52540000 73754d74 784d616b akeSRT..suMtxMak\n 0190 65535254 0073696e 5f730063 6f735f73 eSRT.sin_s.cos_s\n 01a0 00000000 00000000 00000001 00000000 ................\n 01b0 00000037 00000000 00000004 00000000 ...7............\n 01c0 000000ba 00000000 00000000 00000001 ................\n 01d0 00000000 00000011 00000000 00000000 ................\n 01e0 01800000 00000000 00000045 00000000 ...........E....\n 01f0 00000000 00000000 18200001 00000000 ......... ......\n 0200 0000000d 00000000 18cfffff 00000000 ................\n 0210 00000013 00000000 18cfffff 00000000 ................\n 0220 00000000 00000000 00000000 00000000 ................\n 0230 00000000 7fffffff 00000000 7fffffff ................\n 0240 00000001 7fffffff 00000002 00000000 ................\n 0250 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"suMtxMakeSRT\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 suMtxMakeSRT # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 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","cfe: Error: /c.i, line 14: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ValueSet__s_xyz\n lhu\t$t6, 0($a1)\n lh\t$v1, 2($a1)\n andi\t$t7, $t6, 0x7ff\n addu\t$v0, $t7, $a0\n sh\t$v1, 4($v0)\n sh\t$v1, 2($v0)\n jr\t$ra\n sh\t$v1, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ValueSet__s_xyz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_add:ido7.1","sym":"xyz_t_add","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_add(xyz_t* augend, xyz_t* addend, xyz_t* total) {\n total->x = augend->x + addend->x;\n total->y = augend->y + addend->y;\n total->z = augend->z + addend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_add' — lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tadd.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tadd.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_add(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_add(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 + arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 + arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 + arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_add\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n add.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n add.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_mult_v:ido7.1","sym":"xyz_t_mult_v","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float"],"loc":5,"refSource":"void xyz_t_mult_v(xyz_t* multiplicand, f32 multiplier) {\n multiplicand->x *= multiplier;\n multiplicand->y *= multiplier;\n multiplicand->z *= multiplier;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_mult_v' — lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f4,0(a0) */\n/* 8:\tlwc1\t$f8,4(a0) */\n/* c:\tlwc1\t$f16,8(a0) */\n/* 10:\tmul.s\t$f6,$f4,$f12 */\n/* 14:\tmul.s\t$f10,$f8,$f12 */\n/* 18:\tmul.s\t$f18,$f16,$f12 */\n/* 1c:\tswc1\t$f6,0(a0) */\n/* 20:\tswc1\t$f10,4(a0) */\n/* 24:\tjr\tra */\n/* 28:\tswc1\t$f18,8(a0) */\n/* 2c:\tnop */\nvoid xyz_t_mult_v(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_mult_v(void *arg0, f32 arg1) {\n arg0->unk0 = (f32) (arg0->unk0 * arg1);\n arg0->unk4 = (f32) (arg0->unk4 * arg1);\n arg0->unk8 = (f32) (arg0->unk8 * arg1);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_mult_v\n mtc1\t$a1, $f12\n lwc1\t$f4, 0($a0)\n lwc1\t$f8, 4($a0)\n lwc1\t$f16, 8($a0)\n mul.s\t$f6, $f4, $f12\n mul.s\t$f10, $f8, $f12\n mul.s\t$f18, $f16, $f12\n swc1\t$f6, 0($a0)\n swc1\t$f10, 4($a0)\n jr\t$ra\n swc1\t$f18, 8($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_mult_v # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub_ss:ido7.1","sym":"xyz_t_sub_ss","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_sub_ss(xyz_t* dest, s_xyz* minuend, s_xyz* subtrahend) {\n dest->x = minuend->x - subtrahend->x;\n dest->y = minuend->y - subtrahend->y;\n dest->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub_ss' — lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlh\tt6,0(a1) */\n/* 4:\tlh\tt7,0(a2) */\n/* 8:\tsubu\tt8,t6,t7 */\n/* c:\tmtc1\tt8,$f4 */\n/* 10:\tnop */\n/* 14:\tcvt.s.w\t$f6,$f4 */\n/* 18:\tswc1\t$f6,0(a0) */\n/* 1c:\tlh\tt0,2(a2) */\n/* 20:\tlh\tt9,2(a1) */\n/* 24:\tsubu\tt1,t9,t0 */\n/* 28:\tmtc1\tt1,$f8 */\n/* 2c:\tnop */\n/* 30:\tcvt.s.w\t$f10,$f8 */\n/* 34:\tswc1\t$f10,4(a0) */\n/* 38:\tlh\tt3,4(a2) */\n/* 3c:\tlh\tt2,4(a1) */\n/* 40:\tsubu\tt4,t2,t3 */\n/* 44:\tmtc1\tt4,$f16 */\n/* 48:\tnop */\n/* 4c:\tcvt.s.w\t$f18,$f16 */\n/* 50:\tjr\tra */\n/* 54:\tswc1\t$f18,8(a0) */\n/* \t... */\nvoid xyz_t_sub_ss(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub_ss(void *arg0, void *arg1, void *arg2) {\n arg0->unk0 = (f32) (arg1->unk0 - arg2->unk0);\n arg0->unk4 = (f32) (arg1->unk2 - arg2->unk2);\n arg0->unk8 = (f32) (arg1->unk4 - arg2->unk4);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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","cfe: Error: /c.i, line 8: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub_ss\n lh\t$t6, 0($a1)\n lh\t$t7, 0($a2)\n subu\t$t8, $t6, $t7\n mtc1\t$t8, $f4\n nop\n cvt.s.w\t$f6, $f4\n swc1\t$f6, 0($a0)\n lh\t$t0, 2($a2)\n lh\t$t9, 2($a1)\n subu\t$t1, $t9, $t0\n mtc1\t$t1, $f8\n nop\n cvt.s.w\t$f10, $f8\n swc1\t$f10, 4($a0)\n lh\t$t3, 4($a2)\n lh\t$t2, 4($a1)\n subu\t$t4, $t2, $t3\n mtc1\t$t4, $f16\n nop\n cvt.s.w\t$f18, $f16\n jr\t$ra\n swc1\t$f18, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub_ss # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub:ido7.1","sym":"xyz_t_sub","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","float"],"loc":5,"refSource":"void xyz_t_sub(xyz_t* minuend, xyz_t* subtrahend, xyz_t* diff) {\n diff->x = minuend->x - subtrahend->x;\n diff->y = minuend->y - subtrahend->y;\n diff->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","proto":{"xyz_t_sub":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub' — lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tsub.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tsub.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tsub.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_sub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 - arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 - arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 - arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n sub.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n sub.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n sub.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckTileCollisionVertical:agbcc","sym":"CheckTileCollisionVertical","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","branch","pointer","memory","goto","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","loop","nested-loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ConfigureEntityBehavior:agbcc","sym":"ConfigureEntityBehavior","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["table","pointer","global","switch","loop","mmio","dma","jump-table"],"loc":94,"refSource":"void ConfigureEntityBehavior(u8 arg0, u8 arg1, u8 arg2) {\n void *var_r3;\n void *var_r5;\n void *var_r6;\n u32 var_sb;\n u8 var_r1;\n\n if (arg2 != 0) {\n gEntityInfo[0x23].unkF = 0x19;\n gEntityInfo[0x22].unkF = 0x19;\n gEntityInfo[0x21].unkF = 0x19;\n gEntityInfo[0x20].unkF = 0x19;\n }\n\n switch (arg1) {\n case 0:\n var_sb = 0xD;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 1:\n var_sb = 4;\n var_r6 = &gUnk_03003F56[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x24)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 2:\n var_sb = 6;\n var_r6 = &gUnk_03003E96[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x21)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 3:\n var_sb = 6;\n var_r6 = &gUnk_03003DD6[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1E)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 4:\n var_sb = 6;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0xD);\n break;\n\n case 5:\n var_sb = 6;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x16);\n break;\n\n case 6:\n var_sb = 4;\n var_r6 = &gUnk_03003F56[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x24)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 7:\n var_sb = 7;\n var_r6 = &gUnk_03003E96[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x21)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 8:\n var_sb = 0xA;\n var_r6 = &gUnk_03003DD6[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1E)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 9:\n var_sb = 0xD;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n }\n\n for (var_r1 = 0; var_r1 < var_sb; var_r1++) {\n DmaCopy16Wait(3, var_r3, var_r6, 0x8);\n DmaCopy16Wait(3, var_r3, var_r5, 0x8);\n var_r6 += 0x40;\n var_r5 += gBgInfo[2].hLength;\n var_r3 += gBgInfo[2].hLength;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L4121-L4214","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\n\n.text\n\t.align\t2, 0\n","proto":{"ConfigureEntityBehavior":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ConfigureEntityBehavior' — lift: cannot lift 'ConfigureEntityBehavior': 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\tConfigureEntityBehavior */\n/* \t.type\t ConfigureEntityBehavior,function */\n/* \t.thumb_func */\n/* ConfigureEntityBehavior: */\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\tr4, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr1, r1, #0x18 */\n/* \tmov\tr8, r1 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldr\tr1, .L35 */\n/* \tldr\tr2, .L35+0x4 */\n/* \tadd\tr0, r1, r2 */\n/* \tmov\tr2, #0x19 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr7, .L35+0x8 */\n/* \tadd\tr0, r1, r7 */\n/* \tstrb\tr2, [r0] */\n/* \tsub\tr7, r7, #0x1c */\n/* \tadd\tr0, r1, r7 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr0, .L35+0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tstrb\tr2, [r1] */\n/* .L4: */\n/* \tmov\tr1, r8 */\n/* \tcmp\tr1, #0x9 */\n/* \tbls\t.LCB42 */\n/* \tb\t.L5\t@long jump */\n/* .LCB42: */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L35+0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgEntityInfo */\n/* \t.word\t0x3e3 */\n/* \t.word\t0x3c7 */\n/* \t.word\t0x38f */\n/* \t.word\t.L16 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L16: */\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/* \t.word\t.L12 */\n/* \t.word\t.L13 */\n/* \t.word\t.L14 */\n/* \t.word\t.L15 */\n/* .L6: */\n/* \tmov\tr2, #0xd */\n/* \tmov\tr9, r2 */\n/* \tb\t.L31 */\n/* .L7: */\n/* \tmov\tr7, #0x4 */\n/* \tmov\tr9, r7 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L37 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L37+0x4 */\n/* \tldr\tr0, .L37+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgUnk_03003F56 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L8: */\n/* \tmov\tr0, #0x6 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L39 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L39+0x4 */\n/* \tldr\tr0, .L39+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x5 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03003E96 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L9: */\n/* \tmov\tr1, #0x6 */\n/* \tmov\tr9, r1 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L41 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L41+0x4 */\n/* \tldr\tr0, .L41+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x4 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgUnk_03003DD6 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L10: */\n/* \tmov\tr2, #0x6 */\n/* \tmov\tr9, r2 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L43 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L43+0x4 */\n/* \tldr\tr0, .L43+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tmov\tr0, #0xd */\n/* \tb\t.L33 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L11: */\n/* \tmov\tr7, #0x6 */\n/* \tmov\tr9, r7 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L45 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L45+0x4 */\n/* \tldr\tr0, .L45+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tmov\tr0, #0x16 */\n/* .L33: */\n/* \tmul\tr0, r0, r1 */\n/* .L32: */\n/* \tadd\tr0, r0, #0x3c */\n/* \tadd\tr3, r3, r0 */\n/* \tb\t.L5 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L12: */\n/* \tmov\tr0, #0x4 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L47 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tb\t.L34 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03003F56 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L13: */\n/* \tmov\tr1, #0x7 */\n/* \tmov\tr9, r1 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L49 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L49+0x4 */\n/* \tldr\tr0, .L49+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x5 */\n/* \tadd\tr0, r0, r1 */\n/* \tb\t.L34 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03003E96 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L14: */\n/* \tmov\tr2, #0xa */\n/* \tmov\tr9, r2 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L51 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L51+0x4 */\n/* \tldr\tr0, .L51+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x4 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tb\t.L34 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgUnk_03003DD6 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L15: */\n/* \tmov\tr7, #0xd */\n/* \tmov\tr9, r7 */\n/* .L31: */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L53 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L53+0x4 */\n/* \tldr\tr0, .L53+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* .L34: */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr0, [r3, #0x14] */\n/* \tadd\tr5, r0, r2 */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x3c */\n/* .L5: */\n/* \tmov\tr1, #0x0 */\n/* \tcmp\tr1, r9 */\n/* \tbcs\t.L19\t@cond_branch */\n/* \tldr\tr4, .L53+0xc */\n/* \tldr\tr0, .L53+0x10 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tmov\tip, r2 */\n/* \tldr\tr7, .L53+0x14 */\n/* \tmov\tsl, r7 */\n/* .L21: */\n/* \tstr\tr3, [r4] */\n/* \tstr\tr6, [r4, #0x4] */\n/* \tmov\tr0, r8 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tmov\tr2, ip */\n/* \tand\tr0, r0, r2 */\n/* \tadd\tr6, r6, #0x40 */\n/* \tadd\tr7, r1, #0x1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x18 */\n/* .L22: */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L22\t@cond_branch */\n/* .L23: */\n/* \tldr\tr1, .L53+0xc */\n/* \tstr\tr3, [r1] */\n/* \tstr\tr5, [r1, #0x4] */\n/* \tmov\tr0, r8 */\n/* \tstr\tr0, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tmov\tr2, ip */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x18 */\n/* .L26: */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L26\t@cond_branch */\n/* .L27: */\n/* \tmov\tr1, sl */\n/* \tldrh\tr0, [r1] */\n/* \tadd\tr5, r5, r0 */\n/* \tadd\tr3, r3, r0 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tcmp\tr1, r9 */\n/* \tbcc\t.L21\t@cond_branch */\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{r0} */\n/* \tbx\tr0 */\n/* .L54: */\n/* \t.align\t2, 0 */\n/* .L53: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* \t.word\t0x40000d4 */\n/* \t.word\t-0x7ffffffc */\n/* \t.word\tgBgInfo+0x48 */\n/* .Lfe1: */\n/* \t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ConfigureEntityBehavior(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ConfigureEntityBehavior': 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":379,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ConfigureEntityBehavior': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? gBgDataPtrs;\nextern ? gBgInfo;\nextern ? gEntityInfo;\nextern ? gUnk_03003D16;\nextern ? gUnk_03003DD6;\nextern ? gUnk_03003E96;\nextern ? gUnk_03003F56;\n\nvoid ConfigureEntityBehavior(u8 arg0, u8 arg1, s32 arg2, s32 arg3) {\n s32 temp_r2;\n s32 temp_r2_2;\n s32 temp_r2_3;\n s32 temp_r2_4;\n s32 temp_r2_5;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_3;\n s32 var_r2;\n s32 var_r3;\n u8 temp_r1;\n u8 temp_r4;\n u8 var_r1;\n void *var_r5;\n void *var_r6;\n void *var_r9;\n\n var_r9 = saved_reg_r9;\n var_r3 = arg3;\n var_r6 = saved_reg_r9;\n var_r5 = saved_reg_r8;\n temp_r4 = arg0;\n temp_r1 = arg1;\n if ((arg2 << 0x18) != 0) {\n gEntityInfo.unk3E3 = 0x19;\n gEntityInfo.unk3C7 = 0x19;\n gEntityInfo.unk3AB = 0x19;\n gEntityInfo.unk38F = 0x19;\n }\n switch ((u32) temp_r1) { /* irregular */\n case 0:\n var_r9 = (void *)0xD;\nblock_17:\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003D16;\n var_r0 = gBgInfo.unk48 * 0x1B;\nblock_18:\n var_r5 = gBgDataPtrs.unk14 + (var_r2 + (var_r0 + 6));\n var_r3 = gBgDataPtrs.unk14 + 0x3C;\n break;\n case 1:\n var_r9 = (void *)4;\n temp_r2 = temp_r4 * 8;\n var_r6 = temp_r2 + &gUnk_03003F56;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2 + ((gBgInfo.unk48 * 0x24) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\nblock_12:\n var_r3 = gBgDataPtrs.unk14 + (var_r0_2 + 0x3C);\n break;\n case 2:\n var_r9 = (void *)6;\n temp_r2_2 = temp_r4 * 8;\n var_r6 = temp_r2_2 + &gUnk_03003E96;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_2 + ((gBgInfo.unk48 * 0x21) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\n goto block_12;\n case 3:\n var_r9 = (void *)6;\n temp_r2_3 = temp_r4 * 8;\n var_r6 = temp_r2_3 + &gUnk_03003DD6;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_3 + ((gBgInfo.unk48 * 0x1E) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\n goto block_12;\n case 4:\n var_r9 = (void *)6;\n temp_r2_4 = temp_r4 * 8;\n var_r6 = temp_r2_4 + &gUnk_03003D16;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_4 + ((gBgInfo.unk48 * 0x1B) + 6));\n var_r0_3 = 0xD;\nblock_11:\n var_r0_2 = var_r0_3 * gBgInfo.unk48;\n goto block_12;\n case 5:\n var_r9 = (void *)6;\n temp_r2_5 = temp_r4 * 8;\n var_r6 = temp_r2_5 + &gUnk_03003D16;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_5 + ((gBgInfo.unk48 * 0x1B) + 6));\n var_r0_3 = 0x16;\n goto block_11;\n case 6:\n var_r9 = (void *)4;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003F56;\n var_r0 = gBgInfo.unk48 * 0x24;\n goto block_18;\n case 7:\n var_r9 = (void *)7;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003E96;\n var_r0 = gBgInfo.unk48 * 0x21;\n goto block_18;\n case 8:\n var_r9 = (void *)0xA;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003DD6;\n var_r0 = gBgInfo.unk48 * 0x1E;\n goto block_18;\n case 9:\n var_r9 = (void *)0xD;\n goto block_17;\n }\n var_r1 = 0;\n if ((u32) var_r9 > 0U) {\n do {\n (void *)0x040000D4->unk0 = var_r3;\n (void *)0x040000D4->unk4 = var_r6;\n (void *)0x040000D4->unk8 = 0x80000004;\n var_r6 += 0x40;\n if ((void *)0x040000D4->unk8 & 0x80000000) {\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n }\n (void *)0x040000D4->unk0 = var_r3;\n (void *)0x040000D4->unk4 = var_r5;\n (void *)0x040000D4->unk8 = 0x80000004;\n if ((void *)0x040000D4->unk8 & 0x80000000) {\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n }\n var_r5 += gBgInfo.unk48;\n var_r3 += gBgInfo.unk48;\n var_r1 += 1;\n } while ((u32) var_r1 < (u32) var_r9);\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":132,"gotos":8,"casts":24,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ConfigureEntityBehavior` — benchmark function kleod:ConfigureEntityBehavior:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ConfigureEntityBehavior # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ConfigureEntityBehavior` — benchmark function kleod:ConfigureEntityBehavior:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ConfigureEntityBehavior:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\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 \"ConfigureEntityBehavior\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ConfigureEntityBehavior # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","branch","loop","shift","strength-reduce"],"loc":16,"refSource":"void CopyBGScrollTiles(void) {\n u32 var_r5;\n u32 var_r6;\n\n for (var_r6 = 0; var_r6 < 3; var_r6++) {\n if (var_r6 < gUnk_03005220.hearts) {\n var_r5 = 0;\n } else {\n var_r5 = 2;\n }\n gBgTilemapBufs[0][(var_r6 * 2) + 0x241] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x242] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x261] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x15) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x262] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x15) << 5)];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1165-L1180","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-CztkBl/c.c:1077: invalid operands to binary <<"},{"label":"unsigned/scopebase/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-9kTYnQ/c.c:1078: invalid operands to binary <<"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"nonmatch","source":"void CopyBGScrollTiles(void) {\n u32 v0;\n s32 v1;\n v0 = 0;\n do {\n if (v0 >= gUnk_03005220.hearts) {\n v1 = 2;\n } else {\n v1 = 0;\n }\n gBgTilemapBufs[0][(v0 << 1) + 577] = gBgTilemapBufs[0][(v0 << 1) + (v1 + 20 << 5)];\n gBgTilemapBufs[0][(v0 << 1) + 578] = gBgTilemapBufs[0][(v0 << 1) + ((v1 + 20 << 5) + 1)];\n gBgTilemapBufs[0][(v0 << 1) + 609] = gBgTilemapBufs[0][(v0 << 1) + (v1 + 21 << 5)];\n gBgTilemapBufs[0][(v0 << 1) + 610] = gBgTilemapBufs[0][(v0 << 1) + ((v1 + 21 << 5) + 1)];\n v0 = v0 + 1;\n } while (v0 <= 2);\n return;\n}\n","score":30,"maxScore":72,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":3,"opMismatch":1,"argMismatch":20},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void CopyBGScrollTiles(void) {\n s32 temp_r1;\n s32 temp_r2;\n s32 temp_r3;\n s32 var_r5;\n u32 var_r6;\n\n var_r6 = 0;\n do {\n var_r5 = 2;\n if (var_r6 < (u32) ((u32) (gUnk_03005220 << 0x1E) >> 0x1E)) {\n var_r5 = 0;\n }\n temp_r3 = var_r6 * 2;\n temp_r1 = (var_r5 + 0x14) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x241] = (*gBgTilemapBufs)[temp_r3 + temp_r1];\n (*gBgTilemapBufs)[temp_r3 + 0x242] = (*gBgTilemapBufs)[temp_r3 + (temp_r1 + 1)];\n temp_r2 = (var_r5 + 0x15) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x261] = (*gBgTilemapBufs)[temp_r3 + temp_r2];\n (*gBgTilemapBufs)[temp_r3 + 0x262] = (*gBgTilemapBufs)[temp_r3 + (temp_r2 + 1)];\n var_r6 += 1;\n } while (var_r6 <= 2U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":22,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1082: invalid operands to binary <<"]},"gapSize":{"decompiler":"asmlift","score":30,"maxScore":72,"ratio":0.4166666666666667,"kinds":{"insert":4,"delete":2,"replace":3,"opMismatch":1,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:CountCollectedGems:agbcc","sym":"CountCollectedGems","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","loop","nested-loop","bitwise"],"loc":85,"refSource":"void CountCollectedGems(void) {\n u8 sp0;\n u8 var_ip;\n u8 var_r0;\n u8 var_r3;\n u8 var_r6;\n u8 var_r8;\n\n if ((gUnk_03004670->unk8[5][7] & 0x80) != 0) {\n var_ip = 0;\n var_r8 = 0;\n var_r6 = 0;\n sp0 = 0;\n for (var_r0 = 0; var_r0 < 5; var_r0++) {\n for (var_r3 = 0; var_r3 < 7; var_r3++) {\n if ((var_r3 == 3 || var_r3 == 5) && (gUnk_03004670->unk8[var_r0][var_r3] & 0x7F) == 0x64) {\n var_ip += 1;\n } else if ((var_r3 != 7) && ((gUnk_03004670->unk8[var_r0][var_r3] & 0x7F) == 0x1E)) {\n var_r8 += 1;\n }\n if (gUnk_03004670->unk8[var_r0][var_r3] & 0x80) {\n var_r6 += 1;\n }\n }\n }\n\n if ((gUnk_03004670->unk8[5][0] & 0x7F) == 0x1E) {\n sp0 += 1;\n }\n if ((gUnk_03004670->unk8[5][1] & 0x7F) == 0x1E) {\n sp0 += 1;\n }\n\n if (((gUnk_03004670->unk8[5][0] & 0x7F) == 0x7F) && (var_r6 == 0x23)) {\n gUnk_03004C08.unk0_0 = 4;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][0] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[5][1] & 0x7F) == 0x7F) && ((var_r8 + var_ip) > 0x18)) {\n gUnk_03004C08.unk0_0 = 5;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][1] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[5][2] & 0x7F) == 0x7F) && ((sp0 + var_ip + var_r8) == 0x25)) {\n gUnk_03004C08.unk0_0 = 6;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][2] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else {\n // gCallbackQueue.current[1] = GameplayMainLoop;\n }\n } else {\n if (((gUnk_03004670->unk8[0][7] & 0x80) != 0) && ((gUnk_03004670->unk8[1][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 0;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[1][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[1][7] & 0x80) != 0) && ((gUnk_03004670->unk8[2][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 1;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[2][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[2][7] & 0x80) != 0) && ((gUnk_03004670->unk8[3][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 2;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[3][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[3][7] & 0x80) != 0) && ((gUnk_03004670->unk8[4][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 3;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[4][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else {\n // gCallbackQueue.current[1] = GameplayMainLoop;\n }\n }\n gCallbackQueue.current[1] = GameplayMainLoop;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1891-L1975","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-8f3949f8ca4f.i.gz","proto":{"CountCollectedGems":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CountCollectedGems' — lift: cannot lift 'CountCollectedGems': 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\tCountCollectedGems */\n/* \t.type\t CountCollectedGems,function */\n/* \t.thumb_func */\n/* CountCollectedGems: */\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/* \tldr\tr2, .L39 */\n/* \tldr\tr3, [r2] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x37 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tmov\tsl, r2 */\n/* \tcmp\tr5, #0 */\n/* \tbne\t.LCB19 */\n/* \tb\t.L4\t@long jump */\n/* .LCB19: */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tip, r0 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tr1, #0x0 */\n/* \tstr\tr1, [sp] */\n/* \tmov\tr4, sl */\n/* \tmov\tr1, #0x7f */\n/* \tmov\tr9, r1 */\n/* .L8: */\n/* \tmov\tr3, #0x0 */\n/* \tadd\tr5, r0, #0x1 */\n/* \tlsl\tr2, r0, #0x3 */\n/* .L12: */\n/* \tcmp\tr3, #0x3 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tcmp\tr3, #0x5 */\n/* \tbne\t.L13\t@cond_branch */\n/* .L14: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, r9 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x64 */\n/* \tbne\t.L13\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/* \tb\t.L15 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03004670 */\n/* .L13: */\n/* \tcmp\tr3, #0x7 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, r9 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\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/* .L15: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr7, #0x80 */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L11\t@cond_branch */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L11: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, #0x6 */\n/* \tbls\t.L12\t@cond_branch */\n/* \tlsl\tr0, r5, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x4 */\n/* \tbls\t.L8\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tldr\tr1, [r0] */\n/* \tadd\tr5, r1, #0 */\n/* \tadd\tr5, r5, #0x30 */\n/* \tldrb\tr0, [r5] */\n/* \tmov\tr4, #0x7f */\n/* \tadd\tr3, r4, #0 */\n/* \tand\tr3, r3, r0 */\n/* \tcmp\tr3, #0x1e */\n/* \tbne\t.L20\t@cond_branch */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp] */\n/* .L20: */\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.L21\t@cond_branch */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp] */\n/* .L21: */\n/* \tcmp\tr3, #0x7f */\n/* \tbne\t.L22\t@cond_branch */\n/* \tcmp\tr6, #0x23 */\n/* \tbne\t.L22\t@cond_branch */\n/* \tldr\tr2, .L41 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x4 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tstrb\tr7, [r5] */\n/* \tldr\tr0, .L41+0x4 */\n/* \tb\t.L37 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L22: */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x31 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L24\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, ip */\n/* \tcmp\tr0, #0x18 */\n/* \tble\t.L24\t@cond_branch */\n/* \tldr\tr2, .L43 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x5 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tmov\tr0, #0x80 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L43+0x4 */\n/* \tb\t.L37 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L24: */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x32 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.LCB249 */\n/* \tb\t.L28\t@long jump */\n/* .LCB249: */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tcmp\tr0, #0x25 */\n/* \tbeq\t.LCB254 */\n/* \tb\t.L28\t@long jump */\n/* .LCB254: */\n/* \tldr\tr2, .L45 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x6 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tmov\tr0, #0x80 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L45+0x4 */\n/* \tb\t.L37 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L4: */\n/* \tldrb\tr1, [r3, #0xf] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L29\t@cond_branch */\n/* \tldrb\tr1, [r3, #0x10] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L29\t@cond_branch */\n/* \tldr\tr1, .L47 */\n/* \tldrb\tr2, [r1] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r2 */\n/* \tstrb\tr0, [r1] */\n/* \tstrb\tr5, [r1, #0x2] */\n/* \tldrb\tr1, [r3, #0x10] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x10] */\n/* \tldr\tr1, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tb\t.L38 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L29: */\n/* \tmov\tr0, sl */\n/* \tldr\tr3, [r0] */\n/* \tldrb\tr1, [r3, #0x17] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L31\t@cond_branch */\n/* \tldrb\tr1, [r3, #0x18] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L31\t@cond_branch */\n/* \tldr\tr2, .L49 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x1 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3, #0x18] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x18] */\n/* \tldr\tr1, .L49+0x4 */\n/* \tldr\tr0, .L49+0x8 */\n/* \tb\t.L38 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L31: */\n/* \tmov\tr1, sl */\n/* \tldr\tr3, [r1] */\n/* \tldrb\tr1, [r3, #0x1f] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L33\t@cond_branch */\n/* \tadd\tr3, r3, #0x20 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L33\t@cond_branch */\n/* \tldr\tr2, .L51 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr1, .L51+0x4 */\n/* \tldr\tr0, .L51+0x8 */\n/* \tb\t.L38 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L33: */\n/* \tmov\tr0, sl */\n/* \tldr\tr2, [r0] */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x27 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L28\t@cond_branch */\n/* \tadd\tr3, r2, #0 */\n/* \tadd\tr3, r3, #0x28 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L28\t@cond_branch */\n/* \tldr\tr2, .L53 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x3 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L53+0x4 */\n/* \tb\t.L37 */\n/* .L54: */\n/* \t.align\t2, 0 */\n/* .L53: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L28: */\n/* \tldr\tr0, .L55 */\n/* .L37: */\n/* \tldr\tr1, .L55+0x4 */\n/* .L38: */\n/* \tstr\tr0, [r1, #0x4] */\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{r0} */\n/* \tbx\tr0 */\n/* .L56: */\n/* \t.align\t2, 0 */\n/* .L55: */\n/* \t.word\tGameplayMainLoop */\n/* \t.word\tgCallbackQueue */\n/* .Lfe1: */\n/* \t.size\t CountCollectedGems,.Lfe1-CountCollectedGems */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CountCollectedGems(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CountCollectedGems': 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":404,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CountCollectedGems': 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 CountCollectedGems(void) {\n s32 temp_r2;\n s32 temp_r3;\n u8 temp_r5;\n u8 var_ip;\n u8 var_r0_2;\n u8 var_r3;\n u8 var_r6;\n u8 var_r8;\n void (*var_r0)();\n\n temp_r5 = 0x80 & gUnk_03004670->unk8[5][7];\n if (temp_r5 == 0) {\n if ((0x80 & gUnk_03004670->unk8[0][7]) && ((0x7F & gUnk_03004670->unk8[1][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) (-0x10 & gUnk_03004C08.unk0);\n gUnk_03004C08.unk2 = temp_r5;\n gUnk_03004670->unk8[1][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[1][7]) && ((0x7F & gUnk_03004670->unk8[2][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 1);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[2][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[2][7]) && ((0x7F & gUnk_03004670->unk8[3][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 2);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[3][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[3][7]) && ((0x7F & gUnk_03004670->unk8[4][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 3);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[4][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else {\n goto block_42;\n }\n } else {\n var_r0_2 = 0;\n var_ip = 0;\n var_r8 = 0;\n var_r6 = 0;\n unksp0 = 0;\n do {\n var_r3 = 0;\n temp_r2 = var_r0_2 * 8;\nloop_4:\n switch (var_r3) { /* irregular */\n case 7:\n break;\n case 3:\n case 5:\n if ((0x7F & gUnk_03004670->unk8[0][var_r3 + temp_r2]) == 0x64) {\n var_ip += 1;\n } else if ((var_r3 != 7) && ((0x7F & gUnk_03004670->unk8[0][var_r3 + temp_r2]) == 0x1E)) {\n var_r8 += 1;\n }\n break;\n }\n if (0x80 & gUnk_03004670->unk8[0][var_r3 + temp_r2]) {\n var_r6 += 1;\n }\n var_r3 += 1;\n if ((u32) var_r3 <= 6U) {\n goto loop_4;\n }\n var_r0_2 += 1;\n } while ((u32) var_r0_2 <= 4U);\n temp_r3 = 0x7F & gUnk_03004670->unk8[5][0];\n if (temp_r3 == 0x1E) {\n unksp0 = (s32) (u8) (unksp0 + 1);\n }\n if ((0x7F & gUnk_03004670->unk8[5][1]) == 0x1E) {\n unksp0 = (s32) (u8) (unksp0 + 1);\n }\n if ((temp_r3 == 0x7F) && (var_r6 == 0x23)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 4);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][0] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if (((0x7F & gUnk_03004670->unk8[5][1]) == 0x7F) && ((s32) (var_r8 + var_ip) > 0x18)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 5);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][1] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else {\n if ((0x7F & gUnk_03004670->unk8[5][2]) != 0x7F) {\n goto block_42;\n }\n if ((unksp0 + var_ip + var_r8) != 0x25) {\nblock_42:\n var_r0 = GameplayMainLoop;\n } else {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 6);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][2] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n }\n }\n }\n gCallbackQueue.current[1] = var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":56,"lines":100,"gotos":3,"casts":15,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1152: structure has no member named `unk0'","/c.c:1157: structure has no member named `unk0'","/c.c:1162: structure has no member named `unk0'","/c.c:1167: structure has no member named `unk0'","/c.c:1179: `unksp0' undeclared (first use in this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountCollectedGems` — benchmark function kleod:CountCollectedGems:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\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-8f3949f8ca4f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CountCollectedGems(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CountCollectedGems # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CountCollectedGems` — benchmark function kleod:CountCollectedGems:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:CountCollectedGems:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\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 \"CountCollectedGems\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountCollectedGems # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","cast","memory","shift","bitwise","call"],"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 if (*a1 >= 0) {\n LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc((u32)a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n thunk_HeapFree(v0, a0);\n }\n return;\n}\n","score":9,"maxScore":30,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":12,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Decompress(void *arg0, void *arg1) {\n void *temp_r0;\n\n if ((s32) arg1->unk0 < 0) {\n temp_r0 = thunk_HeapAlloc((u32) arg1->unk4 >> 8, 0U);\n HuffUnComp(arg1 + 4, temp_r0);\n LZ77UnCompWram(temp_r0, arg0);\n thunk_HeapFree(temp_r0);\n return;\n }\n LZ77UnCompWram(arg1 + 4, arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk0' in something not a structure or union","/c.c:1076: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":30,"ratio":0.3,"kinds":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["cast","memory","pointer","bitwise","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["cast","memory","bitwise","call","mmio","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":[{"name":"REG_DMA3SAD","shape":"scalar u32"}],"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 *)®_DMA3SAD = v0 + 4;\n ((s32 *)®_DMA3SAD)[1] = a1;\n ((s32 *)®_DMA3SAD)[2] = a2 << 16 >> 17 | 128 << 24;\n do {\n } while ((((s32 *)®_DMA3SAD)[2] & 128 << 24) != 0);\n thunk_HeapFree(v0, ®_DMA3SAD, 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","cast","memory","shift","bitwise","mmio","dma"],"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"},{"name":"REG_DMA3SAD","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 *)®_DMA3SAD;\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityDeathAnimation:agbcc","sym":"EntityDeathAnimation","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","global","bitwise","call"],"loc":50,"refSource":"void EntityDeathAnimation(u8 slot) {\n u8 phase;\n s16 byteMask;\n int newPhase;\n EntityDeathStruct *entities = (EntityDeathStruct *)gEntityArray;\n EntityDeathStruct *entity = &entities[slot];\n EntityDeathStruct *arr;\n EntityDeathStruct *self;\n\n entity->timer = entity->timer - 1;\n byteMask = 0xFF;\n if (entity->timer == 0xFF) {\n entity->timer = 25;\n phase = entity->phase;\n if (phase <= 5) {\n SpawnEntityAtPosition(entities[slot - *gEntityDeathState].x, entities[slot - *gEntityDeathState].y, (u8)(phase + 0x0C), 0);\n }\n newPhase = entity->phase - 1;\n entity->phase = newPhase;\n do {\n if ((newPhase & byteMask) == 0) {\n do {\n SpawnEntityAtPosition(entities[slot - *gEntityDeathState].x, entities[slot - *gEntityDeathState].y, 2,\n (u8)(slot - *gEntityDeathState));\n } while (0);\n } else {\n m4aSongNumStart(0x56);\n if (entity->phase > 9) {\n entities[slot + *gEntityDeathState].typeId = 0;\n LoadSpriteFrame((u8)(slot + *gEntityDeathState), sub_08051A0C(entity->phase, 0x0A));\n }\n LoadSpriteFrame(slot, sub_08051A84(entity->phase, 0x0A));\n if (entity->phase == 9) {\n entities[slot + *gEntityDeathState].typeId = 0x1C; /* inactive */\n entities[slot + *gEntityDeathState].subState = 0;\n }\n }\n } while (0);\n }\n arr = (EntityDeathStruct *)gEntityArray;\n self = &arr[slot];\n byteMask |= 0;\n self->x = arr[slot - *gEntityDeathState].x;\n self->y = arr[slot - *gEntityDeathState].y - 0x20;\n if (self->phase > 9) {\n arr[slot + *gEntityDeathState].x = arr[slot - *gEntityDeathState].x - 3;\n arr[slot + *gEntityDeathState].y = arr[slot - *gEntityDeathState].y - 0x20;\n self->x = self->x + 3;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_1.c#L446-L495","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-169871128279.i.gz","proto":{"EntityDeathAnimation":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Elem0 { u16 field_0; u16 field_2; u8 _pad0[4]; u8 field_8; u8 field_9; u8 _pad1[5]; u8 field_15; u8 field_16; u8 _pad2[11]; };\nvoid EntityDeathAnimation(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n u8 * v8;\n v0 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9;\n v1 = 0;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9 = v0 - 1;\n if ((u8)(v0 - 1) == 255) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9 = 25;\n v2 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8;\n if (v2 > 5) {\n v4 = v1;\n } else {\n v3 = *(u8 *)50352780;\n v4 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - v3].field_2;\n v5 = 0;\n SpawnEntityAtPosition(((struct Elem0 *)&gEntityArray)[(u8)a0 - v3].field_0, v4, (u8)(v2 + 12), v5);\n v2 = (u8)(v2 + 12);\n a1 = v5;\n }\n v6 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 = v6 - 1;\n if ((v6 - 1 & 255) != 0) {\n m4aSongNumStart(86, v4, v2, a1);\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 > 9) {\n v8 = (u8 *)50352780;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *v8].field_15 = v1;\n LoadSpriteFrame((u8)((u8)a0 + *v8), (u8)sub_08051A0C(((struct Elem0 *)&gEntityArray)[(u8)a0].field_8, 10, v8, a1));\n v2 = v8;\n }\n LoadSpriteFrame((u8)a0, (u8)sub_08051A84(((struct Elem0 *)&gEntityArray)[(u8)a0].field_8, 10, v2, a1));\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 == 9) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_15 = 28;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_16 = v1;\n }\n } else {\n v7 = *(u8 *)50352780;\n SpawnEntityAtPosition(((struct Elem0 *)&gEntityArray)[(u8)a0 - v7].field_0, ((struct Elem0 *)&gEntityArray)[(u8)a0 - v7].field_2, 2, (u8)((u8)a0 - v7));\n }\n }\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_0;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_2 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_2 - 32;\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 > 9) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_0 - 3;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_2 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_2 - 32;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 + 3;\n }\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":56,"gotos":0,"casts":49,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'EntityDeathAnimation': agbcc failed: /c.c:1127: too many arguments to function `m4aSongNumStart'"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EntityDeathAnimation(u8 slot) {\n u8 temp_r0;\n u8 temp_r0_2;\n u8 temp_r2;\n u8 temp_r2_2;\n u8 temp_r2_3;\n u8 temp_r3;\n u8 temp_r4;\n u8 temp_r5;\n void *temp_r1;\n void *temp_r1_2;\n void *temp_r4_2;\n void *temp_r6;\n\n temp_r5 = slot;\n temp_r6 = (temp_r5 * 0x1C) + gEntityArray;\n temp_r0 = temp_r6->unk9 - 1;\n temp_r6->unk9 = temp_r0;\n if (temp_r0 == 0xFF) {\n temp_r6->unk9 = 0x19U;\n temp_r2 = temp_r6->unk8;\n if ((u32) temp_r2 <= 5U) {\n temp_r1 = ((temp_r5 - *(u8 *)0x0300528C) * 0x1C) + gEntityArray;\n SpawnEntityAtPosition(temp_r1->unk0, temp_r1->unk2, (u8) (temp_r2 + 0xC), 0U);\n }\n temp_r0_2 = temp_r6->unk8 - 1;\n temp_r6->unk8 = temp_r0_2;\n if (temp_r0_2 == 0) {\n temp_r3 = temp_r5 - *(void *)0x0300528C;\n temp_r1_2 = (temp_r3 * 0x1C) + gEntityArray;\n SpawnEntityAtPosition(temp_r1_2->unk0, temp_r1_2->unk2, 2U, temp_r3);\n } else {\n m4aSongNumStart(0x56U);\n if ((u32) temp_r6->unk8 > 9U) {\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unkF = 0;\n temp_r4 = temp_r5 + *(void *)0x0300528C;\n LoadSpriteFrame(temp_r4, sub_08051A0C(temp_r6->unk8, 0xAU));\n }\n LoadSpriteFrame(temp_r5, sub_08051A84(temp_r6->unk8, 0xAU));\n if (temp_r6->unk8 == 9) {\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unkF = 0x1C;\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unk10 = 0;\n }\n }\n }\n temp_r4_2 = (temp_r5 * 0x1C) + gEntityArray;\n temp_r4_2->unk0 = (u16) *(((temp_r5 - *(void *)0x0300528C) * 0x1C) + gEntityArray);\n temp_r4_2->unk2 = (s16) ((((temp_r5 - *(void *)0x0300528C) * 0x1C) + gEntityArray)->unk2 - 0x20);\n if ((u32) temp_r4_2->unk8 > 9U) {\n temp_r2_2 = *(void *)0x0300528C;\n *(((temp_r5 + temp_r2_2) * 0x1C) + gEntityArray) = *(((temp_r5 - temp_r2_2) * 0x1C) + gEntityArray) - 3;\n temp_r2_3 = *(void *)0x0300528C;\n (((temp_r5 + temp_r2_3) * 0x1C) + gEntityArray)->unk2 = (s16) ((((temp_r5 - temp_r2_3) * 0x1C) + gEntityArray)->unk2 - 0x20);\n temp_r4_2->unk0 = (u16) (temp_r4_2->unk0 + 3);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":55,"gotos":0,"casts":18,"unkGlue":0,"rawMem":0,"addrDeref":10},"errorMarkers":["agbcc failed: /c.c:1113: warning: dereferencing `void *' pointer","/c.c:1113: request for member `unk9' in something not a structure or union","/c.c:1114: warning: dereferencing `void *' pointer","/c.c:1114: request for member `unk9' in something not a structure or union","/c.c:1116: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EntityDeathAnimation` — benchmark function kleod:EntityDeathAnimation:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\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-169871128279.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EntityDeathAnimation(u8 slot);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EntityDeathAnimation # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EntityDeathAnimation` — benchmark function kleod:EntityDeathAnimation:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityDeathAnimation:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\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 \"EntityDeathAnimation\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EntityDeathAnimation # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:EntityItemDrop:agbcc","sym":"EntityItemDrop","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitfield","array","struct","global","switch","shift","comparison-tree"],"loc":64,"refSource":"void EntityItemDrop(u8 arg0) {\n u8 itemType = arg0 + 0xE4;\n\n if (gGameFlagsPtr[0x0A] == 1) {\n gEntity.base[arg0].unk_F = 0x1C;\n gEntity.base[arg0].unk_10 = 0;\n return;\n }\n\n switch (gEntity.base[arg0].unk_F) {\n case 3: {\n gEntity.base[arg0].unk_F = 0;\n gEntity.base[arg0].unk_14 = 0;\n gEntity.base[arg0].unk_10 = 1;\n gEntity.base[arg0].unk_C_0 = 0;\n\n if (gEntity.unk_204_2 == 0) {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 + 0x10;\n } else {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 - 0x10;\n }\n\n gEntity.base[arg0].unk_2 = gEntity.unk_1FA;\n gEntity.base[arg0].unk_8 = gItemDropParamTable.unk_0[itemType][0];\n gEntity.base[arg0].unk_9 = gItemDropParamTable.unk_0[itemType][1];\n gEntity.base[arg0].unk_16 = 4;\n break;\n }\n\n case 4: {\n gEntity.base[arg0].unk_F = 0;\n gEntity.base[arg0].unk_14 = 0;\n gEntity.base[arg0].unk_10 = 1;\n gEntity.base[arg0].unk_C_0 = 0;\n\n if (gEntity.unk_204_2 == 0) {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 + 0x10;\n } else {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 - 0x10;\n }\n\n gEntity.base[arg0].unk_2 = gEntity.unk_1FA;\n gEntity.base[arg0].unk_8 = gItemDropParamTable.unk_A[itemType][0];\n gEntity.base[arg0].unk_9 = gItemDropParamTable.unk_A[itemType][1];\n gEntity.base[arg0].unk_16 = 2;\n break;\n }\n\n case 0: {\n gEntity.base[arg0].unk_2 = 0x10C - ((gEntity.base[arg0].unk_9 * gSineTable[gEntity.base[arg0].unk_14]) >> 8);\n gEntity.base[arg0].unk_0 += gEntity.base[arg0].unk_8;\n\n gEntity.base[arg0].unk_14 += gEntity.base[arg0].unk_16;\n if (gEntity.base[arg0].unk_14 == 0x88) {\n gEntity.base[arg0].unk_F = 0x1C;\n gEntity.base[arg0].unk_10 = 0;\n }\n break;\n }\n\n default:\n break;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_1.c#L534-L597","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-d4ba501e6cbc.i.gz","proto":{"EntityItemDrop":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/flip-branch","symbolsUsed":[{"name":"gEntity","shape":"struct Entity (520 B)"},{"name":"gGameFlagsPtr","shape":"u8[]"},{"name":"gItemDropParamTable","shape":"struct ItemDropParamTable (20 B)"},{"name":"gSineTable","shape":"s16[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 field_0; u8 _pad0[1]; };\nstruct Elem1 { u8 field_0; u8 _pad0[1]; };\nstruct Elem2 { u8 field_0; u8 _pad0[1]; };\nstruct Elem3 { u8 field_0; u8 _pad0[1]; };\nstruct Struct0 { u16 field_0; u16 field_2; u8 _pad0[8]; u8 field_12; u8 _pad1[2]; u8 field_15; u8 field_16; u8 _pad2[3]; u16 field_20; u8 field_22; };\nstruct Struct1 { u8 _pad0[2]; u16 field_2; u8 _pad1[4]; u8 field_8; u8 field_9; u8 _pad2[12]; u8 field_22; };\nstruct Struct2 { u8 _pad0[2]; u16 field_2; u8 _pad1[4]; u8 field_8; u8 field_9; u8 _pad2[12]; u8 field_22; };\nvoid EntityItemDrop(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n u8 * p0;\n p0 = (u8 *)&gEntity;\n if (gGameFlagsPtr[10] != 1) {\n if (p0[(u8)a0 * 28 + 15] == 3) {\n p0[(u8)a0 * 28 + 15] = 0;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = 0;\n p0[(u8)a0 * 28 + 16] = 1;\n p0[(u8)a0 * 28 + 12] = 1 - 5 & p0[(u8)a0 * 28 + 12];\n if ((u32)(p0[129 << 2] << 28) >> 30 != 0) {\n v2 = ((u16 *)&gEntity)[252] - 16;\n } else {\n v2 = ((u16 *)&gEntity)[252] + 16;\n }\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = v2;\n ((struct Struct1 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = ((u16 *)&gEntity)[253];\n p0[(u8)a0 * 28 + 8] = ((struct Elem0 *)&gItemDropParamTable)[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 9] = ((struct Elem1 *)((u32)&gItemDropParamTable + 1))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 22] = 4;\n return;\n } else {\n if (p0[(u8)a0 * 28 + 15] > 3) {\n if (p0[(u8)a0 * 28 + 15] == 4) {\n p0[(u8)a0 * 28 + 15] = 0;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = 0;\n p0[(u8)a0 * 28 + 16] = 1;\n p0[(u8)a0 * 28 + 12] = 1 - 5 & p0[(u8)a0 * 28 + 12];\n if ((u32)(p0[129 << 2] << 28) >> 30 != 0) {\n v3 = ((u16 *)&gEntity)[252] - 16;\n } else {\n v3 = ((u16 *)&gEntity)[252] + 16;\n }\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = v3;\n ((struct Struct2 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = ((u16 *)&gEntity)[253];\n p0[(u8)a0 * 28 + 8] = ((struct Elem2 *)((u32)&gItemDropParamTable + 10))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 9] = ((struct Elem3 *)((u32)&gItemDropParamTable + 11))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 22] = 2;\n return;\n } else {\n return;\n }\n } else {\n if (p0[(u8)a0 * 28 + 15] == 0) {\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = (134 << 1) - (*(s8 *)((u8)a0 * 28 + (u32)&gEntity + 9) * *(s16 *)((((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 << 1) + (u32)&gSineTable + 0) >> 8);\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = *(s8 *)((u8)a0 * 28 + (u32)&gEntity + 8) + ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0;\n v0 = p0[(u8)a0 * 28 + 22];\n v1 = ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = v1 + v0;\n if ((u16)(v1 + v0) != 136) {\n return;\n } else {\n p0[(u8)a0 * 28 + 15] = 28;\n p0[(u8)a0 * 28 + 16] = 0;\n return;\n }\n } else {\n return;\n }\n }\n }\n } else {\n p0[(u8)a0 * 28 + 15] = 28;\n p0[(u8)a0 * 28 + 16] = 0;\n return;\n }\n}\n","score":148,"maxScore":234,"compileErrors":null,"breakdown":{"insert":52,"delete":30,"replace":24,"opMismatch":5,"argMismatch":37},"quality":{"score":76,"lines":77,"gotos":0,"casts":50,"unkGlue":0,"rawMem":3,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EntityItemDrop(u8 arg0) {\n s32 temp_r3_2;\n s32 temp_r3_3;\n struct EntityBase *temp_r0;\n struct EntityBase *temp_r1_2;\n struct EntityBase *temp_r1_3;\n struct EntityBase *temp_r3;\n u16 temp_r0_2;\n u16 var_r0;\n u16 var_r0_2;\n u32 temp_r5;\n u8 temp_r1;\n u8 temp_r4;\n\n temp_r4 = arg0;\n temp_r5 = (u32) ((arg0 << 0x18) + 0xE4000000) >> 0x18;\n if (gGameFlagsPtr->unkA == 1) {\n temp_r0 = &gEntity.base[temp_r4];\n temp_r0->unk_F = 0x1C;\n temp_r0->unk_10 = 0;\n return;\n }\n temp_r3 = &gEntity.base[temp_r4];\n temp_r1 = temp_r3->unk_F;\n switch (temp_r1) { /* irregular */\n case 3:\n temp_r3->unk_F = 0;\n temp_r3->unk_14 = 0;\n temp_r3->unk_10 = 1;\n temp_r3->unkC = (u8) (-4 & temp_r3->unkC);\n if (((u32) (gEntity.unk204 << 0x1C) >> 0x1E) == 0) {\n var_r0 = gEntity.unk_1F8 + 0x10;\n } else {\n var_r0 = gEntity.unk_1F8 - 0x10;\n }\n temp_r3->unk_0 = var_r0;\n temp_r1_2 = &gEntity.base[temp_r4];\n temp_r1_2->unk_2 = gEntity.unk_1FA;\n temp_r3_2 = temp_r5 * 2;\n temp_r1_2->unk_8 = (s8) *(temp_r3_2 + &gItemDropParamTable);\n temp_r1_2->unk_9 = (s8) *(temp_r3_2 + &gItemDropParamTable.unk_0[0][1]);\n temp_r1_2->unk_16 = 4;\n return;\n case 4:\n temp_r3->unk_F = 0;\n temp_r3->unk_14 = 0;\n temp_r3->unk_10 = 1;\n temp_r3->unkC = (u8) (-4 & temp_r3->unkC);\n if (((u32) (gEntity.unk204 << 0x1C) >> 0x1E) == 0) {\n var_r0_2 = gEntity.unk_1F8 + 0x10;\n } else {\n var_r0_2 = gEntity.unk_1F8 - 0x10;\n }\n temp_r3->unk_0 = var_r0_2;\n temp_r1_3 = &gEntity.base[temp_r4];\n temp_r1_3->unk_2 = gEntity.unk_1FA;\n temp_r3_3 = temp_r5 * 2;\n temp_r1_3->unk_8 = (s8) *(temp_r3_3 + gItemDropParamTable.unk_A[0]);\n temp_r1_3->unk_9 = (s8) *(temp_r3_3 + &gItemDropParamTable.unk_A[0][1]);\n temp_r1_3->unk_16 = 2;\n return;\n case 0:\n temp_r3->unk_2 = 0x10C - ((s32) (temp_r3->unk_9 * gSineTable[temp_r3->unk_14]) >> 8);\n temp_r3->unk_0 += temp_r3->unk_8;\n temp_r0_2 = temp_r3->unk_14 + temp_r3->unk_16;\n temp_r3->unk_14 = temp_r0_2;\n if (temp_r0_2 == 0x88) {\n temp_r3->unk_F = 0x1C;\n temp_r3->unk_10 = 0;\n }\n return;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":72,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1114: request for member `unkA' in something not a structure or union","/c.c:1127: structure has no member named `unkC'","/c.c:1128: structure has no member named `unk204'","/c.c:1137: aggregate value used where an integer was expected","/c.c:1145: structure has no member named `unkC'"]},"gapSize":{"decompiler":"asmlift","score":148,"maxScore":234,"ratio":0.6324786324786325,"kinds":{"insert":52,"delete":30,"replace":24,"opMismatch":5,"argMismatch":37}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EntityItemDrop` — benchmark function kleod:EntityItemDrop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\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-d4ba501e6cbc.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EntityItemDrop(u8 arg0);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EntityItemDrop # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EntityItemDrop` — benchmark function kleod:EntityItemDrop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityItemDrop:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\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 \"EntityItemDrop\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EntityItemDrop # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","branch","call"],"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-GYLwTt/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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":"gPauseFlag","shape":"scalar u8"}],"outcome":"nonmatch","source":"void GameUpdate(void) {\n s32 v0;\n v0 = gPauseFlag;\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","memory","pointer","shift","bitwise","mmio","strength-reduce"],"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"},{"name":"REG_DISPSTAT","shape":"scalar u16"},{"name":"REG_IE","shape":"scalar u16"}],"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 REG_IE = REG_IE | 2;\n REG_DISPSTAT = REG_DISPSTAT | 16;\n if ((u32)((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n REG_IE = 65533 & REG_IE;\n REG_DISPSTAT = 65519 & REG_DISPSTAT;\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":100,"lines":19,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ProcessInputAndUpdateEntities:agbcc","sym":"ProcessInputAndUpdateEntities","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","switch","loop","nested-loop","shift","bitwise","call","mmio","dma","jump-table","strength-reduce"],"loc":136,"refSource":"void ProcessInputAndUpdateEntities(void) {\n u8 sp4;\n u32 var_r1;\n u8 var_r4;\n u8 var_r5;\n\n sp4 = (gNewKeys & (START_BUTTON | B_BUTTON)) != 0;\n if (gNewKeys & A_BUTTON) {\n sp4 = gUnk_03004658[0xC] + 1;\n }\n\n if (gNewKeys & (DPAD_DOWN | DPAD_UP)) {\n for (var_r5 = 0; var_r5 < 2; var_r5++) {\n DmaFill16(3, 0, &gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5], 0x4);\n DmaFill16(3, 0, &gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7], 0x4);\n }\n\n if ((gUnk_030034C0 == 0) || (gUnk_030034C0 == 2)) {\n if (gNewKeys & DPAD_DOWN) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] += 1;\n if (gUnk_03004658[0xC] > 3) {\n gUnk_03004658[0xC] = 0;\n }\n }\n\n if (gNewKeys & DPAD_UP) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] -= 1;\n if (gUnk_03004658[0xC] & 0x80) {\n gUnk_03004658[0xC] = 3;\n }\n }\n } else {\n if (gNewKeys & DPAD_DOWN) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] += 1;\n if (gUnk_03004658[0xC] > 2) {\n gUnk_03004658[0xC] = 0;\n }\n }\n\n if (gNewKeys & DPAD_UP) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] -= 1;\n if (gUnk_03004658[0xC] & 0x80) {\n gUnk_03004658[0xC] = 2;\n }\n }\n }\n\n for (var_r5 = 0; var_r5 < 2; var_r5++) {\n for (var_r4 = 0; var_r4 < 2; var_r4++) {\n if (gUnk_030034BC == 0) {\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0x9D + var_r4] + gUnk_03000800;\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0xAF + var_r4] + gUnk_03000800;\n } else {\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0x9D + var_r4];\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0xAF + var_r4];\n }\n }\n }\n }\n\n if (sp4 > 0) {\n sp4 = gUnk_081166F8[gUnk_030034C0][sp4 - 1];\n }\n\n switch (sp4 - 1) {\n case 0:\n gCallbackQueue.next[0] = ReadKeyInput;\n for (var_r1 = 0; var_r1 < 10; var_r1++) {\n gCallbackQueue.next[var_r1] = gCallbackQueue.previous[var_r1];\n }\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = gCallbackQueue.previousCount;\n\n UpdateOamSortOrder();\n m4aSoundVSyncOn();\n m4aMPlayAllContinue();\n break;\n\n case 1:\n UpdateOamSortOrder();\n gCallbackQueue.current[1] = TransitionFadeOutFull;\n gUnk_03005220.unk4 = gUnk_03005284->unk18;\n gUnk_03005220.lives = gUnk_03005284->unk0;\n gUnk_03005220.hearts = gUnk_03005284->unk8_0;\n REG_BLDCNT = 0;\n gBlendValue = 0;\n break;\n\n case 2:\n gUnk_03005284->unk0 = gUnk_03005220.lives = gUnk_03005284->unk1E;\n UpdateOamSortOrder();\n gBlendValue = 0;\n if (gUnk_03004C20.world == 6 && gUnk_03004C20.level == 8) {\n gUnk_03004C20.world = 5;\n }\n gUnk_030034B0.unk6_4 = gUnk_03004C20.level;\n gUnk_03004C20.level = 0;\n gCallbackQueue.current[1] = TransitionGameOver;\n break;\n\n case 3:\n gCallbackQueue.current[1] = SetupBG3WindowOverlay;\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tilemap);\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tiles);\n break;\n\n case 4:\n if (gUnk_03004C20.level != 0) {\n gUnk_03005284->unk0 = gUnk_03005220.lives = gUnk_03005284->unk1E;\n }\n UpdateOamSortOrder();\n REG_BLDCNT = 0;\n gBlendValue = 0;\n FreeAllDecompBuffers();\n gCallbackQueue.current[1] = TransitionToGameplayScreen;\n break;\n\n case 5:\n gBlendValue = 0;\n gUnk_03004C20.level = 9;\n gUnk_03004D9C = 0;\n InitOamEntries();\n gCallbackQueue.current[1] = TransitionSoftReset;\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tilemap);\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tiles);\n break;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1495-L1630","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\n\n.text\n\t.align\t2, 0\n","proto":{"ProcessInputAndUpdateEntities":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ProcessInputAndUpdateEntities' — lift: cannot lift 'ProcessInputAndUpdateEntities': 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\tProcessInputAndUpdateEntities */\n/* \t.type\t ProcessInputAndUpdateEntities,function */\n/* \t.thumb_func */\n/* ProcessInputAndUpdateEntities: */\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, #-0xc */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr2, [r0] */\n/* \tmov\tr1, #0xa */\n/* \tand\tr1, r1, r2 */\n/* \tneg\tr0, r1 */\n/* \torr\tr0, r0, r1 */\n/* \tlsr\tr0, r0, #0x1f */\n/* \tstr\tr0, [sp, #0x4] */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldr\tr0, .L54+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tldrb\tr0, [r0, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp, #0x4] */\n/* .L5: */\n/* \tmov\tr0, #0xc0 */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB39 */\n/* \tb\t.L6\t@long jump */\n/* .LCB39: */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr3, .L54+0x4 */\n/* \tldr\tr0, .L54+0x8 */\n/* \tldr\tr1, .L54+0xc */\n/* \tmov\tr9, r1 */\n/* \tmov\tr4, sp */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr2, .L54+0x10 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0xb */\n/* \tldr\tr0, .L54+0x14 */\n/* \tadd\tr6, r1, r0 */\n/* \tmov\tip, r6 */\n/* \tadd\tr0, r0, #0x24 */\n/* \tadd\tr1, r1, r0 */\n/* \tmov\tr8, r1 */\n/* \tldr\tr3, [r3] */\n/* \tldr\tr6, .L54+0x18 */\n/* .L10: */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r2] */\n/* \tldrb\tr1, [r3, #0xc] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r5, r0 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tadd\tr0, r0, ip */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr1, sp */\n/* \tstr\tr1, [r2] */\n/* \tldrb\tr1, [r3, #0xc] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r5, r0 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tadd\tr0, r0, r8 */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tadd\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1 */\n/* \tbls\t.L10\t@cond_branch */\n/* \tmov\tr2, r9 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tcmp\tr0, #0x2 */\n/* \tbne\t.L12\t@cond_branch */\n/* .L13: */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L54+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr0, [r2, #0xc] */\n/* \tcmp\tr0, #0x3 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L14: */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x40 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L54+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr1, [r2, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x3 */\n/* \tb\t.L52 */\n/* .L55: */\n/* \t.align\t2, 0 */\n/* .L54: */\n/* \t.word\tgNewKeys */\n/* \t.word\tgUnk_03004658 */\n/* \t.word\tgUnk_030034BC */\n/* \t.word\tgUnk_030034C0 */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgBgTilemapBufs+0x14a */\n/* \t.word\t-0x7efffffe */\n/* .L12: */\n/* \tldr\tr0, .L56 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L56+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr0, [r2, #0xc] */\n/* \tcmp\tr0, #0x2 */\n/* \tbls\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L19: */\n/* \tldr\tr0, .L56 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x40 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L56+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr1, [r2, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x2 */\n/* .L52: */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L18: */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr3, .L56+0x8 */\n/* \tmov\tr8, r3 */\n/* \tldr\tr6, .L56+0xc */\n/* \tmov\tip, r6 */\n/* \tldr\tr7, .L56+0x4 */\n/* \tmov\tsl, r7 */\n/* .L26: */\n/* \tmov\tr4, #0x0 */\n/* \tadd\tr0, r5, #0x1 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr0, r5, #0x4 */\n/* \tsub\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tstr\tr0, [sp, #0x8] */\n/* .L30: */\n/* \tmov\tr1, r8 */\n/* \tldrb\tr0, [r1] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L31\t@cond_branch */\n/* \tmov\tr2, sl */\n/* \tldr\tr3, [r2] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xa5 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr6, r8 */\n/* \tldrb\tr0, [r6] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr7, .L56+0x10 */\n/* \tldr\tr0, [r7, #0x1c] */\n/* \tldr\tr6, [sp, #0x8] */\n/* \tadd\tr2, r6, r4 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r2, r0 */\n/* \tmov\tr7, #0x9d */\n/* \tlsl\tr7, r7, #0x1 */\n/* \tadd\tr0, r0, r7 */\n/* \tldrh\tr0, [r0] */\n/* \tldr\tr6, .L56+0x14 */\n/* \tldrb\tr6, [r6] */\n/* \tadd\tr0, r0, r6 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xb7 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr7, r8 */\n/* \tldrb\tr0, [r7] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr3, .L56+0x10 */\n/* \tldr\tr0, [r3, #0x1c] */\n/* \tadd\tr2, r2, r0 */\n/* \tmov\tr6, #0xaf */\n/* \tlsl\tr6, r6, #0x1 */\n/* \tadd\tr0, r2, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tldr\tr7, .L56+0x14 */\n/* \tldrb\tr7, [r7] */\n/* \tadd\tr0, r0, r7 */\n/* \tb\t.L53 */\n/* .L57: */\n/* \t.align\t2, 0 */\n/* .L56: */\n/* \t.word\tgNewKeys */\n/* \t.word\tgUnk_03004658 */\n/* \t.word\tgUnk_030034BC */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgUnk_03000800 */\n/* .L31: */\n/* \tmov\tr0, sl */\n/* \tldr\tr3, [r0] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xa5 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr2, r8 */\n/* \tldrb\tr0, [r2] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr6, .L58 */\n/* \tldr\tr0, [r6, #0x1c] */\n/* \tldr\tr7, [sp, #0x8] */\n/* \tadd\tr2, r7, r4 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r2, r0 */\n/* \tmov\tr6, #0x9d */\n/* \tlsl\tr6, r6, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xb7 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr7, r8 */\n/* \tldrb\tr0, [r7] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr3, .L58 */\n/* \tldr\tr0, [r3, #0x1c] */\n/* \tadd\tr2, r2, r0 */\n/* \tadd\tr6, r6, #0x24 */\n/* \tadd\tr0, r2, r6 */\n/* \tldrh\tr0, [r0] */\n/* .L53: */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr0, r4, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tcmp\tr4, #0x1 */\n/* \tbls\t.L30\t@cond_branch */\n/* \tmov\tr7, r9 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1 */\n/* \tbhi\t.LCB418 */\n/* \tb\t.L26\t@long jump */\n/* .LCB418: */\n/* .L6: */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L35\t@cond_branch */\n/* \tldr\tr1, .L58+0x4 */\n/* \tldr\tr0, .L58+0x8 */\n/* \tldrb\tr0, [r0] */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, #0x1 */\n/* \tldr\tr2, [sp, #0x4] */\n/* \tadd\tr0, r2, r0 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tstr\tr0, [sp, #0x4] */\n/* .L35: */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tcmp\tr0, #0x5 */\n/* \tbls\t.LCB440 */\n/* \tb\t.L36\t@long jump */\n/* .LCB440: */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tldr\tr1, .L58+0xc */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L59: */\n/* \t.align\t2, 0 */\n/* .L58: */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgUnk_081166F8 */\n/* \t.word\tgUnk_030034C0 */\n/* \t.word\t.L50 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L50: */\n/* \t.word\t.L37 */\n/* \t.word\t.L43 */\n/* \t.word\t.L44 */\n/* \t.word\t.L46 */\n/* \t.word\t.L47 */\n/* \t.word\t.L49 */\n/* .L37: */\n/* \tldr\tr2, .L60 */\n/* \tldr\tr0, .L60+0x4 */\n/* \tstr\tr0, [r2, #0x28] */\n/* \tmov\tr1, #0x0 */\n/* \tadd\tr3, r2, #0 */\n/* \tadd\tr3, r3, #0x28 */\n/* .L41: */\n/* \tldr\tr0, [r3, #0x28] */\n/* \tstmia\tr3!, {r0} */\n/* \tadd\tr1, r1, #0x1 */\n/* \tcmp\tr1, #0x9 */\n/* \tbls\t.L41\t@cond_branch */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x78 */\n/* \tldrb\tr0, [r0] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tmov\tr1, #0x0 */\n/* \tstr\tr1, [r0] */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x7a */\n/* \tldrb\tr1, [r0] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr1, [r0] */\n/* \tbl\tUpdateOamSortOrder */\n/* \tbl\tm4aSoundVSyncOn */\n/* \tbl\tm4aMPlayAllContinue */\n/* \tb\t.L36 */\n/* .L61: */\n/* \t.align\t2, 0 */\n/* .L60: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tReadKeyInput */\n/* .L43: */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr1, .L62 */\n/* \tldr\tr0, .L62+0x4 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr3, .L62+0x8 */\n/* \tldr\tr0, .L62+0xc */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, [r1, #0x18] */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tldrb\tr2, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x4c */\n/* \tmov\tr4, #0x0 */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr1, [r1, #0x8] */\n/* \tlsl\tr1, r1, #0x1e */\n/* \tlsr\tr1, r1, #0x1e */\n/* \tldrb\tr2, [r3] */\n/* \tmov\tr0, #0x4 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L62+0x10 */\n/* \tmov\tr1, #0x0 */\n/* \tstrh\tr4, [r0] */\n/* \tldr\tr0, .L62+0x14 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L36 */\n/* .L63: */\n/* \t.align\t2, 0 */\n/* .L62: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionFadeOutFull */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\t0x4000050 */\n/* \t.word\tgBlendValue */\n/* .L44: */\n/* \tldr\tr0, .L64 */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, .L64+0x4 */\n/* \tldrb\tr2, [r1, #0x1e] */\n/* \tadd\tr0, r0, #0x4c */\n/* \tmov\tr5, #0x0 */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr0, [r1, #0x1e] */\n/* \tstrb\tr0, [r1] */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr0, .L64+0x8 */\n/* \tstrb\tr5, [r0] */\n/* \tldr\tr4, .L64+0xc */\n/* \tldrh\tr1, [r4, #0xc] */\n/* \tmov\tr0, #0xc1 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tcmp\tr1, r0 */\n/* \tbne\t.L45\t@cond_branch */\n/* \tmov\tr0, #0x5 */\n/* \tstrb\tr0, [r4, #0xd] */\n/* .L45: */\n/* \tldr\tr3, .L64+0x10 */\n/* \tldrb\tr1, [r4, #0xc] */\n/* \tlsl\tr1, r1, #0x4 */\n/* \tldrb\tr2, [r3, #0x6] */\n/* \tmov\tr0, #0xf */\n/* \tand\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x6] */\n/* \tstrb\tr5, [r4, #0xc] */\n/* \tldr\tr1, .L64+0x14 */\n/* \tldr\tr0, .L64+0x18 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tb\t.L36 */\n/* .L65: */\n/* \t.align\t2, 0 */\n/* .L64: */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgBlendValue */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_030034B0 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionGameOver */\n/* .L46: */\n/* \tldr\tr1, .L66 */\n/* \tldr\tr0, .L66+0x4 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr4, .L66+0x8 */\n/* \tldr\tr0, [r4, #0x1c] */\n/* \tbl\tthunk_HeapFree */\n/* \tldr\tr0, [r4, #0x18] */\n/* \tbl\tthunk_HeapFree */\n/* \tb\t.L36 */\n/* .L67: */\n/* \t.align\t2, 0 */\n/* .L66: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tSetupBG3WindowOverlay */\n/* \t.word\tgBgDataPtrs */\n/* .L47: */\n/* \tldr\tr0, .L68 */\n/* \tldrb\tr0, [r0, #0xc] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L48\t@cond_branch */\n/* \tldr\tr0, .L68+0x4 */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, .L68+0x8 */\n/* \tldrb\tr2, [r1, #0x1e] */\n/* \tadd\tr0, r0, #0x4c */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr0, [r1, #0x1e] */\n/* \tstrb\tr0, [r1] */\n/* .L48: */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr0, .L68+0xc */\n/* \tmov\tr1, #0x0 */\n/* \tstrh\tr1, [r0] */\n/* \tldr\tr0, .L68+0x10 */\n/* \tstrb\tr1, [r0] */\n/* \tbl\tFreeAllDecompBuffers */\n/* \tldr\tr1, .L68+0x14 */\n/* \tldr\tr0, .L68+0x18 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tb\t.L36 */\n/* .L69: */\n/* \t.align\t2, 0 */\n/* .L68: */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\t0x4000050 */\n/* \t.word\tgBlendValue */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionToGameplayScreen */\n/* .L49: */\n/* \tldr\tr1, .L70 */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r1] */\n/* \tldr\tr1, .L70+0x4 */\n/* \tmov\tr2, #0x0 */\n/* \tmov\tr0, #0x9 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr0, .L70+0x8 */\n/* \tstrb\tr2, [r0] */\n/* \tbl\tInitOamEntries */\n/* \tldr\tr1, .L70+0xc */\n/* \tldr\tr0, .L70+0x10 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr4, .L70+0x14 */\n/* \tldr\tr0, [r4, #0x1c] */\n/* \tbl\tthunk_HeapFree */\n/* \tldr\tr0, [r4, #0x18] */\n/* \tbl\tthunk_HeapFree */\n/* .L36: */\n/* \tadd\tsp, sp, #0xc */\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/* .L71: */\n/* \t.align\t2, 0 */\n/* .L70: */\n/* \t.word\tgBlendValue */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_03004D9C */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionSoftReset */\n/* \t.word\tgBgDataPtrs */\n/* .Lfe1: */\n/* \t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ProcessInputAndUpdateEntities(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ProcessInputAndUpdateEntities': 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":595,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ProcessInputAndUpdateEntities': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? FreeAllDecompBuffers(); /* extern */\n? InitOamEntries(); /* extern */\n? UpdateOamSortOrder(); /* extern */\n? m4aMPlayAllContinue(); /* extern */\n? m4aSongNumStart(s32); /* extern */\n? m4aSoundVSyncOn(); /* extern */\n? thunk_HeapFree(s32); /* extern */\nextern ? ReadKeyInput;\nextern ? SetupBG3WindowOverlay;\nextern ? TransitionFadeOutFull;\nextern ? TransitionGameOver;\nextern ? TransitionSoftReset;\nextern ? TransitionToGameplayScreen;\nextern ? gBgDataPtrs;\nextern ? gBgTilemapBufs;\nextern s8 gBlendValue;\nextern ? gCallbackQueue;\nextern u16 gNewKeys;\nextern u8 gUnk_03000800;\nextern ? gUnk_030034B0;\nextern u8 gUnk_030034BC;\nextern u8 gUnk_030034C0;\nextern void *gUnk_03004658;\nextern ? gUnk_03004C20;\nextern s8 gUnk_03004D9C;\nextern ? gUnk_03005220;\nextern void *gUnk_03005284;\nextern ? gUnk_081166F8;\n\nvoid ProcessInputAndUpdateEntities(void) {\n s32 temp_r1;\n s32 temp_r1_2;\n s32 temp_r2;\n s32 temp_r2_2;\n s8 var_r0;\n u16 *var_r1;\n u16 var_r0_2;\n u32 temp_r0_2;\n u32 var_r1_2;\n u8 var_r4;\n u8 var_r5;\n u8 var_r5_2;\n void *temp_r0;\n void *var_r3;\n\n temp_r1 = 0xA & gNewKeys;\n unksp4 = (u32) ((0 - temp_r1) | temp_r1) >> 0x1F;\n if (1 & gNewKeys) {\n unksp4 = (s32) (u8) (gUnk_03004658->unkC + 1);\n }\n if (!(0xC0 & gNewKeys)) {\n\n } else {\n var_r5 = 0;\n temp_r1_2 = gUnk_030034BC << 0xB;\n temp_r0 = &gBgTilemapBufs + 0x14A;\n do {\n unksp0 = 0;\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (void *) (((var_r5 + (gUnk_03004658->unkC * 3)) << 6) + (temp_r1_2 + temp_r0));\n (void *)0x040000D4->unk8 = 0x81000002;\n unksp0 = 0;\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (void *) (((var_r5 + (gUnk_03004658->unkC * 3)) << 6) + (temp_r1_2 + (temp_r0 + 0x24)));\n (void *)0x040000D4->unk8 = 0x81000002;\n var_r5 += 1;\n } while ((u32) var_r5 <= 1U);\n if ((gUnk_030034C0 == 0) || (gUnk_030034C0 == 2)) {\n if (0x80 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC + 1);\n if ((u32) gUnk_03004658->unkC > 3U) {\n gUnk_03004658->unkC = 0U;\n }\n }\n if (0x40 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC - 1);\n if (0x80 & gUnk_03004658->unkC) {\n var_r0 = 3;\n goto block_20;\n }\n }\n } else {\n if (0x80 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC + 1);\n if ((u32) gUnk_03004658->unkC > 2U) {\n gUnk_03004658->unkC = 0U;\n }\n }\n if (0x40 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC - 1);\n if (0x80 & gUnk_03004658->unkC) {\n var_r0 = 2;\nblock_20:\n gUnk_03004658->unkC = var_r0;\n }\n }\n }\n var_r5_2 = 0;\nloop_22:\n var_r4 = 0;\n unksp8 = var_r5_2 * 0x1E;\n do {\n if (gUnk_030034BC == 0) {\n temp_r2 = (unksp8 + var_r4) * 2;\n *(((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xA5)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs) = (temp_r2 + gBgDataPtrs.unk1C)->unk13A + gUnk_03000800;\n var_r1 = ((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xB7)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs;\n var_r0_2 = (temp_r2 + gBgDataPtrs.unk1C)->unk15E + gUnk_03000800;\n } else {\n temp_r2_2 = (unksp8 + var_r4) * 2;\n *(((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xA5)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs) = (temp_r2_2 + gBgDataPtrs.unk1C)->unk13A;\n var_r1 = ((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xB7)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs;\n var_r0_2 = (temp_r2_2 + gBgDataPtrs.unk1C)->unk15E;\n }\n *var_r1 = var_r0_2;\n var_r4 += 1;\n } while ((u32) var_r4 <= 1U);\n var_r5_2 += 1;\n if ((u32) var_r5_2 <= 1U) {\n goto loop_22;\n }\n }\n if (unksp4 != 0) {\n unksp4 = (s32) *(unksp4 + ((gUnk_030034C0 * 4) - 1) + &gUnk_081166F8);\n }\n temp_r0_2 = unksp4 - 1;\n switch (temp_r0_2) { /* irregular */\n case 0:\n gCallbackQueue.unk28 = &ReadKeyInput;\n var_r1_2 = 0;\n var_r3 = &gCallbackQueue + 0x28;\n do {\n var_r3->unk0 = (s32) var_r3->unk28;\n var_r3 += 4;\n var_r1_2 += 1;\n } while (var_r1_2 <= 9U);\n *(((gCallbackQueue.unk78 - 1) * 4) + &gCallbackQueue) = 0;\n *((&gCallbackQueue + 0x7A) - 1) = gCallbackQueue.unk7A;\n UpdateOamSortOrder();\n m4aSoundVSyncOn();\n m4aMPlayAllContinue();\n return;\n case 1:\n UpdateOamSortOrder();\n gCallbackQueue.unk4 = &TransitionFadeOutFull;\n gUnk_03005220.unk4 = (s32) gUnk_03005284->unk18;\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk0;\n gUnk_03005220.unk0 = (u8) ((-4 & gUnk_03005220.unk0) | ((u32) (gUnk_03005284->unk8 << 0x1E) >> 0x1E));\n *(s16 *)0x04000050 = 0;\n gBlendValue = 0;\n return;\n case 2:\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk1E;\n gUnk_03005284->unk0 = (u8) gUnk_03005284->unk1E;\n UpdateOamSortOrder();\n gBlendValue = 0;\n if (gUnk_03004C20.unkC == 0x608) {\n gUnk_03004C20.unkD = 5;\n }\n gUnk_030034B0.unk6 = (u8) ((0xF & gUnk_030034B0.unk6) | ((u8) gUnk_03004C20.unkC * 0x10));\n gUnk_03004C20.unkC = 0;\n gCallbackQueue.unk4 = &TransitionGameOver;\n return;\n case 3:\n gCallbackQueue.unk4 = &SetupBG3WindowOverlay;\n thunk_HeapFree(gBgDataPtrs.unk1C);\n thunk_HeapFree(gBgDataPtrs.unk18);\n return;\n case 4:\n if ((u8) gUnk_03004C20.unkC != 0) {\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk1E;\n gUnk_03005284->unk0 = (u8) gUnk_03005284->unk1E;\n }\n UpdateOamSortOrder();\n *(void *)0x04000050 = 0;\n gBlendValue = 0;\n FreeAllDecompBuffers();\n gCallbackQueue.unk4 = &TransitionToGameplayScreen;\n return;\n case 5:\n gBlendValue = 0;\n gUnk_03004C20.unkC = 9;\n gUnk_03004D9C = 0;\n InitOamEntries();\n gCallbackQueue.unk4 = &TransitionSoftReset;\n thunk_HeapFree(gBgDataPtrs.unk1C);\n thunk_HeapFree(gBgDataPtrs.unk18);\n return;\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":190,"gotos":2,"casts":36,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessInputAndUpdateEntities` — benchmark function kleod:ProcessInputAndUpdateEntities:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessInputAndUpdateEntities # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessInputAndUpdateEntities` — benchmark function kleod:ProcessInputAndUpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ProcessInputAndUpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\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 \"ProcessInputAndUpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessInputAndUpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","branch","bitwise","call","mmio"],"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"},{"name":"REG_KEYINPUT","shape":"scalar u16"}],"outcome":"nonmatch","source":"void ReadKeyInput(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = REG_KEYINPUT;\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 gAButtonHold = gAButtonHold + 1;\n }\n return;\n}\n","score":42,"maxScore":58,"compileErrors":null,"breakdown":{"insert":17,"delete":11,"replace":3,"opMismatch":1,"argMismatch":10},"quality":{"score":100,"lines":17,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","memory","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","memory","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","global","bitwise","call"],"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-0ySZ7J/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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetupBG3WindowOverlay:agbcc","sym":"SetupBG3WindowOverlay","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","memory","loop","shift","bitwise","soft-div","call","mmio","dma"],"loc":56,"refSource":"void SetupBG3WindowOverlay(void) {\n s32 var_r5;\n s32 var_r6;\n s32 var_r7;\n\n if (gUnk_030034BC == 0) {\n var_r7 = gUnk_03000800;\n } else {\n var_r7 = 0;\n }\n\n REG_IE &= ~INTR_FLAG_VBLANK;\n REG_DISPSTAT &= ~DISPSTAT_VBLANK_INTR;\n m4aSoundVSyncOff();\n\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & 0x7FFFFFFF, 0);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & 0x7FFFFFFF, 0);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n\n for (var_r5 = 0, var_r6 = 0; var_r5 < 0x21C; var_r6++, var_r5++) {\n if (((var_r5 % 30) == 0) && (var_r5 != 0)) {\n var_r6 += 2;\n }\n gBgTilemapBufs[gUnk_030034BC][var_r6] = gBgDataPtrs.pBufBg3Tilemap[var_r5 + 2] + var_r7;\n }\n\n REG_WIN1H = WIN_RANGE(0, 0xF0);\n REG_WIN1V = WIN_RANGE(0x1E, 0x90);\n\n if (gUnk_030034BC == 0) {\n REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_CLR | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;\n } else {\n REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;\n }\n\n if (gUnk_03004C20.level == 8) {\n gCallbackQueue.next[2] = AnimatePaletteEffects;\n } else {\n gCallbackQueue.next[2] = VBlankCallback_Gameplay;\n }\n gCallbackQueue.next[0] = ReadKeyInput;\n gCallbackQueue.next[1] = UpdateWorldMapInput;\n gCallbackQueue.next[3] = NULL + 1;\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = 4;\n\n DmaCopy16(3, gBgDataPtrs.pBufBg3Tiles + 4, gBgInfo[gUnk_030034BC].pTiles + (var_r7 << 5), 0xB80);\n\n REG_DISPCNT |= DISPCNT_WIN1_ON;\n REG_IE |= INTR_FLAG_VBLANK;\n REG_DISPSTAT |= DISPSTAT_VBLANK_INTR;\n m4aSoundVSyncOn();\n\n gUnk_03004C20.sceneFrameCounter = 0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1635-L1690","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-13fbdb507b65.i.gz","proto":{"SetupBG3WindowOverlay":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Elem0 { s32 field_0; u8 _pad0[24]; };\nstruct Struct0 { s32 field_0; u8 _pad0[8]; u8 field_12; };\nvoid SetupBG3WindowOverlay(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * v7;\n s32 v8;\n s32 v9;\n u16 * p0;\n s32 * p1;\n s32 * p2;\n p0 = (u16 *)®_WIN1H;\n p1 = (s32 *)&gCallbackQueue;\n p2 = (s32 *)®_DMA3SAD;\n if (gUnk_030034BC != 0) {\n v6 = 0;\n } else {\n v6 = gUnk_03000800;\n }\n REG_IE = 65534 & REG_IE;\n v0 = REG_DISPSTAT;\n REG_DISPSTAT = 65527 & v0;\n m4aSoundVSyncOff(65527 & v0, v0, ®_DISPSTAT);\n v1 = 2147483647;\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & v1, 0, ®_DISPSTAT);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & v1, 0, ®_DISPSTAT);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n v4 = 0;\n v5 = 0;\n do {\n if (v4 % 30 == 0 && v4 != 0) v5 = v5 + 2;\n *(u16 *)((v5 << 1) + (gUnk_030034BC << 11) + (u32)&gBgTilemapBufs) = ((u16 *)((v4 << 1) + gBgDataPtrs.pBufBg3Tilemap))[2] + v6;\n v5 = v5 + 1;\n v4 = v4 + 1;\n } while (v4 <= 539);\n *p0 = 240;\n p0[2] = 7824;\n if (gUnk_030034BC != 0) {\n v7 = (u16 *)®_WININ;\n v8 = 13601;\n } else {\n v7 = (u16 *)((u32)®_WIN1H + 4 + 2);\n v8 = 13857;\n }\n *v7 = v8;\n if (gUnk_03004C20.level != 8) {\n v9 = &VBlankCallback_Gameplay;\n } else {\n v9 = &AnimatePaletteEffects;\n }\n p1[12] = v9;\n p1[10] = &ReadKeyInput;\n p1[11] = &UpdateWorldMapInput;\n p1[13] = 1;\n v2 = 0;\n p1[gCallbackQueue.currentCount - 1] = v2;\n gCallbackQueue.nextCount = 4;\n *p2 = gBgDataPtrs.pBufBg3Tiles + 4;\n p2[1] = ((struct Elem0 *)&gBgInfo)[gUnk_030034BC].field_0 + (v6 << 5);\n p2[2] = -2147482176;\n *(u16 *)((u32)®_DMA3SAD - 212) = *(u16 *)((u32)®_DMA3SAD - 212) | 128 << 7;\n REG_IE = REG_IE | 1;\n v3 = REG_DISPSTAT;\n REG_DISPSTAT = v3 | 8;\n m4aSoundVSyncOn(v3 | 8, 8, ®_DISPSTAT, 128 << 7);\n gUnk_03004C20.sceneFrameCounter = v2;\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":74,"gotos":0,"casts":9,"unkGlue":0,"rawMem":3,"addrDeref":0},"errorMarkers":["no scorable candidate for 'SetupBG3WindowOverlay': agbcc failed: /c.c:1455: too many arguments to function `m4aSoundVSyncOff'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? Decompress(void *, u32 *); /* extern */\nu16 *thunk_HeapAlloc(s32, s32); /* extern */\n\nvoid SetupBG3WindowOverlay(void) {\n s16 *var_r1;\n s16 var_r0;\n s32 var_r5;\n s32 var_r6;\n u8 var_r7;\n void (*var_r0_2)();\n\n if (gUnk_030034BC == 0) {\n var_r7 = gUnk_03000800;\n } else {\n var_r7 = 0;\n }\n *(u16 *)0x04000200 &= 0xFFFE;\n *(u16 *)0x04000004 &= 0xFFF7;\n m4aSoundVSyncOff();\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & 0x7FFFFFFF, 0);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & 0x7FFFFFFF, 0);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n var_r5 = 0;\n var_r6 = 0;\n do {\n if (((var_r5 % 30) == 0) && (var_r5 != 0)) {\n var_r6 += 2;\n }\n *((var_r6 * 2) + (gUnk_030034BC << 0xB) + gBgTilemapBufs) = gBgDataPtrs.pBufBg3Tilemap[var_r5].unk4 + var_r7;\n var_r6 += 1;\n var_r5 += 1;\n } while (var_r5 <= 0x21B);\n (void *)0x04000042->unk0 = 0xF0;\n (void *)0x04000042->unk4 = 0x1E90;\n if (gUnk_030034BC == 0) {\n var_r1 = (void *)0x04000042 + 4 + 2;\n var_r0 = 0x3621;\n } else {\n var_r1 = (s16 *)0x04000048;\n var_r0 = 0x3521;\n }\n *var_r1 = var_r0;\n if (gUnk_03004C20.level == 8) {\n var_r0_2 = AnimatePaletteEffects;\n } else {\n var_r0_2 = VBlankCallback_Gameplay;\n }\n gCallbackQueue.next[2] = var_r0_2;\n gCallbackQueue.next[0] = ReadKeyInput;\n gCallbackQueue.next[1] = UpdateWorldMapInput;\n gCallbackQueue.next[3] = (void (*)())1;\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = 4;\n (void *)0x040000D4->unk0 = (void *) (gBgDataPtrs.pBufBg3Tiles + 4);\n (void *)0x040000D4->unk4 = (void *) (gBgInfo[gUnk_030034BC].pTiles + (var_r7 << 5));\n (void *)0x040000D4->unk8 = 0x800005C0;\n *(u16 *)0x04000000 |= 0x4000;\n *(void *)0x04000200 = (u16) (*(void *)0x04000200 | 1);\n *(void *)0x04000004 = (u16) (*(void *)0x04000004 | 8);\n m4aSoundVSyncOn();\n gUnk_03004C20.sceneFrameCounter = 0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":61,"gotos":0,"casts":19,"unkGlue":0,"rawMem":0,"addrDeref":7},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetupBG3WindowOverlay` — benchmark function kleod:SetupBG3WindowOverlay:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\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-13fbdb507b65.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid SetupBG3WindowOverlay(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetupBG3WindowOverlay # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBG3WindowOverlay` — benchmark function kleod:SetupBG3WindowOverlay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetupBG3WindowOverlay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\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 \"SetupBG3WindowOverlay\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBG3WindowOverlay # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","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":"match","source":"struct Elem0 { u8 _pad0[8]; u16 field_8; u16 field_10; u8 _pad1[16]; };\nvoid 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;\n}\n","score":0,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","shift","bitwise","mmio"],"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/raw-globals","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","arithmetic","switch","shift","bitwise","jump-table"],"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":"declined","source":"extern u16 gBg2XMag;\nextern u16 gBg2YMag;\nextern ? gUnk_03002920;\nextern ? gUnk_03003430;\nextern s32 gUnk_030051DC;\nextern ? gUnk_08078FC8;\n\nvoid TransformSingleEntityToScreen(u8 arg0, s8 arg1, s8 arg2) {\n s16 temp_r3;\n s16 temp_r5;\n s32 temp_r2;\n s32 temp_r7;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_4;\n s32 var_r1;\n u32 temp_r1;\n u8 temp_r0;\n void *temp_r0_2;\n void *temp_r4;\n void *var_r0_3;\n\n temp_r0 = arg0;\n temp_r7 = temp_r0 * 8;\n temp_r4 = (temp_r0 * 0x1C) + &gUnk_03002920;\n temp_r5 = (temp_r4->unk0 - arg1) - gUnk_03003430.unk40;\n temp_r4->unk4 = temp_r5;\n temp_r3 = (temp_r4->unk2 - arg2) - gUnk_03003430.unk42;\n temp_r4->unk6 = temp_r3;\n var_r0 = gBg2XMag * (s16) (gUnk_03003430.unk40 - temp_r5);\n if (var_r0 < 0) {\n var_r0 += 0xFF;\n }\n var_r0_2 = (s16) (u16) (gUnk_03003430.unk42 - temp_r3) * gBg2YMag;\n if (var_r0_2 < 0) {\n var_r0_2 += 0xFF;\n }\n temp_r2 = var_r0_2 >> 8;\n if ((u32) temp_r0 > 0xCU) {\n var_r0_3 = ((temp_r7 + gUnk_030051DC) - 0x68)->unk4;\n } else {\n var_r0_3 = *(temp_r7 + (&gUnk_08078FC8 + 4));\n }\n temp_r1 = 0xF & var_r0_3->unk5;\n switch (temp_r1) {\n case 3:\n case 11:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 3;\n break;\n case 1:\n case 6:\n case 8:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 5;\n break;\n case 0:\n case 4:\n case 5:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 6;\n break;\n default:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 4;\n break;\n }\n temp_r0_2 = (temp_r0 * 0x1C) + &gUnk_03002920;\n temp_r0_2->unk4 = (s16) (gUnk_03003430.unk40 - (var_r0 >> 8));\n temp_r0_2->unk6 = (s16) (var_r1 + var_r0_4);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":84,"lines":69,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateCameraScroll:agbcc","sym":"UpdateCameraScroll","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","branch","global","shift","bitwise","call"],"loc":99,"refSource":"void UpdateCameraScroll(void) {\n s32 temp_r2;\n s32 temp_r3_2;\n u16 var_r8;\n struct ScrollBGLayer_Args var_r6;\n u8 var_r7;\n\n var_r8 = 0;\n var_r7 = 0;\n var_r6.unk2 = var_r6.unk0 = 0;\n\n if (!(gUnk_030051B8 & 0x30)) {\n if ((s16)gUnk_03002920[0].xPosBg2 > (s16)(gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) {\n var_r7 = 0x10;\n if ((gUnk_03002920[0].xPosBg2 - (gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) > 5) {\n var_r6.unk0 = 2;\n } else {\n var_r6.unk0 = 1;\n }\n if (gHeldKeys & DPAD_LEFT) {\n var_r7 = 0;\n var_r6.unk0 = 0;\n }\n } else if ((s16)gUnk_03002920[0].xPosBg2 < (s16)(gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) {\n var_r7 = 0x20;\n if (((gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER) - gUnk_03002920[0].xPosBg2) > 5) {\n var_r6.unk0 = -2;\n } else {\n var_r6.unk0 = -1;\n }\n if (gHeldKeys & DPAD_RIGHT) {\n var_r7 = 0;\n var_r6.unk0 = 0;\n }\n }\n }\n if (!(gUnk_030051B8 & 0xC0)) {\n if (gUnk_03002920[0].yPosScreen > 0xA0) {\n var_r8 = 0x44;\n }\n if ((u16)(var_r8 + gUnk_03002920[0].yPosScreen) > 0x63) {\n var_r7 |= 0x80;\n if ((u16)((var_r8 + gUnk_03002920[0].yPosScreen) - 0x64) > 0x1E) {\n var_r6.unk2 = 3;\n } else {\n var_r6.unk2 = 1;\n }\n } else if ((u16)(var_r8 + gUnk_03002920[0].yPosScreen) <= 0x46) {\n var_r7 |= 0x40;\n if ((u16)(var_r8 - (gUnk_03002920[0].yPosScreen - 0x46)) > 0x19U) {\n var_r6.unk2 = -3;\n } else {\n var_r6.unk2 = -1;\n }\n }\n }\n\n var_r7 |= gUnk_030051B8;\n temp_r3_2 = gUnk_03005480 + gUnk_030034E8.unk0;\n temp_r2 = gUnk_030007C0 + gUnk_030034E8.unk4;\n var_r6.unk0 += (temp_r3_2 >> 0x10);\n var_r6.unk2 += (temp_r2 >> 0x10);\n gUnk_03005480 = temp_r3_2 & 0xFFFF;\n gUnk_030007C0 = temp_r2 & 0xFFFF;\n\n if (gUnk_03005220.deathSequenceTimer != 0) {\n var_r7 &= 0x30;\n var_r6.unk2 = var_r6.unk0 = 0;\n }\n\n if (var_r7 != 0) {\n ScrollBGLayer(var_r7, var_r6);\n }\n\n gUnk_03003430.bg1HOfs = (gUnk_03003430.bg2HOfs >> 1);\n if (!(gUnk_03004C20.globalFrameCounter & 3) && (gUnk_03004660 == 0)) {\n if (gUnk_03003430.bg2VOfs >= gPrevBg2VOfs) {\n gUnk_03003430.bg1VOfs += ((gUnk_03003430.bg2VOfs - gPrevBg2VOfs) & 1);\n } else {\n gUnk_03003430.bg1VOfs -= ((gPrevBg2VOfs - gUnk_03003430.bg2VOfs) & 1);\n }\n\n if (gUnk_03003430.bg1VOfs & 0x8000) {\n gUnk_03003430.bg1VOfs = 0;\n } else if (gUnk_03003430.bg1VOfs > 0x50) {\n gUnk_03003430.bg1VOfs = 0x50;\n }\n }\n\n gPrevBg2VOfs = gUnk_03003430.bg2VOfs;\n gBg2PA = MultiplyQ8(COS(gBg2Alpha), ReciprocalQ8(gBg2XMag));\n gBg2PB = MultiplyQ8(SIN(gBg2Alpha), ReciprocalQ8(gBg2XMag));\n gBg2PC = MultiplyQ8(-SIN(gBg2Alpha), ReciprocalQ8(gBg2YMag));\n gBg2PD = MultiplyQ8(COS(gBg2Alpha), ReciprocalQ8(gBg2YMag));\n gBg2X\n = (((gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER) << 8) - (gBg2PA * DISPLAY_WIDTH_CENTER)) - (gBg2PB * DISPLAY_HEIGHT_CENTER);\n gBg2Y = (((gUnk_03003430.bg2VOfs + DISPLAY_HEIGHT_CENTER) << 8) - (gBg2PC * DISPLAY_WIDTH_CENTER))\n - (gBg2PD * DISPLAY_HEIGHT_CENTER);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/engine.c#L571-L669","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-c68b94e46656.i.gz","proto":{"UpdateCameraScroll":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateCameraScroll' — lift: cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' 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\tUpdateCameraScroll */\n/* \t.type\t UpdateCameraScroll,function */\n/* \t.thumb_func */\n/* UpdateCameraScroll: */\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/* \tmov\tr0, #0x0 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr1, .L35 */\n/* \tmov\tsl, r1 */\n/* \tmov\tr6, #0x0 */\n/* \tldr\tr2, .L35+0x4 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x30 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldr\tr4, .L35+0x8 */\n/* \tldr\tr0, .L35+0xc */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x40 */\n/* \tldrh\tr0, [r3] */\n/* \tmov\tr5, #0x78 */\n/* \tadd\tr5, r5, r0 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr1, [r4, r0] */\n/* \tlsl\tr5, r5, #0x10 */\n/* \tasr\tr0, r5, #0x10 */\n/* \tcmp\tr1, r0 */\n/* \tble\t.L4\t@cond_branch */\n/* \tmov\tr7, #0x10 */\n/* \tldrh\tr0, [r4] */\n/* \tsub\tr0, r0, #0x78 */\n/* \tldrh\tr1, [r3] */\n/* \tsub\tr0, r0, r1 */\n/* \tcmp\tr0, #0x5 */\n/* \tble\t.L5\t@cond_branch */\n/* \tmov\tr6, #0x2 */\n/* \tb\t.L6 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_030051B8 */\n/* \t.word\tgUnk_03002920 */\n/* \t.word\tgUnk_03003430 */\n/* .L5: */\n/* \tmov\tr1, sl */\n/* \tand\tr6, r6, r1 */\n/* \tmov\tr0, #0x1 */\n/* \torr\tr6, r6, r0 */\n/* .L6: */\n/* \tldr\tr0, .L37 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x20 */\n/* \tb\t.L30 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgHeldKeys */\n/* .L4: */\n/* \tcmp\tr1, r0 */\n/* \tbge\t.L3\t@cond_branch */\n/* \tmov\tr7, #0x20 */\n/* \tldrh\tr1, [r3] */\n/* \tldrh\tr0, [r4] */\n/* \tsub\tr0, r0, #0x78 */\n/* \tsub\tr1, r1, r0 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L10\t@cond_branch */\n/* \tmov\tr5, sl */\n/* \tand\tr6, r6, r5 */\n/* \tldr\tr0, .L39 */\n/* \tb\t.L31 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\t0xfffe */\n/* .L10: */\n/* \tldr\tr0, .L41 */\n/* .L31: */\n/* \torr\tr6, r6, r0 */\n/* \tldr\tr0, .L41+0x4 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x10 */\n/* .L30: */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr0, .L41+0x8 */\n/* \tand\tr6, r6, r0 */\n/* .L3: */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0xc0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L13\t@cond_branch */\n/* \tldr\tr0, .L41+0xc */\n/* \tldrh\tr1, [r0, #0x6] */\n/* \tcmp\tr1, #0xa0 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x44 */\n/* \tmov\tr8, r0 */\n/* .L14: */\n/* \tmov\tr5, r8 */\n/* \tadd\tr3, r5, r1 */\n/* \tlsl\tr0, r3, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x63 */\n/* \tbls\t.L15\t@cond_branch */\n/* \tmov\tr0, #0x80 */\n/* \torr\tr7, r7, r0 */\n/* \tadd\tr0, r3, #0 */\n/* \tsub\tr0, r0, #0x64 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x1e */\n/* \tbls\t.L16\t@cond_branch */\n/* \tldr\tr0, .L41 */\n/* \tand\tr6, r6, r0 */\n/* \tmov\tr0, #0xc0 */\n/* \tlsl\tr0, r0, #0xa */\n/* \tb\t.L32 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\t0xffff */\n/* \t.word\tgHeldKeys */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_03002920 */\n/* .L16: */\n/* \tldr\tr0, .L43 */\n/* \tand\tr6, r6, r0 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tb\t.L32 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\t0xffff */\n/* .L15: */\n/* \tcmp\tr0, #0x46 */\n/* \tbhi\t.L13\t@cond_branch */\n/* \tmov\tr0, #0x40 */\n/* \torr\tr7, r7, r0 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr7, r0, #0x18 */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, #0x46 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x19 */\n/* \tbls\t.L20\t@cond_branch */\n/* \tldr\tr0, .L45 */\n/* \tand\tr6, r6, r0 */\n/* \tldr\tr0, .L45+0x4 */\n/* \tb\t.L32 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\t0xffff */\n/* \t.word\t-0x30000 */\n/* .L20: */\n/* \tldr\tr0, .L47 */\n/* .L32: */\n/* \torr\tr6, r6, r0 */\n/* .L13: */\n/* \tldrb\tr0, [r2] */\n/* \torr\tr7, r7, r0 */\n/* \tldr\tr5, .L47+0x4 */\n/* \tldr\tr1, .L47+0x8 */\n/* \tldr\tr3, [r5] */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r3, r0 */\n/* \tldr\tr4, .L47+0xc */\n/* \tldr\tr2, [r4] */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tadd\tr2, r2, r0 */\n/* \tasr\tr0, r3, #0x10 */\n/* \tadd\tr0, r6, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tldr\tr1, .L47 */\n/* \tmov\tr8, r1 */\n/* \tand\tr6, r6, r1 */\n/* \torr\tr6, r6, r0 */\n/* \tlsr\tr0, r6, #0x10 */\n/* \tasr\tr1, r2, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tldr\tr1, .L47+0x10 */\n/* \tand\tr6, r6, r1 */\n/* \torr\tr6, r6, r0 */\n/* \tand\tr3, r3, r1 */\n/* \tstr\tr3, [r5] */\n/* \tand\tr2, r2, r1 */\n/* \tstr\tr2, [r4] */\n/* \tldr\tr0, .L47+0x14 */\n/* \tadd\tr0, r0, #0x46 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L22\t@cond_branch */\n/* \tmov\tr0, #0x30 */\n/* \tand\tr7, r7, r0 */\n/* \tmov\tr6, #0x0 */\n/* .L22: */\n/* \tcmp\tr7, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr1, r6, #0 */\n/* \tbl\tScrollBGLayer */\n/* .L23: */\n/* \tldr\tr2, .L47+0x18 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x40 */\n/* \tldrh\tr0, [r0] */\n/* \tlsr\tr0, r0, #0x1 */\n/* \tstrh\tr0, [r2, #0x24] */\n/* \tldr\tr0, .L47+0x1c */\n/* \tldr\tr1, [r0, #0x4] */\n/* \tmov\tr0, #0x3 */\n/* \tand\tr1, r1, r0 */\n/* \tadd\tr7, r2, #0 */\n/* \tldr\tr2, .L47+0x20 */\n/* \tcmp\tr1, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tldr\tr0, .L47+0x24 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tldrh\tr0, [r2] */\n/* \tcmp\tr1, r0 */\n/* \tbcc\t.L25\t@cond_branch */\n/* \tsub\tr0, r1, r0 */\n/* \tmov\tr1, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tadd\tr1, r1, r0 */\n/* \tb\t.L33 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_03005480 */\n/* \t.word\tgUnk_030034E8 */\n/* \t.word\tgUnk_030007C0 */\n/* \t.word\t0xffff */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgUnk_03003430 */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgPrevBg2VOfs */\n/* \t.word\tgUnk_03004660 */\n/* .L25: */\n/* \tsub\tr0, r0, r1 */\n/* \tmov\tr1, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tsub\tr1, r1, r0 */\n/* .L33: */\n/* \tstrh\tr1, [r7, #0x26] */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L34 */\n/* .L27: */\n/* \tlsl\tr0, r1, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x50 */\n/* \tbls\t.L24\t@cond_branch */\n/* \tmov\tr0, #0x50 */\n/* .L34: */\n/* \tstrh\tr0, [r7, #0x26] */\n/* .L24: */\n/* \tldr\tr5, .L49 */\n/* \tldrh\tr0, [r5] */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr0, .L49+0x4 */\n/* \tmov\tr8, r0 */\n/* \tldr\tr5, .L49+0x8 */\n/* \tldrb\tr0, [r5] */\n/* \tadd\tr0, r0, #0x40 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr4, [r0, r1] */\n/* \tldr\tr6, .L49+0xc */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x10 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr4, [r0, r1] */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x14 */\n/* \tmov\tsl, r1 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tldrh\tr4, [r0] */\n/* \tneg\tr4, r4 */\n/* \tlsl\tr4, r4, #0x10 */\n/* \tasr\tr4, r4, #0x10 */\n/* \tldr\tr6, .L49+0x18 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x1c */\n/* \tmov\tr9, r1 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tadd\tr0, r0, #0x40 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr4, [r0, r5] */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr4, .L49+0x20 */\n/* \tstrh\tr0, [r4] */\n/* \tldr\tr3, .L49+0x24 */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr0, r0, #0x40 */\n/* \tldrh\tr1, [r0] */\n/* \tadd\tr1, r1, #0x78 */\n/* \tlsl\tr1, r1, #0x8 */\n/* \tldr\tr5, .L49+0x10 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r5, r0] */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tsub\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tsub\tr1, r1, r0 */\n/* \tmov\tr5, sl */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r5, r0] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tsub\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\n/* \tldr\tr3, .L49+0x28 */\n/* \tldr\tr5, .L49 */\n/* \tldrh\tr1, [r5] */\n/* \tadd\tr1, r1, #0x50 */\n/* \tlsl\tr1, r1, #0x8 */\n/* \tmov\tr0, r9 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr2, [r0, r5] */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tsub\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tsub\tr1, r1, r0 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r4, r0] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tsub\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\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/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03003430+0x42 */\n/* \t.word\tgSineTable */\n/* \t.word\tgBg2Alpha */\n/* \t.word\tgBg2XMag */\n/* \t.word\tgBg2PA */\n/* \t.word\tgBg2PB */\n/* \t.word\tgBg2YMag */\n/* \t.word\tgBg2PC */\n/* \t.word\tgBg2PD */\n/* \t.word\tgBg2X */\n/* \t.word\tgBg2Y */\n/* .Lfe1: */\n/* \t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateCameraScroll(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' is a symbol offset or code label — not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":434,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' is a symbol offset or code label — not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void UpdateCameraScroll(void) {\n s16 temp_r0;\n s16 temp_r4;\n s16 temp_r4_2;\n s16 temp_r4_3;\n s16 temp_r4_4;\n s32 temp_r2;\n s32 temp_r3_2;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_3;\n s32 var_r6_2;\n s32 var_r8;\n u16 temp_r0_2;\n u16 temp_r3;\n u16 temp_r6;\n u16 var_r0_4;\n u16 var_r1;\n u16 var_r6;\n u8 var_r7;\n u8 var_r7_2;\n\n var_r8 = 0;\n var_r7 = 0;\n var_r6 = 0;\n if (!(0x30 & gUnk_030051B8)) {\n temp_r0 = gUnk_03003430.bg2HOfs + 0x78;\n if ((s32) (s16) gUnk_03002920->xPosBg2 > (s32) temp_r0) {\n var_r7 = 0x10;\n if ((s32) ((gUnk_03002920->xPosBg2 - 0x78) - gUnk_03003430.bg2HOfs) > 5) {\n var_r6 = 2;\n } else {\n var_r6 = (0 & 0xFFFF0000) | 1;\n }\n var_r0 = 0x20;\n goto block_11;\n }\n if ((s32) (s16) gUnk_03002920->xPosBg2 < (s32) temp_r0) {\n var_r7 = 0x20;\n if ((s32) (gUnk_03003430.bg2HOfs - (gUnk_03002920->xPosBg2 - 0x78)) > 5) {\n var_r6 = 0 & 0xFFFF0000;\n var_r0_2 = 0xFFFE;\n } else {\n var_r0_2 = 0xFFFF;\n }\n var_r6 |= var_r0_2;\n var_r0 = 0x10;\nblock_11:\n if (var_r0 & gHeldKeys) {\n var_r7 = 0;\n var_r6 &= 0xFFFF0000;\n }\n }\n }\n if (!(0xC0 & gUnk_030051B8)) {\n if ((u32) gUnk_03002920->yPosScreen > 0xA0U) {\n var_r8 = 0x44;\n }\n temp_r3 = var_r8 + gUnk_03002920->yPosScreen;\n temp_r0_2 = temp_r3;\n if ((u32) temp_r0_2 > 0x63U) {\n var_r7 |= 0x80;\n if ((u32) (u16) (temp_r3 - 0x64) > 0x1EU) {\n var_r6 = var_r6;\n var_r0_3 = 0x30000;\n } else {\n var_r6 = var_r6;\n var_r0_3 = 0x10000;\n }\n goto block_24;\n }\n if ((u32) temp_r0_2 <= 0x46U) {\n var_r7 |= 0x40;\n if ((u32) (u16) ((var_r8 + 0x46) - gUnk_03002920->yPosScreen) > 0x19U) {\n var_r6 = var_r6;\n var_r0_3 = 0xFFFD0000;\n } else {\n var_r0_3 = 0xFFFF0000;\n }\nblock_24:\n var_r6 |= var_r0_3;\n }\n }\n var_r7_2 = var_r7 | gUnk_030051B8;\n temp_r3_2 = gUnk_03005480 + gUnk_030034E8.unk0;\n temp_r2 = gUnk_030007C0 + gUnk_030034E8.unk4;\n temp_r6 = (var_r6 & 0xFFFF0000) | (u16) (var_r6 + (temp_r3_2 >> 0x10));\n var_r6_2 = temp_r6 | (((temp_r6 >> 0x10) + (temp_r2 >> 0x10)) << 0x10);\n gUnk_03005480 = (s32) (u16) temp_r3_2;\n gUnk_030007C0 = (s32) (u16) temp_r2;\n if (gUnk_03005220.deathSequenceTimer != 0) {\n var_r7_2 &= 0x30;\n var_r6_2 = 0;\n }\n if (var_r7_2 != 0) {\n ScrollBGLayer(var_r7_2, (struct ScrollBGLayer_Args) var_r6_2);\n }\n gUnk_03003430.bg1HOfs = (u16) ((u16) gUnk_03003430.bg2HOfs >> 1);\n if (!(gUnk_03004C20.globalFrameCounter & 3) && (gUnk_03004660 == 0)) {\n if ((u32) gUnk_03003430.bg2VOfs >= (u32) gPrevBg2VOfs) {\n var_r1 = gUnk_03003430.bg1VOfs + ((gUnk_03003430.bg2VOfs - gPrevBg2VOfs) & 1);\n } else {\n var_r1 = gUnk_03003430.bg1VOfs - ((gPrevBg2VOfs - gUnk_03003430.bg2VOfs) & 1);\n }\n gUnk_03003430.bg1VOfs = var_r1;\n if (0x8000 & gUnk_03003430.bg1VOfs) {\n var_r0_4 = 0;\n goto block_38;\n }\n if ((u32) (u16) gUnk_03003430.bg1VOfs > 0x50U) {\n var_r0_4 = 0x50;\nblock_38:\n gUnk_03003430.bg1VOfs = var_r0_4;\n }\n }\n gPrevBg2VOfs = gUnk_03003430.bg2VOfs;\n temp_r4 = gSineTable[gBg2Alpha + 0x40];\n gBg2PA = MultiplyQ8(temp_r4, ReciprocalQ8((s16) gBg2XMag));\n temp_r4_2 = gSineTable[gBg2Alpha];\n gBg2PB = MultiplyQ8(temp_r4_2, ReciprocalQ8((s16) gBg2XMag));\n temp_r4_3 = 0 - (u16) gSineTable[gBg2Alpha];\n gBg2PC = MultiplyQ8(temp_r4_3, ReciprocalQ8((s16) gBg2YMag));\n temp_r4_4 = gSineTable[gBg2Alpha + 0x40];\n gBg2PD = MultiplyQ8(temp_r4_4, ReciprocalQ8((s16) gBg2YMag));\n gBg2X = (((gUnk_03003430.bg2HOfs + 0x78) << 8) - (gBg2PA * 0x78)) - (gBg2PB * 0x50);\n gBg2Y = (((gUnk_03003430.bg2VOfs + 0x50) << 8) - (gBg2PC * 0x78)) - (gBg2PD * 0x50);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":126,"gotos":3,"casts":29,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1200: conversion to non-scalar type requested"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateCameraScroll` — benchmark function kleod:UpdateCameraScroll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\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-c68b94e46656.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateCameraScroll(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateCameraScroll # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateCameraScroll` — benchmark function kleod:UpdateCameraScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateCameraScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\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 \"UpdateCameraScroll\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateCameraScroll # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["branch","cast","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","shift","bitwise","call","mmio"],"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/argbase","symbolsUsed":[{"name":"gEntityArray","shape":"u8[]"},{"name":"REG_BLDALPHA","shape":"scalar u16"}],"outcome":"match","source":"void UpdateFadeEffect(void) {\n s32 v0;\n u8 * p0;\n u8 * p1;\n p0 = (u8 *)67108870;\n p1 = (u8 *)gEntityArray;\n v0 = sub_08051A0C(*p0, p1[8]);\n if ((u8)v0 <= 16) REG_BLDALPHA = (u8)v0 << 8 | (u8)v0;\n return;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":92,"lines":10,"gotos":0,"casts":6,"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"loc":35,"refSource":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_sb;\n\n var_sb = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n if (var_r5 == gUnk_03005220.dreamStones) {\n var_sb = 1;\n }\n\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 1;\n if (gUnk_03005220.dreamStones > 0x63) {\n gBgTilemapBufs[0][0x252] += 0;\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] += 0;\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5 = 0;\n }\n\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][0x254 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x292];\n gBgTilemapBufs[0][0x274 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x2B2];\n }\n\n gBgTilemapBufs[0][0x255 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x292];\n gBgTilemapBufs[0][0x275 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x2B2];\n return var_sb;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1184-L1218","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/defsite/scopebase-coalesce-v2-v4","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-q08N9S/c.c:1085: incompatible types in assignment"},{"label":"unsigned/coalesce-v2-v3/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kVtPjs/c.c:1084: incompatible types in assignment"},{"label":"unsigned/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-xZOlxN/c.c:1084: incompatible types in assignment"},{"label":"unsigned/defsite/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-26kOPm/c.c:1086: incompatible types in assignment"},{"label":"unsigned/defsite/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-f2VLeO/c.c:1085: incompatible types in assignment"},{"label":"signed/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-WF9nHM/c.c:1085: incompatible types in assignment"},{"label":"signed/coalesce-v2-v3/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-mDzvDo/c.c:1084: incompatible types in assignment"},{"label":"signed/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-PK7L0x/c.c:1084: incompatible types in assignment"},{"label":"signed/defsite/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-yiEeM7/c.c:1086: incompatible types in assignment"},{"label":"signed/defsite/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kiF7nl/c.c:1085: incompatible types in assignment"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03004C20","shape":"struct Unk_03004C20 (24 B)"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"match","source":"s32 UpdateHUDCounterDisplay(u32 a0, u32 a1) {\n s32 v3;\n s32 v4;\n u16 * p0;\n v3 = 0;\n if (gUnk_03004C20.unkA == 1 || gUnk_03004C20.level == 6) {\n v4 = 100;\n } else {\n v4 = 30;\n }\n if (v4 == gUnk_03005220.dreamStones) v3 = 1;\n if (gUnk_03004C20.unkA == 1 || gUnk_03004C20.level == 6) {\n v4 = 1;\n if (gUnk_03005220.dreamStones > 99) {\n p0 = (u16 *)&gBgTilemapBufs;\n p0[594] = p0[659];\n p0[626] = p0[691];\n }\n } else {\n v4 = 0;\n }\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][(149 << 2) - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones / 10 + 658];\n gBgTilemapBufs[0][(157 << 2) - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones / 10 + 690];\n }\n gBgTilemapBufs[0][597 - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones % 10 + 658];\n gBgTilemapBufs[0][629 - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones % 10 + 690];\n return v3;\n}\n","score":0,"maxScore":136,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":29,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_r5_2;\n s32 var_r9;\n u32 temp_r0;\n u32 temp_r2;\n\n var_r9 = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n temp_r2 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if (var_r5 == temp_r2) {\n var_r9 = 1;\n }\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5_2 = 1;\n if ((s32) temp_r2 > 0x63) {\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5_2 = 0;\n }\n temp_r0 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if ((s32) temp_r0 > 9) {\n gBgTilemapBufs->unk0[0x254 - var_r5_2] = gBgTilemapBufs->unk0[((s32) temp_r0 / 10) + 0x292];\n gBgTilemapBufs->unk0[0x274 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) / 10) + 0x2B2];\n }\n gBgTilemapBufs->unk0[0x255 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x292];\n gBgTilemapBufs->unk0[0x275 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x2B2];\n return var_r9;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1085: invalid operands to binary <<","/c.c:1098: invalid operands to binary <<","/c.c:1100: request for member `unk0' in something not a structure or union","/c.c:1101: request for member `unk0' in something not a structure or union","/c.c:1101: invalid operands to binary <<"]},"gapSize":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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateWorldMapNodeAnim:agbcc","sym":"UpdateWorldMapNodeAnim","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","switch","shift","soft-div","call","mmio","dma","jump-table"],"loc":76,"refSource":"void UpdateWorldMapNodeAnim(void) {\n s32 var_r7;\n s32 temp_r6;\n\n if (gUnk_03004C08.unk0_0 < 4) {\n var_r7 = 0;\n temp_r6 = gUnk_08116880[gUnk_03004C08.unk0_0];\n } else {\n var_r7 = 4;\n temp_r6 = gUnk_08116880[gUnk_03004C08.unk0_0];\n }\n\n switch ((gUnk_03004C08.unk2 / 30) - 1) {\n case 0:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][0] + (gUnk_08116748[gUnk_03004C08.unk0_0][1] << 5)]\n = gBgTilemapBufs[1][0 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n break;\n\n case 1:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][2] + (gUnk_08116748[gUnk_03004C08.unk0_0][3] << 5)]\n = gBgTilemapBufs[1][1 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n break;\n\n case 2:\n if (gUnk_03004C08.unk0_0 == 6) {\n gUnk_03004C08.unk2 = 0x95;\n } else {\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][4] + (gUnk_08116748[gUnk_03004C08.unk0_0][5] << 5)]\n = gBgTilemapBufs[1][2 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n }\n break;\n\n case 3:\n if ((gUnk_03004C08.unk0_0 != 4) && (gUnk_03004C08.unk0_0 != 6)) {\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][6] + (gUnk_08116748[gUnk_03004C08.unk0_0][7] << 5)]\n = gBgTilemapBufs[1][3 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n }\n break;\n\n case 4:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x8A);\n }\n /* fallthrough */\n case 5:\n case 6:\n if (gUnk_03004C08.unk0_0 < 4) {\n if ((gUnk_03004C20.sceneFrameCounter % 4) == 0) {\n DmaCopy16(3, &gUnk_08116780[thunk_sub_080002A0() % 8], BG_PLTT + 0x160, 0x20);\n SetWorldMapTilePalette(gUnk_03004C08.unk0_0, 0xB);\n }\n } else {\n CopyWorldMapTiles(gUnk_03004C08.unk0_0);\n }\n break;\n\n case 7:\n CopyWorldMapTiles(gUnk_03004C08.unk0_0);\n gCallbackQueue.current[1] = CountCollectedGems;\n break;\n }\n\n gUnk_03004C08.unk2 += 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1980-L2055","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\n\n.text\n\t.align\t2, 0\n","proto":{"UpdateWorldMapNodeAnim":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateWorldMapNodeAnim' — lift: cannot lift 'UpdateWorldMapNodeAnim': 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\tUpdateWorldMapNodeAnim */\n/* \t.type\t UpdateWorldMapNodeAnim,function */\n/* \t.thumb_func */\n/* UpdateWorldMapNodeAnim: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tldr\tr0, .L31 */\n/* \tldr\tr1, [r0] */\n/* \tlsl\tr2, r1, #0x1c */\n/* \tlsr\tr1, r2, #0x1c */\n/* \tadd\tr3, r0, #0 */\n/* \tcmp\tr1, #0x3 */\n/* \tbhi\t.L4\t@cond_branch */\n/* \tmov\tr7, #0x0 */\n/* \tb\t.L28 */\n/* .L32: */\n/* \t.align\t2, 0 */\n/* .L31: */\n/* \t.word\tgUnk_03004C08 */\n/* .L4: */\n/* \tmov\tr7, #0x4 */\n/* .L28: */\n/* \tldr\tr1, .L33 */\n/* \tlsr\tr0, r2, #0x1c */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr6, [r0] */\n/* \tldrb\tr0, [r3, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__udivsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tsub\tr0, r0, #0x1 */\n/* \tcmp\tr0, #0x7 */\n/* \tbls\t.LCB48 */\n/* \tb\t.L6\t@long jump */\n/* .LCB48: */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tldr\tr1, .L33+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L34: */\n/* \t.align\t2, 0 */\n/* .L33: */\n/* \t.word\tgUnk_08116880 */\n/* \t.word\t.L26 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L26: */\n/* \t.word\t.L7 */\n/* \t.word\t.L9 */\n/* \t.word\t.L11 */\n/* \t.word\t.L15 */\n/* \t.word\t.L18 */\n/* \t.word\t.L21 */\n/* \t.word\t.L21 */\n/* \t.word\t.L25 */\n/* .L7: */\n/* \tldr\tr4, .L35 */\n/* \tldrb\tr0, [r4, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L8: */\n/* \tldr\tr3, .L35+0x4 */\n/* \tldr\tr1, .L35+0x8 */\n/* \tldr\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr2, r0, #0x19 */\n/* \tadd\tr2, r2, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr1, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\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\tr3, r3, r0 */\n/* \tadd\tr1, r1, r3 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r7, r0 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tb\t.L29 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L9: */\n/* \tldr\tr5, .L37 */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L10: */\n/* \tldr\tr4, .L37+0x4 */\n/* \tldr\tr2, .L37+0x8 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x2 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x3 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tb\t.L30 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L11: */\n/* \tldr\tr5, .L39 */\n/* \tldrb\tr1, [r5] */\n/* \tmov\tr0, #0xf */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x6 */\n/* \tbne\t.L12\t@cond_branch */\n/* \tmov\tr0, #0x95 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tb\t.L6 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03004C08 */\n/* .L12: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L14: */\n/* \tldr\tr4, .L41 */\n/* \tldr\tr2, .L41+0x4 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x4 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x5 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x2 */\n/* \tb\t.L30 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L15: */\n/* \tldr\tr5, .L43 */\n/* \tldrb\tr0, [r5] */\n/* \tmov\tr1, #0xf */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0x4 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tcmp\tr1, #0x6 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L17: */\n/* \tldr\tr4, .L43+0x4 */\n/* \tldr\tr2, .L43+0x8 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x6 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x7 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x3 */\n/* .L30: */\n/* \tadd\tr0, r7, r0 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* .L29: */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tb\t.L6 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L18: */\n/* \tldr\tr0, .L45 */\n/* \tldrb\tr0, [r0, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L21\t@cond_branch */\n/* \tmov\tr0, #0x8a */\n/* \tbl\tm4aSongNumStart */\n/* .L21: */\n/* \tldr\tr5, .L45 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr1, r0, #0x1c */\n/* \tlsr\tr0, r1, #0x1c */\n/* \tcmp\tr0, #0x3 */\n/* \tbhi\t.L22\t@cond_branch */\n/* \tldr\tr0, .L45+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tr1, #0x3 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L6\t@cond_branch */\n/* \tldr\tr4, .L45+0x8 */\n/* \tbl\tthunk_sub_080002A0 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tmov\tr1, #0xe0 */\n/* \tlsl\tr1, r1, #0x13 */\n/* \tand\tr1, r1, r0 */\n/* \tlsr\tr1, r1, #0x13 */\n/* \tldr\tr0, .L45+0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tstr\tr1, [r4] */\n/* \tldr\tr0, .L45+0x10 */\n/* \tstr\tr0, [r4, #0x4] */\n/* \tldr\tr0, .L45+0x14 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr0, r0, #0x1c */\n/* \tmov\tr1, #0xb */\n/* \tbl\tSetWorldMapTilePalette */\n/* \tb\t.L6 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgUnk_08116780 */\n/* \t.word\t0x5000160 */\n/* \t.word\t-0x7ffffff0 */\n/* .L22: */\n/* \tlsr\tr0, r1, #0x1c */\n/* \tbl\tCopyWorldMapTiles */\n/* \tb\t.L6 */\n/* .L25: */\n/* \tldr\tr0, .L47 */\n/* \tldr\tr0, [r0] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr0, r0, #0x1c */\n/* \tbl\tCopyWorldMapTiles */\n/* \tldr\tr1, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tstr\tr0, [r1, #0x4] */\n/* .L6: */\n/* \tldr\tr1, .L47 */\n/* \tldrb\tr0, [r1, #0x2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0x2] */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tCountCollectedGems */\n/* .Lfe1: */\n/* \t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateWorldMapNodeAnim(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateWorldMapNodeAnim': 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":341,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateWorldMapNodeAnim': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? CopyWorldMapTiles(u32); /* extern */\n? SetWorldMapTilePalette(u32, s32); /* extern */\n? m4aSongNumStart(s32); /* extern */\ns32 thunk_sub_080002A0(); /* extern */\nextern ? CountCollectedGems;\nextern ? gBgTilemapBufs;\nextern ? gCallbackQueue;\nextern ? gUnk_03004C08;\nextern s32 gUnk_03004C20;\nextern ? gUnk_08116748;\nextern ? gUnk_08116780;\nextern ? gUnk_08116880;\n\nvoid UpdateWorldMapNodeAnim(void) {\n s32 temp_r1;\n s32 var_r0_2;\n s32 var_r7;\n u16 *var_r0;\n u16 *var_r1;\n u32 temp_r0;\n u32 temp_r0_2;\n u32 temp_r0_3;\n u32 temp_r0_4;\n u32 temp_r0_5;\n u32 temp_r1_2;\n u32 temp_r2;\n u8 temp_r6;\n void *temp_r3;\n void *var_r4;\n\n temp_r2 = gUnk_03004C08.unk0 << 0x1C;\n if ((u32) (temp_r2 >> 0x1C) <= 3U) {\n var_r7 = 0;\n } else {\n var_r7 = 4;\n }\n temp_r6 = *((temp_r2 >> 0x1C) + &gUnk_08116880);\n temp_r0 = (u8) ((u8) gUnk_03004C08.unk2 / 30U) - 1;\n switch (temp_r0) { /* irregular */\n case 0:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_2 = gUnk_03004C08.unk0 << 0x1C;\n temp_r3 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_2 >> 0x19) + (&gUnk_08116748 + 1)) << 5) + *((temp_r0_2 >> 0x19) + &gUnk_08116748)) * 2) + temp_r3;\n var_r0 = ((var_r7 + ((temp_r6 + 0x1C) << 5)) * 2) + temp_r3;\nblock_23:\n *var_r1 = *var_r0;\n break;\n case 1:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_3 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_3 >> 0x19) + (&gUnk_08116748 + 3)) << 5) + *((temp_r0_3 >> 0x19) + (&gUnk_08116748 + 2))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 1;\nblock_22:\n var_r0 = ((var_r7 + var_r0_2) * 2) + var_r4;\n goto block_23;\n case 2:\n if ((0xF & (u8) gUnk_03004C08.unk0) == 6) {\n gUnk_03004C08.unk2 = 0x95U;\n } else {\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_4 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_4 >> 0x19) + (&gUnk_08116748 + 5)) << 5) + *((temp_r0_4 >> 0x19) + (&gUnk_08116748 + 4))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 2;\n goto block_22;\n }\n break;\n case 3:\n temp_r1 = 0xF & (u8) gUnk_03004C08.unk0;\n if ((temp_r1 != 4) && (temp_r1 != 6)) {\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_5 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_5 >> 0x19) + (&gUnk_08116748 + 7)) << 5) + *((temp_r0_5 >> 0x19) + (&gUnk_08116748 + 6))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 3;\n goto block_22;\n }\n break;\n case 4:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x8A);\n }\n /* fallthrough */\n case 5:\n case 6:\n temp_r1_2 = gUnk_03004C08.unk0 << 0x1C;\n if ((u32) (temp_r1_2 >> 0x1C) <= 3U) {\n if (!(gUnk_03004C20 & 3)) {\n (void *)0x040000D4->unk0 = (void *) (((u32) (0x07000000 & (thunk_sub_080002A0() << 0x18)) >> 0x13) + &gUnk_08116780);\n (void *)0x040000D4->unk4 = 0x05000160;\n (void *)0x040000D4->unk8 = 0x80000010;\n SetWorldMapTilePalette((u32) (gUnk_03004C08.unk0 << 0x1C) >> 0x1C, 0xB);\n }\n } else {\n CopyWorldMapTiles(temp_r1_2 >> 0x1C);\n }\n break;\n case 7:\n CopyWorldMapTiles((u32) (gUnk_03004C08.unk0 << 0x1C) >> 0x1C);\n gCallbackQueue.unk4 = &CountCollectedGems;\n break;\n }\n gUnk_03004C08.unk2 = (u8) (gUnk_03004C08.unk2 + 1);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":56,"lines":112,"gotos":3,"casts":22,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateWorldMapNodeAnim` — benchmark function kleod:UpdateWorldMapNodeAnim:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateWorldMapNodeAnim # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeAnim` — benchmark function kleod:UpdateWorldMapNodeAnim:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateWorldMapNodeAnim:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\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 \"UpdateWorldMapNodeAnim\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeAnim # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","shift","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","pointer","memory","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel CameraScissorSet\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x3\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x4\n lui\t$v1, %hi(gCameraList)\n lw\t$v1, %lo(gCameraList)($v1)\n addu\t$v0, $v0, $v1\n lwc1\t$f0, 0($a1)\n swc1\t$f0, 144($v0)\n lwc1\t$f0, 4($a1)\n swc1\t$f0, 148($v0)\n lwc1\t$f0, 8($a1)\n swc1\t$f0, 152($v0)\n lwc1\t$f0, 12($a1)\n jr\t$ra\n swc1\t$f0, 156($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CameraScissorSet(s16 camIndex, RectF *arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CameraScissorSet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:ContDataUpdate:gcc2.7.2","sym":"ContDataUpdate","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["array","global","branch","loop","shift","bitwise"],"loc":50,"refSource":"void ContDataUpdate(void) {\n s16 i;\n s32 temp_v0_3;\n s32 temp_v0_5;\n u16 var_a2;\n s8 temp_v0_2;\n s8 temp_v0_4;\n\n for (i = 0; i < MAXCONTROLLERS; ++i) {\n D_800D1350_D1F50[i] = D_800D5546_D6146[i];\n var_a2 = D_800CDA7C_CE67C[i];\n temp_v0_2 = D_800CBB6E_CC76E[i];\n temp_v0_3 = ((temp_v0_2 >> 7) | 1);\n\n if (((temp_v0_2 * temp_v0_3) - 0x1E) > 0) {\n if (temp_v0_3 > 0) {\n var_a2 = (var_a2 & 0xFDFF) | 0x100;\n } else {\n var_a2 = (var_a2 & 0xFEFF) | 0x200;\n }\n }\n\n temp_v0_4 = D_800D20A1_D2CA1[i];\n temp_v0_5 = ((temp_v0_4 >> 7) | 1);\n\n if (((temp_v0_4 * temp_v0_5) - 0x1E) > 0) {\n if (temp_v0_5 > 0) {\n var_a2 = (var_a2 & 0xFBFF) | 0x800;\n } else {\n var_a2 = (var_a2 & 0xF7FF) | 0x400;\n }\n }\n\n D_800D5546_D6146[i] = var_a2;\n D_800C9520_CA120[i] = var_a2 & (var_a2 ^ D_800D1350_D1F50[i]);\n\n if ((var_a2 & 0xFFFF) != D_800D1350_D1F50[i]) {\n D_800D10F8_D1CF8[i] = 0xA;\n D_800D0590_D1190[i] = D_800C9520_CA120[i];\n } else {\n if (D_800D10F8_D1CF8[i] > 0) {\n D_800D10F8_D1CF8[i] = D_800D10F8_D1CF8[i] - 1;\n D_800D0590_D1190[i] = D_800C9520_CA120[i];\n } else {\n D_800D10F8_D1CF8[i] = 1;\n D_800D0590_D1190[i] = var_a2;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/input.c#L15-L64","targetAsm":"\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:\tlui\tt5,0x0\n c:\taddiu\tt5,t5,0\n 10:\tlui\tt4,0x0\n 14:\taddiu\tt4,t4,0\n 18:\tlui\tt6,0x0\n 1c:\taddiu\tt6,t6,0\n 20:\tlui\tt3,0x0\n 24:\taddiu\tt3,t3,0\n 28:\tlui\tt2,0x0\n 2c:\taddiu\tt2,t2,0\n 30:\tlui\tt1,0x0\n 34:\taddiu\tt1,t1,0\n 38:\tsll\ta0,t0,0x10\n 3c:\tsra\ta0,a0,0x10\n 40:\tsll\tv1,a0,0x1\n 44:\taddu\ta1,v1,t5\n 48:\taddu\tv0,v1,t4\n 4c:\tlhu\tv0,0(v0)\n 50:\tsh\tv0,0(a1)\n 54:\taddu\tv1,v1,t6\n 58:\tlhu\ta2,0(v1)\n 5c:\tlui\tv0,0x0\n 60:\taddu\tv0,v0,a0\n 64:\tlbu\tv0,0(v0)\n 68:\tsll\tv0,v0,0x18\n 6c:\tsra\tv1,v0,0x18\n 70:\tsra\tv0,v0,0x1f\n 74:\tori\tv0,v0,0x1\n 78:\tmult\tv1,v0\n 7c:\tmflo\tv1\n 80:\taddiu\tv1,v1,-30\n 84:\tnop\n 88:\tblezl\tv1,ac \n 8c:\tsll\tv0,t0,0x10\n 90:\tblez\tv0,a0 \n 94:\tandi\tv0,a2,0xfdff\n 98:\tj\ta8 \n 9c:\tori\ta2,v0,0x100\n a0:\tandi\tv0,a2,0xfeff\n a4:\tori\ta2,v0,0x200\n a8:\tsll\tv0,t0,0x10\n ac:\tsra\tv0,v0,0x10\n b0:\tlui\tat,0x0\n b4:\taddu\tat,at,v0\n b8:\tlbu\tv0,0(at)\n bc:\tsll\tv0,v0,0x18\n c0:\tsra\tv1,v0,0x18\n c4:\tsra\tv0,v0,0x1f\n c8:\tori\tv0,v0,0x1\n cc:\tmult\tv1,v0\n d0:\tmflo\tv1\n d4:\taddiu\tv1,v1,-30\n d8:\tnop\n dc:\tblezl\tv1,100 \n e0:\tsll\tv0,t0,0x10\n e4:\tblez\tv0,f4 \n e8:\tandi\tv0,a2,0xfbff\n ec:\tj\tfc \n f0:\tori\ta2,v0,0x800\n f4:\tandi\tv0,a2,0xf7ff\n f8:\tori\ta2,v0,0x400\n fc:\tsll\tv0,t0,0x10\n 100:\tsra\ta1,v0,0xf\n 104:\taddu\tv0,a1,t4\n 108:\tsh\ta2,0(v0)\n 10c:\taddu\ta3,a1,t3\n 110:\taddu\ta0,a1,t5\n 114:\tlhu\tv0,0(a0)\n 118:\txor\tv0,a2,v0\n 11c:\tand\tv0,a2,v0\n 120:\tsh\tv0,0(a3)\n 124:\tandi\tv1,a2,0xffff\n 128:\tlhu\tv0,0(a0)\n 12c:\tbeq\tv1,v0,14c \n 130:\tli\tv0,10\n 134:\taddu\tv1,a1,t2\n 138:\tsh\tv0,0(v1)\n 13c:\taddu\tv1,a1,t1\n 140:\tlhu\tv0,0(a3)\n 144:\tj\t19c \n 148:\tsh\tv0,0(v1)\n 14c:\tsll\tv0,t0,0x10\n 150:\tsra\ta0,v0,0xf\n 154:\taddu\ta1,a0,t2\n 158:\tlh\tv0,0(a1)\n 15c:\tblez\tv0,180 \n 160:\tmove\tv1,v0\n 164:\taddiu\tv0,v1,-1\n 168:\tsh\tv0,0(a1)\n 16c:\taddu\tv1,a0,t1\n 170:\taddu\tv0,a0,t3\n 174:\tlhu\tv0,0(v0)\n 178:\tj\t19c \n 17c:\tsh\tv0,0(v1)\n 180:\tsll\tv0,t0,0x10\n 184:\tsra\tv0,v0,0xf\n 188:\taddu\ta0,v0,t2\n 18c:\tli\tv1,1\n 190:\tsh\tv1,0(a0)\n 194:\taddu\tv0,v0,t1\n 198:\tsh\ta2,0(v0)\n 19c:\taddiu\tv0,t0,1\n 1a0:\tmove\tt0,v0\n 1a4:\tsll\tv0,v0,0x10\n 1a8:\tsra\tv0,v0,0x10\n 1ac:\tslti\tv0,v0,4\n 1b0:\tbnez\tv0,3c \n 1b4:\tsll\ta0,t0,0x10\n 1b8:\taddiu\tsp,sp,8\n 1bc:\tjr\tra\n 1c0:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"ContDataUpdate":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-2fc48a130813fa67/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 ContDataUpdate\n00000000 *UND*\t00000000 D_800D1350_D1F50\n00000000 *UND*\t00000000 D_800D5546_D6146\n00000000 *UND*\t00000000 D_800CDA7C_CE67C\n00000000 *UND*\t00000000 D_800C9520_CA120\n00000000 *UND*\t00000000 D_800D10F8_D1CF8\n00000000 *UND*\t00000000 D_800D0590_D1190\n00000000 *UND*\t00000000 D_800CBB6E_CC76E\n00000000 *UND*\t00000000 D_800D20A1_D2CA1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800D1350_D1F50\n0000000c R_MIPS_LO16 D_800D1350_D1F50\n00000010 R_MIPS_HI16 D_800D5546_D6146\n00000014 R_MIPS_LO16 D_800D5546_D6146\n00000018 R_MIPS_HI16 D_800CDA7C_CE67C\n0000001c R_MIPS_LO16 D_800CDA7C_CE67C\n00000020 R_MIPS_HI16 D_800C9520_CA120\n00000024 R_MIPS_LO16 D_800C9520_CA120\n00000028 R_MIPS_HI16 D_800D10F8_D1CF8\n0000002c R_MIPS_LO16 D_800D10F8_D1CF8\n00000030 R_MIPS_HI16 D_800D0590_D1190\n00000034 R_MIPS_LO16 D_800D0590_D1190\n0000005c R_MIPS_HI16 D_800CBB6E_CC76E\n00000064 R_MIPS_LO16 D_800CBB6E_CC76E\n00000098 R_MIPS_26 .text\n000000b0 R_MIPS_HI16 D_800D20A1_D2CA1\n000000b8 R_MIPS_LO16 D_800D20A1_D2CA1\n000000ec R_MIPS_26 .text\n00000144 R_MIPS_26 .text\n00000178 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 3c0d0000 25ad0000 '.....@!<...%...\n 0010 3c0c0000 258c0000 3c0e0000 25ce0000 <...%...<...%...\n 0020 3c0b0000 256b0000 3c0a0000 254a0000 <...%k..<...%J..\n 0030 3c090000 25290000 00082400 00042403 <...%)....$...$.\n 0040 00041840 006d2821 006c1021 94420000 ...@.m(!.l.!.B..\n 0050 a4a20000 006e1821 94660000 3c020000 .....n.!.f..<...\n 0060 00441021 90420000 00021600 00021e03 .D.!.B..........\n 0070 000217c3 34420001 00620018 00001812 ....4B...b......\n 0080 2463ffe2 00000000 58600008 00081400 $c......X`......\n 0090 18400003 30c2fdff 0800002a 34460100 .@..0......*4F..\n 00a0 30c2feff 34460200 00081400 00021403 0...4F..........\n 00b0 3c010000 00220821 90220000 00021600 <....\".!.\"......\n 00c0 00021e03 000217c3 34420001 00620018 ........4B...b..\n 00d0 00001812 2463ffe2 00000000 58600008 ....$c......X`..\n 00e0 00081400 18400003 30c2fbff 0800003f .....@..0......?\n 00f0 34460800 30c2f7ff 34460400 00081400 4F..0...4F......\n 0100 00022bc3 00ac1021 a4460000 00ab3821 ..+....!.F....8!\n 0110 00ad2021 94820000 00c21026 00c21024 .. !.......&...$\n 0120 a4e20000 30c3ffff 94820000 10620007 ....0........b..\n 0130 2402000a 00aa1821 a4620000 00a91821 $......!.b.....!\n 0140 94e20000 08000067 a4620000 00081400 .......g.b......\n 0150 000223c3 008a2821 84a20000 18400008 ..#...(!.....@..\n 0160 00401821 2462ffff a4a20000 00891821 .@.!$b.........!\n 0170 008b1021 94420000 08000067 a4620000 ...!.B.....g.b..\n 0180 00081400 000213c3 004a2021 24030001 .........J !$...\n 0190 a4830000 00491021 a4460000 25020001 .....I.!.F..%...\n 01a0 00404021 00021400 00021403 28420004 .@@!........(B..\n 01b0 1440ffa2 00082400 27bd0008 03e00008 .@....$.'.......\n 01c0 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0007ffe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'ContDataUpdate' — lift: cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — 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\tt0,zero */\n/* 8:\tlui\tt5,0x0 */\n/* c:\taddiu\tt5,t5,0 */\n/* 10:\tlui\tt4,0x0 */\n/* 14:\taddiu\tt4,t4,0 */\n/* 18:\tlui\tt6,0x0 */\n/* 1c:\taddiu\tt6,t6,0 */\n/* 20:\tlui\tt3,0x0 */\n/* 24:\taddiu\tt3,t3,0 */\n/* 28:\tlui\tt2,0x0 */\n/* 2c:\taddiu\tt2,t2,0 */\n/* 30:\tlui\tt1,0x0 */\n/* 34:\taddiu\tt1,t1,0 */\n/* 38:\tsll\ta0,t0,0x10 */\n/* 3c:\tsra\ta0,a0,0x10 */\n/* 40:\tsll\tv1,a0,0x1 */\n/* 44:\taddu\ta1,v1,t5 */\n/* 48:\taddu\tv0,v1,t4 */\n/* 4c:\tlhu\tv0,0(v0) */\n/* 50:\tsh\tv0,0(a1) */\n/* 54:\taddu\tv1,v1,t6 */\n/* 58:\tlhu\ta2,0(v1) */\n/* 5c:\tlui\tv0,0x0 */\n/* 60:\taddu\tv0,v0,a0 */\n/* 64:\tlbu\tv0,0(v0) */\n/* 68:\tsll\tv0,v0,0x18 */\n/* 6c:\tsra\tv1,v0,0x18 */\n/* 70:\tsra\tv0,v0,0x1f */\n/* 74:\tori\tv0,v0,0x1 */\n/* 78:\tmult\tv1,v0 */\n/* 7c:\tmflo\tv1 */\n/* 80:\taddiu\tv1,v1,-30 */\n/* 84:\tnop */\n/* 88:\tblezl\tv1,ac */\n/* 8c:\tsll\tv0,t0,0x10 */\n/* 90:\tblez\tv0,a0 */\n/* 94:\tandi\tv0,a2,0xfdff */\n/* 98:\tj\ta8 */\n/* 9c:\tori\ta2,v0,0x100 */\n/* a0:\tandi\tv0,a2,0xfeff */\n/* a4:\tori\ta2,v0,0x200 */\n/* a8:\tsll\tv0,t0,0x10 */\n/* ac:\tsra\tv0,v0,0x10 */\n/* b0:\tlui\tat,0x0 */\n/* b4:\taddu\tat,at,v0 */\n/* b8:\tlbu\tv0,0(at) */\n/* bc:\tsll\tv0,v0,0x18 */\n/* c0:\tsra\tv1,v0,0x18 */\n/* c4:\tsra\tv0,v0,0x1f */\n/* c8:\tori\tv0,v0,0x1 */\n/* cc:\tmult\tv1,v0 */\n/* d0:\tmflo\tv1 */\n/* d4:\taddiu\tv1,v1,-30 */\n/* d8:\tnop */\n/* dc:\tblezl\tv1,100 */\n/* e0:\tsll\tv0,t0,0x10 */\n/* e4:\tblez\tv0,f4 */\n/* e8:\tandi\tv0,a2,0xfbff */\n/* ec:\tj\tfc */\n/* f0:\tori\ta2,v0,0x800 */\n/* f4:\tandi\tv0,a2,0xf7ff */\n/* f8:\tori\ta2,v0,0x400 */\n/* fc:\tsll\tv0,t0,0x10 */\n/* 100:\tsra\ta1,v0,0xf */\n/* 104:\taddu\tv0,a1,t4 */\n/* 108:\tsh\ta2,0(v0) */\n/* 10c:\taddu\ta3,a1,t3 */\n/* 110:\taddu\ta0,a1,t5 */\n/* 114:\tlhu\tv0,0(a0) */\n/* 118:\txor\tv0,a2,v0 */\n/* 11c:\tand\tv0,a2,v0 */\n/* 120:\tsh\tv0,0(a3) */\n/* 124:\tandi\tv1,a2,0xffff */\n/* 128:\tlhu\tv0,0(a0) */\n/* 12c:\tbeq\tv1,v0,14c */\n/* 130:\tli\tv0,10 */\n/* 134:\taddu\tv1,a1,t2 */\n/* 138:\tsh\tv0,0(v1) */\n/* 13c:\taddu\tv1,a1,t1 */\n/* 140:\tlhu\tv0,0(a3) */\n/* 144:\tj\t19c */\n/* 148:\tsh\tv0,0(v1) */\n/* 14c:\tsll\tv0,t0,0x10 */\n/* 150:\tsra\ta0,v0,0xf */\n/* 154:\taddu\ta1,a0,t2 */\n/* 158:\tlh\tv0,0(a1) */\n/* 15c:\tblez\tv0,180 */\n/* 160:\tmove\tv1,v0 */\n/* 164:\taddiu\tv0,v1,-1 */\n/* 168:\tsh\tv0,0(a1) */\n/* 16c:\taddu\tv1,a0,t1 */\n/* 170:\taddu\tv0,a0,t3 */\n/* 174:\tlhu\tv0,0(v0) */\n/* 178:\tj\t19c */\n/* 17c:\tsh\tv0,0(v1) */\n/* 180:\tsll\tv0,t0,0x10 */\n/* 184:\tsra\tv0,v0,0xf */\n/* 188:\taddu\ta0,v0,t2 */\n/* 18c:\tli\tv1,1 */\n/* 190:\tsh\tv1,0(a0) */\n/* 194:\taddu\tv0,v0,t1 */\n/* 198:\tsh\ta2,0(v0) */\n/* 19c:\taddiu\tv0,t0,1 */\n/* 1a0:\tmove\tt0,v0 */\n/* 1a4:\tsll\tv0,v0,0x10 */\n/* 1a8:\tsra\tv0,v0,0x10 */\n/* 1ac:\tslti\tv0,v0,4 */\n/* 1b0:\tbnez\tv0,3c */\n/* 1b4:\tsll\ta0,t0,0x10 */\n/* 1b8:\taddiu\tsp,sp,8 */\n/* 1bc:\tjr\tra */\n/* 1c0:\tnop */\n/* \t... */\nvoid ContDataUpdate(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void ContDataUpdate(void) {\n s16 *temp_a1_2;\n s16 temp_v0;\n s16 temp_v0_6;\n s16 var_t0;\n s32 temp_a0;\n s32 temp_a0_3;\n s32 temp_a1;\n s32 temp_v0_3;\n s32 temp_v0_5;\n s32 temp_v0_7;\n s32 var_a0;\n u16 *temp_a0_2;\n u16 *temp_a3;\n u16 var_a2;\n u8 temp_v0_2;\n u8 temp_v0_4;\n\n var_t0 = 0;\n var_a0 = 0 << 0x10;\n do {\n temp_a0 = var_a0 >> 0x10;\n D_800D1350_D1F50[temp_a0] = D_800D5546_D6146[temp_a0];\n var_a2 = (u16) D_800CDA7C_CE67C[temp_a0];\n temp_v0_2 = (u8) D_800CBB6E_CC76E[temp_a0];\n temp_v0_3 = ((s32) (temp_v0_2 << 0x18) >> 0x1F) | 1;\n if ((((s8) temp_v0_2 * temp_v0_3) - 0x1E) > 0) {\n if (temp_v0_3 > 0) {\n var_a2 = (var_a2 & 0xFDFF) | 0x100;\n } else {\n var_a2 = (var_a2 & 0xFEFF) | 0x200;\n }\n }\n temp_v0_4 = (u8) D_800D20A1_D2CA1[var_t0];\n temp_v0_5 = ((s32) (temp_v0_4 << 0x18) >> 0x1F) | 1;\n if ((((s8) temp_v0_4 * temp_v0_5) - 0x1E) > 0) {\n if (temp_v0_5 > 0) {\n var_a2 = (var_a2 & 0xFBFF) | 0x800;\n } else {\n var_a2 = (var_a2 & 0xF7FF) | 0x400;\n }\n }\n temp_a1 = (s32) (var_t0 << 0x10) >> 0xF;\n *(temp_a1 + D_800D5546_D6146) = var_a2;\n temp_a3 = temp_a1 + D_800C9520_CA120;\n temp_a0_2 = temp_a1 + D_800D1350_D1F50;\n *temp_a3 = var_a2 & (var_a2 ^ *temp_a0_2);\n if ((var_a2 & 0xFFFF) != *temp_a0_2) {\n *(temp_a1 + D_800D10F8_D1CF8) = 0xA;\n *(temp_a1 + D_800D0590_D1190) = *temp_a3;\n } else {\n temp_a0_3 = (s32) (var_t0 << 0x10) >> 0xF;\n temp_a1_2 = temp_a0_3 + D_800D10F8_D1CF8;\n temp_v0_6 = *temp_a1_2;\n if (temp_v0_6 > 0) {\n *temp_a1_2 = temp_v0_6 - 1;\n *(temp_a0_3 + D_800D0590_D1190) = *(temp_a0_3 + D_800C9520_CA120);\n } else {\n temp_v0_7 = (s32) (var_t0 << 0x10) >> 0xF;\n *(temp_v0_7 + D_800D10F8_D1CF8) = 1;\n *(temp_v0_7 + D_800D0590_D1190) = var_a2;\n }\n }\n temp_v0 = var_t0 + 1;\n var_t0 = temp_v0;\n var_a0 = var_t0 << 0x10;\n } while (temp_v0 < 4);\n}\n","score":37,"maxScore":120,"compileErrors":null,"breakdown":{"insert":7,"delete":5,"replace":1,"opMismatch":0,"argMismatch":24},"quality":{"score":88,"lines":67,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":37,"maxScore":120,"ratio":0.30833333333333335,"kinds":{"insert":7,"delete":5,"replace":1,"opMismatch":0,"argMismatch":24}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ContDataUpdate` — benchmark function marioparty3:ContDataUpdate:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 ContDataUpdate\n addiu\t$sp, $sp, -8\n move\t$t0, $zero\n lui\t$t5, %hi(D_800D1350_D1F50)\n addiu\t$t5, $t5, %lo(D_800D1350_D1F50)\n lui\t$t4, %hi(D_800D5546_D6146)\n addiu\t$t4, $t4, %lo(D_800D5546_D6146)\n lui\t$t6, %hi(D_800CDA7C_CE67C)\n addiu\t$t6, $t6, %lo(D_800CDA7C_CE67C)\n lui\t$t3, %hi(D_800C9520_CA120)\n addiu\t$t3, $t3, %lo(D_800C9520_CA120)\n lui\t$t2, %hi(D_800D10F8_D1CF8)\n addiu\t$t2, $t2, %lo(D_800D10F8_D1CF8)\n lui\t$t1, %hi(D_800D0590_D1190)\n addiu\t$t1, $t1, %lo(D_800D0590_D1190)\n sll\t$a0, $t0, 0x10\n.L3c:\n sra\t$a0, $a0, 0x10\n sll\t$v1, $a0, 0x1\n addu\t$a1, $v1, $t5\n addu\t$v0, $v1, $t4\n lhu\t$v0, 0($v0)\n sh\t$v0, 0($a1)\n addu\t$v1, $v1, $t6\n lhu\t$a2, 0($v1)\n lui\t$v0, %hi(D_800CBB6E_CC76E)\n addu\t$v0, $v0, $a0\n lbu\t$v0, %lo(D_800CBB6E_CC76E)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n sra\t$v0, $v0, 0x1f\n ori\t$v0, $v0, 0x1\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$v1, $v1, -30\n nop\n blezl\t$v1, .Lac\n sll\t$v0, $t0, 0x10\n blez\t$v0, .La0\n andi\t$v0, $a2, 0xfdff\n j\t.La8\n ori\t$a2, $v0, 0x100\n.La0:\n andi\t$v0, $a2, 0xfeff\n ori\t$a2, $v0, 0x200\n.La8:\n sll\t$v0, $t0, 0x10\n.Lac:\n sra\t$v0, $v0, 0x10\n lui\t$at, %hi(D_800D20A1_D2CA1)\n addu\t$at, $at, $v0\n lbu\t$v0, %lo(D_800D20A1_D2CA1)($at)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n sra\t$v0, $v0, 0x1f\n ori\t$v0, $v0, 0x1\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$v1, $v1, -30\n nop\n blezl\t$v1, .L100\n sll\t$v0, $t0, 0x10\n blez\t$v0, .Lf4\n andi\t$v0, $a2, 0xfbff\n j\t.Lfc\n ori\t$a2, $v0, 0x800\n.Lf4:\n andi\t$v0, $a2, 0xf7ff\n ori\t$a2, $v0, 0x400\n.Lfc:\n sll\t$v0, $t0, 0x10\n.L100:\n sra\t$a1, $v0, 0xf\n addu\t$v0, $a1, $t4\n sh\t$a2, 0($v0)\n addu\t$a3, $a1, $t3\n addu\t$a0, $a1, $t5\n lhu\t$v0, 0($a0)\n xor\t$v0, $a2, $v0\n and\t$v0, $a2, $v0\n sh\t$v0, 0($a3)\n andi\t$v1, $a2, 0xffff\n lhu\t$v0, 0($a0)\n beq\t$v1, $v0, .L14c\n li\t$v0, 10\n addu\t$v1, $a1, $t2\n sh\t$v0, 0($v1)\n addu\t$v1, $a1, $t1\n lhu\t$v0, 0($a3)\n j\t.L19c\n sh\t$v0, 0($v1)\n.L14c:\n sll\t$v0, $t0, 0x10\n sra\t$a0, $v0, 0xf\n addu\t$a1, $a0, $t2\n lh\t$v0, 0($a1)\n blez\t$v0, .L180\n move\t$v1, $v0\n addiu\t$v0, $v1, -1\n sh\t$v0, 0($a1)\n addu\t$v1, $a0, $t1\n addu\t$v0, $a0, $t3\n lhu\t$v0, 0($v0)\n j\t.L19c\n sh\t$v0, 0($v1)\n.L180:\n sll\t$v0, $t0, 0x10\n sra\t$v0, $v0, 0xf\n addu\t$a0, $v0, $t2\n li\t$v1, 1\n sh\t$v1, 0($a0)\n addu\t$v0, $v0, $t1\n sh\t$a2, 0($v0)\n.L19c:\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, 4\n bnez\t$v0, .L3c\n sll\t$a0, $t0, 0x10\n addiu\t$sp, $sp, 8\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 ContDataUpdate(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ContDataUpdate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ContDataUpdate` — benchmark function marioparty3:ContDataUpdate:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:ContDataUpdate: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:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tlui\tt5,0x0\n c:\taddiu\tt5,t5,0\n 10:\tlui\tt4,0x0\n 14:\taddiu\tt4,t4,0\n 18:\tlui\tt6,0x0\n 1c:\taddiu\tt6,t6,0\n 20:\tlui\tt3,0x0\n 24:\taddiu\tt3,t3,0\n 28:\tlui\tt2,0x0\n 2c:\taddiu\tt2,t2,0\n 30:\tlui\tt1,0x0\n 34:\taddiu\tt1,t1,0\n 38:\tsll\ta0,t0,0x10\n 3c:\tsra\ta0,a0,0x10\n 40:\tsll\tv1,a0,0x1\n 44:\taddu\ta1,v1,t5\n 48:\taddu\tv0,v1,t4\n 4c:\tlhu\tv0,0(v0)\n 50:\tsh\tv0,0(a1)\n 54:\taddu\tv1,v1,t6\n 58:\tlhu\ta2,0(v1)\n 5c:\tlui\tv0,0x0\n 60:\taddu\tv0,v0,a0\n 64:\tlbu\tv0,0(v0)\n 68:\tsll\tv0,v0,0x18\n 6c:\tsra\tv1,v0,0x18\n 70:\tsra\tv0,v0,0x1f\n 74:\tori\tv0,v0,0x1\n 78:\tmult\tv1,v0\n 7c:\tmflo\tv1\n 80:\taddiu\tv1,v1,-30\n 84:\tnop\n 88:\tblezl\tv1,ac \n 8c:\tsll\tv0,t0,0x10\n 90:\tblez\tv0,a0 \n 94:\tandi\tv0,a2,0xfdff\n 98:\tj\ta8 \n 9c:\tori\ta2,v0,0x100\n a0:\tandi\tv0,a2,0xfeff\n a4:\tori\ta2,v0,0x200\n a8:\tsll\tv0,t0,0x10\n ac:\tsra\tv0,v0,0x10\n b0:\tlui\tat,0x0\n b4:\taddu\tat,at,v0\n b8:\tlbu\tv0,0(at)\n bc:\tsll\tv0,v0,0x18\n c0:\tsra\tv1,v0,0x18\n c4:\tsra\tv0,v0,0x1f\n c8:\tori\tv0,v0,0x1\n cc:\tmult\tv1,v0\n d0:\tmflo\tv1\n d4:\taddiu\tv1,v1,-30\n d8:\tnop\n dc:\tblezl\tv1,100 \n e0:\tsll\tv0,t0,0x10\n e4:\tblez\tv0,f4 \n e8:\tandi\tv0,a2,0xfbff\n ec:\tj\tfc \n f0:\tori\ta2,v0,0x800\n f4:\tandi\tv0,a2,0xf7ff\n f8:\tori\ta2,v0,0x400\n fc:\tsll\tv0,t0,0x10\n 100:\tsra\ta1,v0,0xf\n 104:\taddu\tv0,a1,t4\n 108:\tsh\ta2,0(v0)\n 10c:\taddu\ta3,a1,t3\n 110:\taddu\ta0,a1,t5\n 114:\tlhu\tv0,0(a0)\n 118:\txor\tv0,a2,v0\n 11c:\tand\tv0,a2,v0\n 120:\tsh\tv0,0(a3)\n 124:\tandi\tv1,a2,0xffff\n 128:\tlhu\tv0,0(a0)\n 12c:\tbeq\tv1,v0,14c \n 130:\tli\tv0,10\n 134:\taddu\tv1,a1,t2\n 138:\tsh\tv0,0(v1)\n 13c:\taddu\tv1,a1,t1\n 140:\tlhu\tv0,0(a3)\n 144:\tj\t19c \n 148:\tsh\tv0,0(v1)\n 14c:\tsll\tv0,t0,0x10\n 150:\tsra\ta0,v0,0xf\n 154:\taddu\ta1,a0,t2\n 158:\tlh\tv0,0(a1)\n 15c:\tblez\tv0,180 \n 160:\tmove\tv1,v0\n 164:\taddiu\tv0,v1,-1\n 168:\tsh\tv0,0(a1)\n 16c:\taddu\tv1,a0,t1\n 170:\taddu\tv0,a0,t3\n 174:\tlhu\tv0,0(v0)\n 178:\tj\t19c \n 17c:\tsh\tv0,0(v1)\n 180:\tsll\tv0,t0,0x10\n 184:\tsra\tv0,v0,0xf\n 188:\taddu\ta0,v0,t2\n 18c:\tli\tv1,1\n 190:\tsh\tv1,0(a0)\n 194:\taddu\tv0,v0,t1\n 198:\tsh\ta2,0(v0)\n 19c:\taddiu\tv0,t0,1\n 1a0:\tmove\tt0,v0\n 1a4:\tsll\tv0,v0,0x10\n 1a8:\tsra\tv0,v0,0x10\n 1ac:\tslti\tv0,v0,4\n 1b0:\tbnez\tv0,3c \n 1b4:\tsll\ta0,t0,0x10\n 1b8:\taddiu\tsp,sp,8\n 1bc:\tjr\tra\n 1c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-2fc48a130813fa67/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 ContDataUpdate\n00000000 *UND*\t00000000 D_800D1350_D1F50\n00000000 *UND*\t00000000 D_800D5546_D6146\n00000000 *UND*\t00000000 D_800CDA7C_CE67C\n00000000 *UND*\t00000000 D_800C9520_CA120\n00000000 *UND*\t00000000 D_800D10F8_D1CF8\n00000000 *UND*\t00000000 D_800D0590_D1190\n00000000 *UND*\t00000000 D_800CBB6E_CC76E\n00000000 *UND*\t00000000 D_800D20A1_D2CA1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800D1350_D1F50\n0000000c R_MIPS_LO16 D_800D1350_D1F50\n00000010 R_MIPS_HI16 D_800D5546_D6146\n00000014 R_MIPS_LO16 D_800D5546_D6146\n00000018 R_MIPS_HI16 D_800CDA7C_CE67C\n0000001c R_MIPS_LO16 D_800CDA7C_CE67C\n00000020 R_MIPS_HI16 D_800C9520_CA120\n00000024 R_MIPS_LO16 D_800C9520_CA120\n00000028 R_MIPS_HI16 D_800D10F8_D1CF8\n0000002c R_MIPS_LO16 D_800D10F8_D1CF8\n00000030 R_MIPS_HI16 D_800D0590_D1190\n00000034 R_MIPS_LO16 D_800D0590_D1190\n0000005c R_MIPS_HI16 D_800CBB6E_CC76E\n00000064 R_MIPS_LO16 D_800CBB6E_CC76E\n00000098 R_MIPS_26 .text\n000000b0 R_MIPS_HI16 D_800D20A1_D2CA1\n000000b8 R_MIPS_LO16 D_800D20A1_D2CA1\n000000ec R_MIPS_26 .text\n00000144 R_MIPS_26 .text\n00000178 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 3c0d0000 25ad0000 '.....@!<...%...\n 0010 3c0c0000 258c0000 3c0e0000 25ce0000 <...%...<...%...\n 0020 3c0b0000 256b0000 3c0a0000 254a0000 <...%k..<...%J..\n 0030 3c090000 25290000 00082400 00042403 <...%)....$...$.\n 0040 00041840 006d2821 006c1021 94420000 ...@.m(!.l.!.B..\n 0050 a4a20000 006e1821 94660000 3c020000 .....n.!.f..<...\n 0060 00441021 90420000 00021600 00021e03 .D.!.B..........\n 0070 000217c3 34420001 00620018 00001812 ....4B...b......\n 0080 2463ffe2 00000000 58600008 00081400 $c......X`......\n 0090 18400003 30c2fdff 0800002a 34460100 .@..0......*4F..\n 00a0 30c2feff 34460200 00081400 00021403 0...4F..........\n 00b0 3c010000 00220821 90220000 00021600 <....\".!.\"......\n 00c0 00021e03 000217c3 34420001 00620018 ........4B...b..\n 00d0 00001812 2463ffe2 00000000 58600008 ....$c......X`..\n 00e0 00081400 18400003 30c2fbff 0800003f .....@..0......?\n 00f0 34460800 30c2f7ff 34460400 00081400 4F..0...4F......\n 0100 00022bc3 00ac1021 a4460000 00ab3821 ..+....!.F....8!\n 0110 00ad2021 94820000 00c21026 00c21024 .. !.......&...$\n 0120 a4e20000 30c3ffff 94820000 10620007 ....0........b..\n 0130 2402000a 00aa1821 a4620000 00a91821 $......!.b.....!\n 0140 94e20000 08000067 a4620000 00081400 .......g.b......\n 0150 000223c3 008a2821 84a20000 18400008 ..#...(!.....@..\n 0160 00401821 2462ffff a4a20000 00891821 .@.!$b.........!\n 0170 008b1021 94420000 08000067 a4620000 ...!.B.....g.b..\n 0180 00081400 000213c3 004a2021 24030001 .........J !$...\n 0190 a4830000 00491021 a4460000 25020001 .....I.!.F..%...\n 01a0 00404021 00021400 00021403 28420004 .@@!........(B..\n 01b0 1440ffa2 00082400 27bd0008 03e00008 .@....$.'.......\n 01c0 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0007ffe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ContDataUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 ContDataUpdate # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:DecodeData:gcc2.7.2","sym":"DecodeData","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","switch","call","jump-table"],"loc":34,"refSource":"void DecodeData(void *src, void *dest, s32 len, EDecodeType decodeType) {\n DecodeStruct decodeStruct;\n DecodeStruct *decodePtr = &decodeStruct;\n decodeStruct.src = (u8 *)src;\n decodeStruct.dest = (u8 *)dest;\n decodeStruct.len = len;\n decodeStruct.chunkLen = 1024;\n\n switch (decodeType) {\n case DECODE_NONE:\n HuDecodeNone(decodePtr);\n break;\n\n case DECODE_LZ:\n HuDecodeLZ(decodePtr);\n break;\n\n case DECODE_SLIDE:\n HuDecodeSlide(decodePtr);\n break;\n\n case DECODE_FSLIDE:\n case DECODE_FSLIDE_2:\n HuDecodeFslide(decodePtr);\n break;\n\n case DECODE_RLE:\n HuDecodeRLE(decodePtr);\n break;\n\n default:\n break;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/decode.c#L422-L455","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\tra,32(sp)\n 8:\tsw\ta0,20(sp)\n c:\tsw\ta1,24(sp)\n 10:\tsw\ta2,28(sp)\n 14:\tli\tv0,1024\n 18:\tsh\tv0,16(sp)\n 1c:\tsltiu\tv0,a3,6\n 20:\tbeqz\tv0,88 \n 24:\taddiu\tv1,sp,16\n 28:\tsll\tv0,a3,0x2\n 2c:\tlui\tat,0x0\n 30:\taddu\tat,at,v0\n 34:\tlw\tv0,0(at)\n 38:\tjr\tv0\n 3c:\tnop\n 40:\tjal\t0 \n 44:\tmove\ta0,v1\n 48:\tj\t88 \n 4c:\tnop\n 50:\tjal\t0 \n 54:\tmove\ta0,v1\n 58:\tj\t88 \n 5c:\tnop\n 60:\tjal\t0 \n 64:\tmove\ta0,v1\n 68:\tj\t88 \n 6c:\tnop\n 70:\tjal\t0 \n 74:\tmove\ta0,v1\n 78:\tj\t88 \n 7c:\tnop\n 80:\tjal\t0 \n 84:\tmove\ta0,v1\n 88:\tlw\tra,32(sp)\n 8c:\tjr\tra\n 90:\taddiu\tsp,sp,40\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0d7b2b9d8c52.i.gz","proto":{"DecodeData":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-642aa3e613f1830f/u.i\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\t00000094 DecodeData\n00000000 *UND*\t00000000 HuDecodeNone\n00000000 *UND*\t00000000 HuDecodeLZ\n00000000 *UND*\t00000000 HuDecodeSlide\n00000000 *UND*\t00000000 HuDecodeFslide\n00000000 *UND*\t00000000 HuDecodeRLE\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 .rodata\n00000034 R_MIPS_LO16 .rodata\n00000040 R_MIPS_26 HuDecodeNone\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 HuDecodeLZ\n00000058 R_MIPS_26 .text\n00000060 R_MIPS_26 HuDecodeSlide\n00000068 R_MIPS_26 .text\n00000070 R_MIPS_26 HuDecodeFslide\n00000078 R_MIPS_26 .text\n00000080 R_MIPS_26 HuDecodeRLE\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\n\n\nContents of section .text:\n 0000 27bdffd8 afbf0020 afa40014 afa50018 '...... ........\n 0010 afa6001c 24020400 a7a20010 2ce20006 ....$.......,...\n 0020 10400019 27a30010 00071080 3c010000 .@..'.......<...\n 0030 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0040 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0050 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0060 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0070 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0080 0c000000 00602021 8fbf0020 03e00008 .....` !... ....\n 0090 27bd0028 00000000 00000000 00000000 '..(............\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 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 00000040 00000050 00000060 00000070 ...@...P...`...p\n 0010 00000070 00000080 ...p.... \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 'DecodeData' — lift: cannot lift 'DecodeData': 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,-40 */\n/* 4:\tsw\tra,32(sp) */\n/* 8:\tsw\ta0,20(sp) */\n/* c:\tsw\ta1,24(sp) */\n/* 10:\tsw\ta2,28(sp) */\n/* 14:\tli\tv0,1024 */\n/* 18:\tsh\tv0,16(sp) */\n/* 1c:\tsltiu\tv0,a3,6 */\n/* 20:\tbeqz\tv0,88 */\n/* 24:\taddiu\tv1,sp,16 */\n/* 28:\tsll\tv0,a3,0x2 */\n/* 2c:\tlui\tat,0x0 */\n/* 30:\taddu\tat,at,v0 */\n/* 34:\tlw\tv0,0(at) */\n/* 38:\tjr\tv0 */\n/* 3c:\tnop */\n/* 40:\tjal\t0 */\n/* 44:\tmove\ta0,v1 */\n/* 48:\tj\t88 */\n/* 4c:\tnop */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ta0,v1 */\n/* 58:\tj\t88 */\n/* 5c:\tnop */\n/* 60:\tjal\t0 */\n/* 64:\tmove\ta0,v1 */\n/* 68:\tj\t88 */\n/* 6c:\tnop */\n/* 70:\tjal\t0 */\n/* 74:\tmove\ta0,v1 */\n/* 78:\tj\t88 */\n/* 7c:\tnop */\n/* 80:\tjal\t0 */\n/* 84:\tmove\ta0,v1 */\n/* 88:\tlw\tra,32(sp) */\n/* 8c:\tjr\tra */\n/* 90:\taddiu\tsp,sp,40 */\n/* \t... */\nvoid DecodeData(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'DecodeData': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":46,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'DecodeData': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void DecodeData(void *src, void *dest, s32 len, s32 decodeType) {\n s16 sp10;\n void *sp14;\n void *sp18;\n s32 sp1C;\n\n sp14 = src;\n sp18 = dest;\n sp1C = len;\n sp10 = 0x400;\n switch (decodeType) {\n case DECODE_NONE:\n HuDecodeNone((DecodeStruct *) &sp10);\n return;\n case DECODE_LZ:\n HuDecodeLZ((DecodeStruct *) &sp10);\n return;\n case DECODE_SLIDE:\n HuDecodeSlide((DecodeStruct *) &sp10);\n return;\n case DECODE_FSLIDE:\n case DECODE_FSLIDE_2:\n HuDecodeFslide((DecodeStruct *) &sp10);\n return;\n case DECODE_RLE:\n HuDecodeRLE((DecodeStruct *) &sp10);\n /* fallthrough */\n default:\n return;\n }\n}\n","score":13,"maxScore":37,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":5,"opMismatch":0,"argMismatch":4},"quality":{"score":96,"lines":30,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":13,"maxScore":37,"ratio":0.35135135135135137,"kinds":{"insert":0,"delete":4,"replace":5,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecodeData` — benchmark function marioparty3:DecodeData:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 DecodeData\n addiu\t$sp, $sp, -40\n sw\t$ra, 32($sp)\n sw\t$a0, 20($sp)\n sw\t$a1, 24($sp)\n sw\t$a2, 28($sp)\n li\t$v0, 1024\n sh\t$v0, 16($sp)\n sltiu\t$v0, $a3, 6\n beqz\t$v0, .L88\n addiu\t$v1, $sp, 16\n sll\t$v0, $a3, 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.L40:\n jal\tHuDecodeNone\n move\t$a0, $v1\n j\t.L88\n nop\n.L50:\n jal\tHuDecodeLZ\n move\t$a0, $v1\n j\t.L88\n nop\n.L60:\n jal\tHuDecodeSlide\n move\t$a0, $v1\n j\t.L88\n nop\n.L70:\n jal\tHuDecodeFslide\n move\t$a0, $v1\n j\t.L88\n nop\n.L80:\n jal\tHuDecodeRLE\n move\t$a0, $v1\n.L88:\n lw\t$ra, 32($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n.rodata\nglabel jtbl_rodata_0\n.word .L40\n.word .L50\n.word .L60\n.word .L70\n.word .L70\n.word .L80\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-0d7b2b9d8c52.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid DecodeData(void *src, void *dest, s32 len, EDecodeType decodeType);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecodeData # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecodeData` — benchmark function marioparty3:DecodeData:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:DecodeData: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:\taddiu\tsp,sp,-40\n 4:\tsw\tra,32(sp)\n 8:\tsw\ta0,20(sp)\n c:\tsw\ta1,24(sp)\n 10:\tsw\ta2,28(sp)\n 14:\tli\tv0,1024\n 18:\tsh\tv0,16(sp)\n 1c:\tsltiu\tv0,a3,6\n 20:\tbeqz\tv0,88 \n 24:\taddiu\tv1,sp,16\n 28:\tsll\tv0,a3,0x2\n 2c:\tlui\tat,0x0\n 30:\taddu\tat,at,v0\n 34:\tlw\tv0,0(at)\n 38:\tjr\tv0\n 3c:\tnop\n 40:\tjal\t0 \n 44:\tmove\ta0,v1\n 48:\tj\t88 \n 4c:\tnop\n 50:\tjal\t0 \n 54:\tmove\ta0,v1\n 58:\tj\t88 \n 5c:\tnop\n 60:\tjal\t0 \n 64:\tmove\ta0,v1\n 68:\tj\t88 \n 6c:\tnop\n 70:\tjal\t0 \n 74:\tmove\ta0,v1\n 78:\tj\t88 \n 7c:\tnop\n 80:\tjal\t0 \n 84:\tmove\ta0,v1\n 88:\tlw\tra,32(sp)\n 8c:\tjr\tra\n 90:\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-gcc272-642aa3e613f1830f/u.i\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\t00000094 DecodeData\n00000000 *UND*\t00000000 HuDecodeNone\n00000000 *UND*\t00000000 HuDecodeLZ\n00000000 *UND*\t00000000 HuDecodeSlide\n00000000 *UND*\t00000000 HuDecodeFslide\n00000000 *UND*\t00000000 HuDecodeRLE\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 .rodata\n00000034 R_MIPS_LO16 .rodata\n00000040 R_MIPS_26 HuDecodeNone\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 HuDecodeLZ\n00000058 R_MIPS_26 .text\n00000060 R_MIPS_26 HuDecodeSlide\n00000068 R_MIPS_26 .text\n00000070 R_MIPS_26 HuDecodeFslide\n00000078 R_MIPS_26 .text\n00000080 R_MIPS_26 HuDecodeRLE\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\n\n\nContents of section .text:\n 0000 27bdffd8 afbf0020 afa40014 afa50018 '...... ........\n 0010 afa6001c 24020400 a7a20010 2ce20006 ....$.......,...\n 0020 10400019 27a30010 00071080 3c010000 .@..'.......<...\n 0030 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0040 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0050 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0060 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0070 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0080 0c000000 00602021 8fbf0020 03e00008 .....` !... ....\n 0090 27bd0028 00000000 00000000 00000000 '..(............\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 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 00000040 00000050 00000060 00000070 ...@...P...`...p\n 0010 00000070 00000080 ...p.... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecodeData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 DecodeData # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:FileSeek:gcc2.7.2","sym":"FileSeek","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","struct","pointer","switch","ternary","bitwise","comparison-tree"],"loc":25,"refSource":"void FileSeek(HuFileInfoD *info, s32 arg1, s32 arg2) {\n switch (arg2) {\n case 0:\n arg2 = (u32)(info->bytes + arg1);\n break;\n case 1:\n arg2 = (u32)(info->bytesCopy + info->unkE + arg1);\n break;\n case 2:\n arg2 = (u32)(info->bytes + info->size + arg1);\n break;\n default:\n return;\n }\n arg2 = ((u32)arg2 < (u32)info->bytes) ? (u32)info->bytes : (u32)arg2;\n arg2 = ((u32)arg2 >= (u32)(info->bytes + info->size)) ? (u32)(info->bytes + info->size - 1) : (u32)arg2;\n\n if (((u32)arg2 < (u32)info->bytesCopy) || ((u32)arg2 >= (u32)(info->bytesCopy + 0x400))) {\n info->unkC = 1;\n info->unkE = arg2 & 1;\n info->bytesCopy = (u8 *)(arg2 - info->unkE);\n } else {\n info->unkE = arg2 - (u32)info->bytesCopy;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/data.c#L304-L328","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta2,v0,40 \n 8:\tslti\tv0,a2,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta2,34 \n 18:\tnop\n 1c:\tj\td0 \n 20:\tnop\n 24:\tbeq\ta2,v0,50 \n 28:\tnop\n 2c:\tj\td0 \n 30:\tnop\n 34:\tlw\tv0,16(a0)\n 38:\tj\t60 \n 3c:\taddu\ta2,a1,v0\n 40:\tlh\tv1,14(a0)\n 44:\tlw\tv0,20(a0)\n 48:\tj\t5c \n 4c:\taddu\ta2,v1,v0\n 50:\tlw\tv1,16(a0)\n 54:\tlw\tv0,4(a0)\n 58:\taddu\ta2,v1,v0\n 5c:\taddu\ta2,a2,a1\n 60:\tlw\tv1,16(a0)\n 64:\tsltu\tv0,a2,v1\n 68:\tbnezl\tv0,70 \n 6c:\tmove\ta2,v1\n 70:\tlw\tv0,16(a0)\n 74:\tlw\tv1,4(a0)\n 78:\taddu\tv1,v0,v1\n 7c:\tsltu\tv0,a2,v1\n 80:\tbnez\tv0,8c \n 84:\tnop\n 88:\taddiu\ta2,v1,-1\n 8c:\tlw\tv1,20(a0)\n 90:\tsltu\tv0,a2,v1\n 94:\tbnez\tv0,ac \n 98:\tli\tv0,1\n 9c:\taddiu\tv0,v1,1024\n a0:\tsltu\tv0,a2,v0\n a4:\tbnez\tv0,c4 \n a8:\tli\tv0,1\n ac:\tsh\tv0,12(a0)\n b0:\tandi\tv0,a2,0x1\n b4:\tsh\tv0,14(a0)\n b8:\tsubu\tv0,a2,v0\n bc:\tj\td0 \n c0:\tsw\tv0,20(a0)\n c4:\tlhu\tv0,22(a0)\n c8:\tsubu\tv0,a2,v0\n cc:\tsh\tv0,14(a0)\n d0:\tjr\tra\n d4:\tnop\n\t...\n","proto":{"FileSeek":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9aacbde39fae8cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d8 FileSeek\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n0000002c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n000000bc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 10c2000e 28c20002 50400005 $.......(...P@..\n 0010 24020002 10c00007 00000000 08000034 $..............4\n 0020 00000000 10c2000a 00000000 08000034 ...............4\n 0030 00000000 8c820010 08000018 00a23021 ..............0!\n 0040 8483000e 8c820014 08000017 00623021 .............b0!\n 0050 8c830010 8c820004 00623021 00c53021 .........b0!..0!\n 0060 8c830010 00c3102b 54400001 00603021 .......+T@...`0!\n 0070 8c820010 8c830004 00431821 00c3102b .........C.!...+\n 0080 14400002 00000000 2466ffff 8c830014 .@......$f......\n 0090 00c3102b 14400005 24020001 24620400 ...+.@..$...$b..\n 00a0 00c2102b 14400007 24020001 a482000c ...+.@..$.......\n 00b0 30c20001 a482000e 00c21023 08000034 0..........#...4\n 00c0 ac820014 94820016 00c21023 a482000e ...........#....\n 00d0 03e00008 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,"outcome":"declined","source":"/* asmlift could not decompile 'FileSeek' — lift: cannot lift 'FileSeek': 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\ta2,v0,40 */\n/* 8:\tslti\tv0,a2,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta2,34 */\n/* 18:\tnop */\n/* 1c:\tj\td0 */\n/* 20:\tnop */\n/* 24:\tbeq\ta2,v0,50 */\n/* 28:\tnop */\n/* 2c:\tj\td0 */\n/* 30:\tnop */\n/* 34:\tlw\tv0,16(a0) */\n/* 38:\tj\t60 */\n/* 3c:\taddu\ta2,a1,v0 */\n/* 40:\tlh\tv1,14(a0) */\n/* 44:\tlw\tv0,20(a0) */\n/* 48:\tj\t5c */\n/* 4c:\taddu\ta2,v1,v0 */\n/* 50:\tlw\tv1,16(a0) */\n/* 54:\tlw\tv0,4(a0) */\n/* 58:\taddu\ta2,v1,v0 */\n/* 5c:\taddu\ta2,a2,a1 */\n/* 60:\tlw\tv1,16(a0) */\n/* 64:\tsltu\tv0,a2,v1 */\n/* 68:\tbnezl\tv0,70 */\n/* 6c:\tmove\ta2,v1 */\n/* 70:\tlw\tv0,16(a0) */\n/* 74:\tlw\tv1,4(a0) */\n/* 78:\taddu\tv1,v0,v1 */\n/* 7c:\tsltu\tv0,a2,v1 */\n/* 80:\tbnez\tv0,8c */\n/* 84:\tnop */\n/* 88:\taddiu\ta2,v1,-1 */\n/* 8c:\tlw\tv1,20(a0) */\n/* 90:\tsltu\tv0,a2,v1 */\n/* 94:\tbnez\tv0,ac */\n/* 98:\tli\tv0,1 */\n/* 9c:\taddiu\tv0,v1,1024 */\n/* a0:\tsltu\tv0,a2,v0 */\n/* a4:\tbnez\tv0,c4 */\n/* a8:\tli\tv0,1 */\n/* ac:\tsh\tv0,12(a0) */\n/* b0:\tandi\tv0,a2,0x1 */\n/* b4:\tsh\tv0,14(a0) */\n/* b8:\tsubu\tv0,a2,v0 */\n/* bc:\tj\td0 */\n/* c0:\tsw\tv0,20(a0) */\n/* c4:\tlhu\tv0,22(a0) */\n/* c8:\tsubu\tv0,a2,v0 */\n/* cc:\tsh\tv0,14(a0) */\n/* d0:\tjr\tra */\n/* d4:\tnop */\n/* \t... */\nvoid FileSeek(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'FileSeek': unmodelled control transfer 'beqzl' at 0xc — 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 'FileSeek': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void FileSeek(void *arg0, s32 arg1, s32 arg2) {\n s16 temp_v0;\n s32 var_a2_2;\n u32 temp_v1;\n u32 temp_v1_2;\n u32 temp_v1_3;\n u32 var_a2;\n\n switch (arg2) { /* irregular */\n case 0:\n var_a2 = arg1 + arg0->unk10;\nblock_12:\n temp_v1 = arg0->unk10;\n if (var_a2 < temp_v1) {\n var_a2 = temp_v1;\n }\n temp_v1_2 = arg0->unk10 + arg0->unk4;\n if (var_a2 >= temp_v1_2) {\n var_a2 = temp_v1_2 - 1;\n }\n temp_v1_3 = arg0->unk14;\n if ((var_a2 < temp_v1_3) || (var_a2 >= (u32) (temp_v1_3 + 0x400))) {\n arg0->unkC = 1;\n temp_v0 = var_a2 & 1;\n arg0->unkE = temp_v0;\n arg0->unk14 = (u32) (var_a2 - temp_v0);\n return;\n }\n arg0->unkE = (s16) (var_a2 - arg0->unk16);\n return;\n case 1:\n var_a2_2 = arg0->unkE + arg0->unk14;\nblock_11:\n var_a2 = var_a2_2 + arg1;\n goto block_12;\n case 2:\n var_a2_2 = arg0->unk10 + arg0->unk4;\n goto block_11;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":74,"lines":39,"gotos":2,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5582: warning: dereferencing `void *' pointer","/c.i:5582: request for member `unk10' in something not a structure or union","/c.i:5584: warning: dereferencing `void *' pointer","/c.i:5584: request for member `unk10' in something not a structure or union","/c.i:5588: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FileSeek` — benchmark function marioparty3:FileSeek:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel FileSeek\n li\t$v0, 1\n beq\t$a2, $v0, .L40\n slti\t$v0, $a2, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a2, .L34\n nop\n j\t.Ld0\n nop\n.L24:\n beq\t$a2, $v0, .L50\n nop\n j\t.Ld0\n nop\n.L34:\n lw\t$v0, 16($a0)\n j\t.L60\n addu\t$a2, $a1, $v0\n.L40:\n lh\t$v1, 14($a0)\n lw\t$v0, 20($a0)\n j\t.L5c\n addu\t$a2, $v1, $v0\n.L50:\n lw\t$v1, 16($a0)\n lw\t$v0, 4($a0)\n addu\t$a2, $v1, $v0\n.L5c:\n addu\t$a2, $a2, $a1\n.L60:\n lw\t$v1, 16($a0)\n sltu\t$v0, $a2, $v1\n bnezl\t$v0, .L70\n move\t$a2, $v1\n.L70:\n lw\t$v0, 16($a0)\n lw\t$v1, 4($a0)\n addu\t$v1, $v0, $v1\n sltu\t$v0, $a2, $v1\n bnez\t$v0, .L8c\n nop\n addiu\t$a2, $v1, -1\n.L8c:\n lw\t$v1, 20($a0)\n sltu\t$v0, $a2, $v1\n bnez\t$v0, .Lac\n li\t$v0, 1\n addiu\t$v0, $v1, 1024\n sltu\t$v0, $a2, $v0\n bnez\t$v0, .Lc4\n li\t$v0, 1\n.Lac:\n sh\t$v0, 12($a0)\n andi\t$v0, $a2, 0x1\n sh\t$v0, 14($a0)\n subu\t$v0, $a2, $v0\n j\t.Ld0\n sw\t$v0, 20($a0)\n.Lc4:\n lhu\t$v0, 22($a0)\n subu\t$v0, $a2, $v0\n sh\t$v0, 14($a0)\n.Ld0:\n jr\t$ra\n 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 FileSeek # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FileSeek` — benchmark function marioparty3:FileSeek:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:FileSeek: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:\tbeq\ta2,v0,40 \n 8:\tslti\tv0,a2,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta2,34 \n 18:\tnop\n 1c:\tj\td0 \n 20:\tnop\n 24:\tbeq\ta2,v0,50 \n 28:\tnop\n 2c:\tj\td0 \n 30:\tnop\n 34:\tlw\tv0,16(a0)\n 38:\tj\t60 \n 3c:\taddu\ta2,a1,v0\n 40:\tlh\tv1,14(a0)\n 44:\tlw\tv0,20(a0)\n 48:\tj\t5c \n 4c:\taddu\ta2,v1,v0\n 50:\tlw\tv1,16(a0)\n 54:\tlw\tv0,4(a0)\n 58:\taddu\ta2,v1,v0\n 5c:\taddu\ta2,a2,a1\n 60:\tlw\tv1,16(a0)\n 64:\tsltu\tv0,a2,v1\n 68:\tbnezl\tv0,70 \n 6c:\tmove\ta2,v1\n 70:\tlw\tv0,16(a0)\n 74:\tlw\tv1,4(a0)\n 78:\taddu\tv1,v0,v1\n 7c:\tsltu\tv0,a2,v1\n 80:\tbnez\tv0,8c \n 84:\tnop\n 88:\taddiu\ta2,v1,-1\n 8c:\tlw\tv1,20(a0)\n 90:\tsltu\tv0,a2,v1\n 94:\tbnez\tv0,ac \n 98:\tli\tv0,1\n 9c:\taddiu\tv0,v1,1024\n a0:\tsltu\tv0,a2,v0\n a4:\tbnez\tv0,c4 \n a8:\tli\tv0,1\n ac:\tsh\tv0,12(a0)\n b0:\tandi\tv0,a2,0x1\n b4:\tsh\tv0,14(a0)\n b8:\tsubu\tv0,a2,v0\n bc:\tj\td0 \n c0:\tsw\tv0,20(a0)\n c4:\tlhu\tv0,22(a0)\n c8:\tsubu\tv0,a2,v0\n cc:\tsh\tv0,14(a0)\n d0:\tjr\tra\n d4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-f9aacbde39fae8cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d8 FileSeek\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n0000002c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n000000bc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 10c2000e 28c20002 50400005 $.......(...P@..\n 0010 24020002 10c00007 00000000 08000034 $..............4\n 0020 00000000 10c2000a 00000000 08000034 ...............4\n 0030 00000000 8c820010 08000018 00a23021 ..............0!\n 0040 8483000e 8c820014 08000017 00623021 .............b0!\n 0050 8c830010 8c820004 00623021 00c53021 .........b0!..0!\n 0060 8c830010 00c3102b 54400001 00603021 .......+T@...`0!\n 0070 8c820010 8c830004 00431821 00c3102b .........C.!...+\n 0080 14400002 00000000 2466ffff 8c830014 .@......$f......\n 0090 00c3102b 14400005 24020001 24620400 ...+.@..$...$b..\n 00a0 00c2102b 14400007 24020001 a482000c ...+.@..$.......\n 00b0 30c20001 a482000e 00c21023 08000034 0..........#...4\n 00c0 ac820014 94820016 00c21023 a482000e ...........#....\n 00d0 03e00008 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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FileSeek\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 FileSeek # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","store","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F024_FC24\n lui\t$at, %hi(frameBufferPool)\n sw\t$a0, %lo(frameBufferPool)($at)\n lui\t$at, %hi(frameBufferCount)\n sh\t$a1, %lo(frameBufferCount)($at)\n lui\t$at, %hi(frameBufferSegmentID)\n jr\t$ra\n sh\t$a2, %lo(frameBufferSegmentID)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F024_FC24 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F04C_FC4C:gcc2.7.2","sym":"func_8000F04C_FC4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":6,"refSource":"void func_8000F04C_FC4C(u64 **threadStacks) {\n gThread3Stack = *threadStacks++;\n gThreadOutStack = *threadStacks++;\n gThreadOutStackSize = *threadStacks++;\n gThreadYieldStack = *threadStacks;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz","proto":{"func_8000F04C_FC4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gThread3Stack"},{"name":"gThreadOutStack"},{"name":"gThreadOutStackSize"},{"name":"gThreadYieldStack"}],"outcome":"nonmatch","source":"void func_8000F04C_FC4C(s32 * a0) {\n gThread3Stack = *a0;\n gThreadOutStack = *(a0 + 1);\n gThreadOutStackSize = *(a0 + 1 + 1);\n gThreadYieldStack = (a0 + 1 + 1)[1];\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_8000F04C_FC4C(u64 **threadStacks) {\n u64 **temp_a0;\n\n gThread3Stack = threadStacks->unk0;\n temp_a0 = threadStacks + 4;\n gThreadOutStack = threadStacks->unk4;\n gThreadOutStackSize = temp_a0->unk4;\n gThreadYieldStack = (temp_a0 + 4)->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5517: request for member `unk0' in something not a structure or union","/c.i:5519: request for member `unk4' in something not a structure or union","/c.i:5520: request for member `unk4' in something not a structure or union","/c.i:5521: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":15,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F04C_FC4C\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThread3Stack)\n sw\t$v0, %lo(gThread3Stack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStack)\n sw\t$v0, %lo(gThreadOutStack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStackSize)\n sw\t$v0, %lo(gThreadOutStackSize)($at)\n lw\t$v0, 4($a0)\n lui\t$at, %hi(gThreadYieldStack)\n jr\t$ra\n sw\t$v0, %lo(gThreadYieldStack)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F04C_FC4C(u64 **threadStacks);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F04C_FC4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F088_FC88:gcc2.7.2","sym":"func_8000F088_FC88","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F088_FC88\n lui\t$at, %hi(gUCodeAddresses)\n jr\t$ra\n sw\t$a0, %lo(gUCodeAddresses)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F088_FC88(s32 *uCodeAdresses);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F088_FC88 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80011460_12060:gcc2.7.2","sym":"func_80011460_12060","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80011460_12060\n move\t$a3, $zero\n li\t$a2, 1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L54\n move\t$a1, $v0\n sll\t$v0, $a2, 0x10\n.L18:\n sra\t$v0, $v0, 0x10\n mult\t$v0, $a1\n mflo\t$v0\n addu\t$a3, $a3, $v0\n addiu\t$a0, $a0, 1\n addiu\t$v0, $a2, 1\n move\t$a2, $v0\n lbu\t$a1, 0($a0)\n sltu\t$v1, $zero, $a1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 28\n and\t$v1, $v1, $v0\n bnezl\t$v1, .L18\n sll\t$v0, $a2, 0x10\n.L54:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80011460_12060 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800123F4_12FF4:gcc2.7.2","sym":"func_800123F4_12FF4","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz","proto":{"func_800123F4_12FF4":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800D2008_D2C08"},{"name":"D_800D418E_D4D8E"}],"outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = (s16) D_800D2008_D2C08;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800123F4_12FF4\n lui\t$v0, %hi(D_800D2008_D2C08)\n lbu\t$v0, %lo(D_800D2008_D2C08)($v0)\n lui\t$at, %hi(D_800D418E_D4D8E)\n jr\t$ra\n sh\t$v0, %lo(D_800D418E_D4D8E)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800123F4_12FF4(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800123F4_12FF4 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80012B14_13714:gcc2.7.2","sym":"func_80012B14_13714","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["float","array","arithmetic","struct","call"],"loc":41,"refSource":"void func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos) {\n f32 x;\n f32 y;\n f32 z;\n f32 projectedX;\n f32 projectedY;\n f32 projectedZ;\n HuCamera *camera;\n HuMtx4F viewMtx;\n f32 f2;\n f32 f4;\n\n camera = &gCameraList[camIndex];\n guLookAtF(\n viewMtx,\n camera->pos.x,\n camera->pos.y,\n camera->pos.z,\n camera->at.x,\n camera->at.y,\n camera->at.z,\n camera->up.x,\n camera->up.y,\n camera->up.z);\n\n x = worldPos->x;\n y = worldPos->y;\n z = worldPos->z;\n x -= camera->pos.x;\n y -= camera->pos.y;\n z -= camera->pos.z;\n projectedX = ((x * viewMtx[0][0]) + (y * viewMtx[1][0])) + (z * viewMtx[2][0]);\n projectedY = ((x * viewMtx[0][1]) + (y * viewMtx[1][1])) + (z * viewMtx[2][1]);\n projectedZ = ((x * viewMtx[0][2]) + (y * viewMtx[1][2])) + (z * viewMtx[2][2]);\n x = HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f) * projectedZ * (camera->screenScale.x / camera->screenScale.y);\n y = (HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f)) * projectedZ;\n f2 = camera->screenPos.x / 4.0f;\n outPos->x = (projectedX * (f2 / (-x))) + f2;\n f4 = camera->screenPos.y / 4.0f;\n outPos->y = ((projectedY * (f4 / y)) + f4);\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L173-L213","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlwc1\t$f0,52(s0)\n 158:\tlwc1\t$f2,56(s0)\n 15c:\tdiv.s\t$f0,$f0,$f2\n 160:\tmul.s\t$f30,$f30,$f0\n 164:\tlwc1\t$f12,80(s0)\n 168:\tjal\t0 \n 16c:\tdiv.s\t$f12,$f12,$f26\n 170:\tmov.s\t$f28,$f0\n 174:\tlwc1\t$f12,80(s0)\n 178:\tjal\t0 \n 17c:\tdiv.s\t$f12,$f12,$f26\n 180:\tdiv.s\t$f28,$f28,$f0\n 184:\tmul.s\t$f28,$f28,$f20\n 188:\tlwc1\t$f2,64(s0)\n 18c:\tlui\tat,0x4080\n 190:\tmtc1\tat,$f4\n 194:\tnop\n 198:\tdiv.s\t$f2,$f2,$f4\n 19c:\tneg.s\t$f0,$f30\n 1a0:\tdiv.s\t$f0,$f2,$f0\n 1a4:\tmul.s\t$f24,$f24,$f0\n 1a8:\tadd.s\t$f24,$f24,$f2\n 1ac:\tswc1\t$f24,0(s2)\n 1b0:\tlwc1\t$f0,68(s0)\n 1b4:\tdiv.s\t$f0,$f0,$f4\n 1b8:\tdiv.s\t$f2,$f0,$f28\n 1bc:\tmul.s\t$f22,$f22,$f2\n 1c0:\tadd.s\t$f22,$f22,$f0\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"func_80012B14_13714":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8d3657a65e5d5fc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 func_80012B14_13714\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n00000168 R_MIPS_26 HuMathSin\n00000178 R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 c6000034 c6020038 46020003 F......4...8F...\n 0160 4600f782 c60c0050 0c000000 461a6303 F......P....F.c.\n 0170 46000706 c60c0050 0c000000 461a6303 F......P....F.c.\n 0180 4600e703 4614e702 c6020040 3c014080 F...F......@<.@.\n 0190 44812000 00000000 46041083 4600f007 D. .....F...F...\n 01a0 46001003 4600c602 4602c600 e6580000 F...F...F....X..\n 01b0 c6000044 46040003 461c0083 4602b582 ...DF...F...F...\n 01c0 4600b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501015 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_80012B14_13714' — lift: cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — 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,-168 */\n/* 4:\tsw\tra,116(sp) */\n/* 8:\tsw\ts2,112(sp) */\n/* c:\tsw\ts1,108(sp) */\n/* 10:\tsw\ts0,104(sp) */\n/* 14:\tsdc1\t$f30,160(sp) */\n/* 18:\tsdc1\t$f28,152(sp) */\n/* 1c:\tsdc1\t$f26,144(sp) */\n/* 20:\tsdc1\t$f24,136(sp) */\n/* 24:\tsdc1\t$f22,128(sp) */\n/* 28:\tsdc1\t$f20,120(sp) */\n/* 2c:\tmove\ts1,a1 */\n/* 30:\tmove\ts2,a2 */\n/* 34:\tsll\ta0,a0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\tsll\ts0,a0,0x3 */\n/* 40:\taddu\ts0,s0,a0 */\n/* 44:\tsll\ts0,s0,0x2 */\n/* 48:\tsubu\ts0,s0,a0 */\n/* 4c:\tsll\ts0,s0,0x4 */\n/* 50:\tlui\tv0,0x0 */\n/* 54:\tlw\tv0,0(v0) */\n/* 58:\taddu\ts0,s0,v0 */\n/* 5c:\tlwc1\t$f0,28(s0) */\n/* 60:\tswc1\t$f0,16(sp) */\n/* 64:\tlwc1\t$f0,32(s0) */\n/* 68:\tswc1\t$f0,20(sp) */\n/* 6c:\tlwc1\t$f0,36(s0) */\n/* 70:\tswc1\t$f0,24(sp) */\n/* 74:\tlwc1\t$f0,40(s0) */\n/* 78:\tswc1\t$f0,28(sp) */\n/* 7c:\tlwc1\t$f0,44(s0) */\n/* 80:\tswc1\t$f0,32(sp) */\n/* 84:\tlwc1\t$f0,48(s0) */\n/* 88:\tswc1\t$f0,36(sp) */\n/* 8c:\tlw\ta1,16(s0) */\n/* 90:\tlw\ta2,20(s0) */\n/* 94:\tlw\ta3,24(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\taddiu\ta0,sp,40 */\n/* a0:\tlwc1\t$f30,0(s1) */\n/* a4:\tlwc1\t$f28,4(s1) */\n/* a8:\tlwc1\t$f2,8(s1) */\n/* ac:\tlwc1\t$f0,16(s0) */\n/* b0:\tsub.s\t$f30,$f30,$f0 */\n/* b4:\tlwc1\t$f0,20(s0) */\n/* b8:\tsub.s\t$f28,$f28,$f0 */\n/* bc:\tlwc1\t$f0,24(s0) */\n/* c0:\tsub.s\t$f2,$f2,$f0 */\n/* c4:\tlwc1\t$f24,40(sp) */\n/* c8:\tmul.s\t$f24,$f30,$f24 */\n/* cc:\tlwc1\t$f0,56(sp) */\n/* d0:\tmul.s\t$f0,$f28,$f0 */\n/* d4:\tadd.s\t$f24,$f24,$f0 */\n/* d8:\tlwc1\t$f0,72(sp) */\n/* dc:\tmul.s\t$f0,$f2,$f0 */\n/* e0:\tadd.s\t$f24,$f24,$f0 */\n/* e4:\tlwc1\t$f22,44(sp) */\n/* e8:\tmul.s\t$f22,$f30,$f22 */\n/* ec:\tlwc1\t$f0,60(sp) */\n/* f0:\tmul.s\t$f0,$f28,$f0 */\n/* f4:\tadd.s\t$f22,$f22,$f0 */\n/* f8:\tlwc1\t$f0,76(sp) */\n/* fc:\tmul.s\t$f0,$f2,$f0 */\n/* 100:\tadd.s\t$f22,$f22,$f0 */\n/* 104:\tlwc1\t$f20,48(sp) */\n/* 108:\tmul.s\t$f20,$f30,$f20 */\n/* 10c:\tlwc1\t$f0,64(sp) */\n/* 110:\tmul.s\t$f0,$f28,$f0 */\n/* 114:\tadd.s\t$f20,$f20,$f0 */\n/* 118:\tlwc1\t$f0,80(sp) */\n/* 11c:\tmul.s\t$f2,$f2,$f0 */\n/* 120:\tadd.s\t$f20,$f20,$f2 */\n/* 124:\tlwc1\t$f12,80(s0) */\n/* 128:\tlui\tat,0x4000 */\n/* 12c:\tmtc1\tat,$f26 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tdiv.s\t$f12,$f12,$f26 */\n/* 13c:\tmov.s\t$f28,$f0 */\n/* 140:\tlwc1\t$f12,80(s0) */\n/* 144:\tjal\t0 */\n/* 148:\tdiv.s\t$f12,$f12,$f26 */\n/* 14c:\tdiv.s\t$f30,$f28,$f0 */\n/* 150:\tmul.s\t$f30,$f30,$f20 */\n/* 154:\tlwc1\t$f0,52(s0) */\n/* 158:\tlwc1\t$f2,56(s0) */\n/* 15c:\tdiv.s\t$f0,$f0,$f2 */\n/* 160:\tmul.s\t$f30,$f30,$f0 */\n/* 164:\tlwc1\t$f12,80(s0) */\n/* 168:\tjal\t0 */\n/* 16c:\tdiv.s\t$f12,$f12,$f26 */\n/* 170:\tmov.s\t$f28,$f0 */\n/* 174:\tlwc1\t$f12,80(s0) */\n/* 178:\tjal\t0 */\n/* 17c:\tdiv.s\t$f12,$f12,$f26 */\n/* 180:\tdiv.s\t$f28,$f28,$f0 */\n/* 184:\tmul.s\t$f28,$f28,$f20 */\n/* 188:\tlwc1\t$f2,64(s0) */\n/* 18c:\tlui\tat,0x4080 */\n/* 190:\tmtc1\tat,$f4 */\n/* 194:\tnop */\n/* 198:\tdiv.s\t$f2,$f2,$f4 */\n/* 19c:\tneg.s\t$f0,$f30 */\n/* 1a0:\tdiv.s\t$f0,$f2,$f0 */\n/* 1a4:\tmul.s\t$f24,$f24,$f0 */\n/* 1a8:\tadd.s\t$f24,$f24,$f2 */\n/* 1ac:\tswc1\t$f24,0(s2) */\n/* 1b0:\tlwc1\t$f0,68(s0) */\n/* 1b4:\tdiv.s\t$f0,$f0,$f4 */\n/* 1b8:\tdiv.s\t$f2,$f0,$f28 */\n/* 1bc:\tmul.s\t$f22,$f22,$f2 */\n/* 1c0:\tadd.s\t$f22,$f22,$f0 */\n/* 1c4:\tswc1\t$f22,4(s2) */\n/* 1c8:\tlw\tra,116(sp) */\n/* 1cc:\tlw\ts2,112(sp) */\n/* 1d0:\tlw\ts1,108(sp) */\n/* 1d4:\tlw\ts0,104(sp) */\n/* 1d8:\tldc1\t$f30,160(sp) */\n/* 1dc:\tldc1\t$f28,152(sp) */\n/* 1e0:\tldc1\t$f26,144(sp) */\n/* 1e4:\tldc1\t$f24,136(sp) */\n/* 1e8:\tldc1\t$f22,128(sp) */\n/* 1ec:\tldc1\t$f20,120(sp) */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,168 */\n/* \t... */\nvoid func_80012B14_13714(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos) {\n HuCamera *temp_s0;\n f32 temp_f0;\n f32 temp_f20;\n f32 temp_f22;\n f32 temp_f24;\n f32 temp_f28;\n f32 temp_f28_2;\n f32 temp_f28_3;\n f32 temp_f28_4;\n f32 temp_f2;\n f32 temp_f2_2;\n f32 temp_f30;\n f32 temp_f30_2;\n\n temp_s0 = &gCameraList[camIndex];\n guLookAtF((f32 (*)[4]) &sp28[0], temp_s0->pos.x, temp_s0->pos.y, temp_s0->pos.z, temp_s0->at.x, temp_s0->at.y, temp_s0->at.z, temp_s0->up.x, temp_s0->up.y, temp_s0->up.z);\n temp_f30 = worldPos->x - temp_s0->pos.x;\n temp_f28 = worldPos->y - temp_s0->pos.y;\n temp_f2 = worldPos->z - temp_s0->pos.z;\n temp_f24 = (temp_f30 * sp28[0]) + (temp_f28 * sp38) + (temp_f2 * sp48);\n temp_f22 = (temp_f30 * sp28[1]) + (temp_f28 * sp3C) + (temp_f2 * sp4C);\n temp_f20 = (temp_f30 * sp28[2]) + (temp_f28 * sp40) + (temp_f2 * sp50);\n temp_f28_2 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f30_2 = (temp_f28_2 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20 * (temp_s0->screenScale.x / temp_s0->screenScale.y);\n temp_f28_3 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f28_4 = (temp_f28_3 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20;\n temp_f2_2 = temp_s0->screenPos.x / 4.0f;\n outPos->x = (temp_f24 * (temp_f2_2 / -temp_f30_2)) + temp_f2_2;\n temp_f0 = temp_s0->screenPos.y / 4.0f;\n outPos->y = (temp_f22 * (temp_f0 / temp_f28_4)) + temp_f0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5566: `sp28' undeclared (first use this function)","/c.i:5566: (Each undeclared identifier is reported only once","/c.i:5566: for each function it appears in.)","/c.i:5570: `sp38' undeclared (first use this function)","/c.i:5570: `sp48' undeclared (first use this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80012B14_13714` — benchmark function marioparty3:func_80012B14_13714:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_80012B14_13714\n addiu\t$sp, $sp, -168\n sw\t$ra, 116($sp)\n sw\t$s2, 112($sp)\n sw\t$s1, 108($sp)\n sw\t$s0, 104($sp)\n sdc1\t$f30, 160($sp)\n sdc1\t$f28, 152($sp)\n sdc1\t$f26, 144($sp)\n sdc1\t$f24, 136($sp)\n sdc1\t$f22, 128($sp)\n sdc1\t$f20, 120($sp)\n move\t$s1, $a1\n move\t$s2, $a2\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$s0, $a0, 0x3\n addu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x2\n subu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x4\n lui\t$v0, %hi(gCameraList)\n lw\t$v0, %lo(gCameraList)($v0)\n addu\t$s0, $s0, $v0\n lwc1\t$f0, 28($s0)\n swc1\t$f0, 16($sp)\n lwc1\t$f0, 32($s0)\n swc1\t$f0, 20($sp)\n lwc1\t$f0, 36($s0)\n swc1\t$f0, 24($sp)\n lwc1\t$f0, 40($s0)\n swc1\t$f0, 28($sp)\n lwc1\t$f0, 44($s0)\n swc1\t$f0, 32($sp)\n lwc1\t$f0, 48($s0)\n swc1\t$f0, 36($sp)\n lw\t$a1, 16($s0)\n lw\t$a2, 20($s0)\n lw\t$a3, 24($s0)\n jal\tguLookAtF\n addiu\t$a0, $sp, 40\n lwc1\t$f30, 0($s1)\n lwc1\t$f28, 4($s1)\n lwc1\t$f2, 8($s1)\n lwc1\t$f0, 16($s0)\n sub.s\t$f30, $f30, $f0\n lwc1\t$f0, 20($s0)\n sub.s\t$f28, $f28, $f0\n lwc1\t$f0, 24($s0)\n sub.s\t$f2, $f2, $f0\n lwc1\t$f24, 40($sp)\n mul.s\t$f24, $f30, $f24\n lwc1\t$f0, 56($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f0, 72($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f22, 44($sp)\n mul.s\t$f22, $f30, $f22\n lwc1\t$f0, 60($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f0, 76($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f20, 48($sp)\n mul.s\t$f20, $f30, $f20\n lwc1\t$f0, 64($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f20, $f20, $f0\n lwc1\t$f0, 80($sp)\n mul.s\t$f2, $f2, $f0\n add.s\t$f20, $f20, $f2\n lwc1\t$f12, 80($s0)\n lui\t$at, 0x4000\n mtc1\t$at, $f26\n nop\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f30, $f28, $f0\n mul.s\t$f30, $f30, $f20\n lwc1\t$f0, 52($s0)\n lwc1\t$f2, 56($s0)\n div.s\t$f0, $f0, $f2\n mul.s\t$f30, $f30, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f28, $f28, $f0\n mul.s\t$f28, $f28, $f20\n lwc1\t$f2, 64($s0)\n lui\t$at, 0x4080\n mtc1\t$at, $f4\n nop\n div.s\t$f2, $f2, $f4\n neg.s\t$f0, $f30\n div.s\t$f0, $f2, $f0\n mul.s\t$f24, $f24, $f0\n add.s\t$f24, $f24, $f2\n swc1\t$f24, 0($s2)\n lwc1\t$f0, 68($s0)\n div.s\t$f0, $f0, $f4\n div.s\t$f2, $f0, $f28\n mul.s\t$f22, $f22, $f2\n add.s\t$f22, $f22, $f0\n swc1\t$f22, 4($s2)\n lw\t$ra, 116($sp)\n lw\t$s2, 112($sp)\n lw\t$s1, 108($sp)\n lw\t$s0, 104($sp)\n ldc1\t$f30, 160($sp)\n ldc1\t$f28, 152($sp)\n ldc1\t$f26, 144($sp)\n ldc1\t$f24, 136($sp)\n ldc1\t$f22, 128($sp)\n ldc1\t$f20, 120($sp)\n jr\t$ra\n addiu\t$sp, $sp, 168\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80012B14_13714 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80012B14_13714` — benchmark function marioparty3:func_80012B14_13714:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80012B14_13714: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:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlwc1\t$f0,52(s0)\n 158:\tlwc1\t$f2,56(s0)\n 15c:\tdiv.s\t$f0,$f0,$f2\n 160:\tmul.s\t$f30,$f30,$f0\n 164:\tlwc1\t$f12,80(s0)\n 168:\tjal\t0 \n 16c:\tdiv.s\t$f12,$f12,$f26\n 170:\tmov.s\t$f28,$f0\n 174:\tlwc1\t$f12,80(s0)\n 178:\tjal\t0 \n 17c:\tdiv.s\t$f12,$f12,$f26\n 180:\tdiv.s\t$f28,$f28,$f0\n 184:\tmul.s\t$f28,$f28,$f20\n 188:\tlwc1\t$f2,64(s0)\n 18c:\tlui\tat,0x4080\n 190:\tmtc1\tat,$f4\n 194:\tnop\n 198:\tdiv.s\t$f2,$f2,$f4\n 19c:\tneg.s\t$f0,$f30\n 1a0:\tdiv.s\t$f0,$f2,$f0\n 1a4:\tmul.s\t$f24,$f24,$f0\n 1a8:\tadd.s\t$f24,$f24,$f2\n 1ac:\tswc1\t$f24,0(s2)\n 1b0:\tlwc1\t$f0,68(s0)\n 1b4:\tdiv.s\t$f0,$f0,$f4\n 1b8:\tdiv.s\t$f2,$f0,$f28\n 1bc:\tmul.s\t$f22,$f22,$f2\n 1c0:\tadd.s\t$f22,$f22,$f0\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-8d3657a65e5d5fc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 func_80012B14_13714\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n00000168 R_MIPS_26 HuMathSin\n00000178 R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 c6000034 c6020038 46020003 F......4...8F...\n 0160 4600f782 c60c0050 0c000000 461a6303 F......P....F.c.\n 0170 46000706 c60c0050 0c000000 461a6303 F......P....F.c.\n 0180 4600e703 4614e702 c6020040 3c014080 F...F......@<.@.\n 0190 44812000 00000000 46041083 4600f007 D. .....F...F...\n 01a0 46001003 4600c602 4602c600 e6580000 F...F...F....X..\n 01b0 c6000044 46040003 461c0083 4602b582 ...DF...F...F...\n 01c0 4600b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501015 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_80012B14_13714\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_80012B14_13714 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001D330_1DF30\n lui\t$at, %hi(D_800A0A78_A1678)\n jr\t$ra\n sh\t$a0, %lo(D_800A0A78_A1678)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001D330_1DF30(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001D330_1DF30 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001FBBC_207BC:gcc2.7.2","sym":"func_8001FBBC_207BC","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *other;\n\n other = HmfModelData[arg0].unkB4;\n if (other != NULL) {\n other->unk00 = arg1;\n other->unk01 = arg2;\n other->unk02 = arg3;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8001FBBC_207BC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"HmfModelData","shape":"pointer"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[180]; s32 field_180; u8 _pad1[8]; };\nvoid func_8001FBBC_207BC(s32 a0, s32 a1, s32 a2, s32 a3) {\n u8 * v0;\n v0 = (u8 *)((struct Elem0 *)HmfModelData)[a0 << 16 >> 16].field_180;\n if (v0 != 0) {\n *v0 = a1;\n v0[1] = a2;\n v0[2] = a3;\n }\n return;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *temp_v0;\n\n temp_v0 = HmfModelData[arg0].unkB4;\n if (temp_v0 != NULL) {\n temp_v0->unk00 = arg1;\n temp_v0->unk01 = (u8) arg2;\n temp_v0->unk02 = (u8) arg3;\n }\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001FBBC_207BC\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n lui\t$v1, %hi(HmfModelData)\n lw\t$v1, %lo(HmfModelData)($v1)\n sll\t$v0, $a0, 0x1\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x6\n addu\t$v0, $v0, $v1\n lw\t$v0, 180($v0)\n beqz\t$v0, .L38\n nop\n sb\t$a1, 0($v0)\n sb\t$a2, 1($v0)\n sb\t$a3, 2($v0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001FBBC_207BC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800230F8_23CF8:gcc2.7.2","sym":"func_800230F8_23CF8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","loop","nested-loop","call"],"loc":36,"refSource":"void func_800230F8_23CF8(HmfData *arg0) {\n s16 textureIndex;\n s16 i, j;\n\n textureIndex = 4; // TODO: why does this start at 4?\n\n for (i = 0; i < arg0->unk12; i++) {\n /* Skip entries marked as 0xFF */\n if (arg0->unk84[i].unk9 == 0xFF) {\n continue;\n }\n\n /* Find first entry with different unkC value */\n for (j = 0; j < i; j++) {\n if (arg0->unk84[i].unkC == arg0->unk84[j].unkC) {\n break;\n }\n }\n\n /* Copy or assign texture indices */\n if (j != i) {\n arg0->unk84[i].unk3 = arg0->unk84[j].unk3;\n arg0->unk84[i].unk4 = arg0->unk84[j].unk4;\n } else {\n arg0->unk84[i].unk3 = textureIndex++;\n if (arg0->unk84[i].unkC->unk_30 != NULL) {\n arg0->unk84[i].unk4 = textureIndex++;\n }\n\n if (textureIndex > 16) {\n osSyncPrintf(\"Texture Anime Over\\n\");\n return;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L22-L57","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:\tmove\tt0,a0\n c:\tli\tt1,4\n 10:\tlh\tv0,18(t0)\n 14:\tblez\tv0,160 \n 18:\tmove\tt2,zero\n 1c:\tsll\tv0,t2,0x10\n 20:\tmove\ta2,v0\n 24:\tsra\ta1,v0,0x10\n 28:\tlw\tv1,132(t0)\n 2c:\tsll\tv0,a1,0x4\n 30:\taddu\tv0,v0,v1\n 34:\tlbu\tv1,9(v0)\n 38:\tli\tv0,255\n 3c:\tbeql\tv1,v0,144 \n 40:\taddiu\tv0,t2,1\n 44:\tblez\ta1,90 \n 48:\tmove\ta0,zero\n 4c:\tlw\ta3,132(t0)\n 50:\tsra\ta1,a2,0x10\n 54:\tsll\tv1,a1,0x4\n 58:\taddu\tv1,v1,a3\n 5c:\tsll\tv0,a0,0x10\n 60:\tsra\tv0,v0,0xc\n 64:\taddu\tv0,v0,a3\n 68:\tlw\tv1,12(v1)\n 6c:\tlw\tv0,12(v0)\n 70:\tbeq\tv1,v0,90 \n 74:\taddiu\tv0,a0,1\n 78:\tmove\ta0,v0\n 7c:\tsll\tv0,v0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tslt\tv0,v0,a1\n 88:\tbnez\tv0,58 \n 8c:\tsll\tv1,a1,0x4\n 90:\tsll\tv0,a0,0x10\n 94:\tsra\tv1,v0,0x10\n 98:\tsll\tv0,t2,0x10\n 9c:\tsra\ta0,v0,0x10\n a0:\tbeq\tv1,a0,d8 \n a4:\tsll\ta0,a0,0x4\n a8:\tlw\tv0,132(t0)\n ac:\taddu\ta1,a0,v0\n b0:\tsll\tv1,v1,0x4\n b4:\taddu\tv0,v1,v0\n b8:\tlbu\tv0,3(v0)\n bc:\tsb\tv0,3(a1)\n c0:\tlw\tv0,132(t0)\n c4:\taddu\ta0,a0,v0\n c8:\taddu\tv1,v1,v0\n cc:\tlbu\tv0,4(v1)\n d0:\tj\t140 \n d4:\tsb\tv0,4(a0)\n d8:\tsll\tv1,t2,0x10\n dc:\tlw\tv0,132(t0)\n e0:\tsra\tv1,v1,0xc\n e4:\taddu\tv0,v1,v0\n e8:\tmove\ta0,t1\n ec:\taddiu\ta1,t1,1\n f0:\tsb\ta0,3(v0)\n f4:\tlw\tv0,132(t0)\n f8:\taddu\tv1,v1,v0\n fc:\tlw\tv0,12(v1)\n 100:\tlw\tv0,48(v0)\n 104:\tbeqz\tv0,118 \n 108:\tmove\tt1,a1\n 10c:\tmove\tv0,t1\n 110:\taddiu\tt1,a1,1\n 114:\tsb\tv0,4(v1)\n 118:\tsll\tv0,t1,0x10\n 11c:\tsra\tv0,v0,0x10\n 120:\tslti\tv0,v0,17\n 124:\tbnez\tv0,144 \n 128:\taddiu\tv0,t2,1\n 12c:\tlui\ta0,0x0\n 130:\tjal\t0 \n 134:\taddiu\ta0,a0,0\n 138:\tj\t160 \n 13c:\tnop\n 140:\taddiu\tv0,t2,1\n 144:\tmove\tt2,v0\n 148:\tsll\tv0,v0,0x10\n 14c:\tsra\tv0,v0,0x10\n 150:\tlh\tv1,18(t0)\n 154:\tslt\tv0,v0,v1\n 158:\tbnez\tv0,20 \n 15c:\tsll\tv0,t2,0x10\n 160:\tlw\tra,16(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,24\n 16c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"func_800230F8_23CF8":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9020ed8430fedb07/u.i\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\t0000016c func_800230F8_23CF8\n00000000 *UND*\t00000000 osSyncPrintf\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n000000d0 R_MIPS_26 .text\n0000012c R_MIPS_HI16 .rodata\n00000134 R_MIPS_LO16 .rodata\n00000130 R_MIPS_26 osSyncPrintf\n00000138 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 00804021 24090004 '.........@!$...\n 0010 85020012 18400052 00005021 000a1400 .....@.R..P!....\n 0020 00403021 00022c03 8d030084 00051100 .@0!..,.........\n 0030 00431021 90430009 240200ff 50620041 .C.!.C..$...Pb.A\n 0040 25420001 18a00012 00002021 8d070084 %B........ !....\n 0050 00062c03 00051900 00671821 00041400 ..,......g.!....\n 0060 00021303 00471021 8c63000c 8c42000c .....G.!.c...B..\n 0070 10620007 24820001 00402021 00021400 .b..$....@ !....\n 0080 00021403 0045102a 1440fff3 00051900 .....E.*.@......\n 0090 00041400 00021c03 000a1400 00022403 ..............$.\n 00a0 1064000d 00042100 8d020084 00822821 .d....!.......(!\n 00b0 00031900 00621021 90420003 a0a20003 .....b.!.B......\n 00c0 8d020084 00822021 00621821 90620004 ...... !.b.!.b..\n 00d0 08000050 a0820004 000a1c00 8d020084 ...P............\n 00e0 00031b03 00621021 01202021 25250001 .....b.!. !%%..\n 00f0 a0440003 8d020084 00621821 8c62000c .D.......b.!.b..\n 0100 8c420030 10400004 00a04821 01201021 .B.0.@....H!. .!\n 0110 24a90001 a0620004 00091400 00021403 $....b..........\n 0120 28420011 14400007 25420001 3c040000 (B...@..%B..<...\n 0130 0c000000 24840000 08000058 00000000 ....$......X....\n 0140 25420001 00405021 00021400 00021403 %B...@P!........\n 0150 85030012 0043102a 1440ffb1 000a1400 .....C.*.@......\n 0160 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a00007fc 00000000 00000000 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 54657874 75726520 416e696d 65204f76 Texture Anime Ov\n 0010 65720a00 er.. \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_800230F8_23CF8' — lift: cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' 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:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tmove\tt0,a0 */\n/* c:\tli\tt1,4 */\n/* 10:\tlh\tv0,18(t0) */\n/* 14:\tblez\tv0,160 */\n/* 18:\tmove\tt2,zero */\n/* 1c:\tsll\tv0,t2,0x10 */\n/* 20:\tmove\ta2,v0 */\n/* 24:\tsra\ta1,v0,0x10 */\n/* 28:\tlw\tv1,132(t0) */\n/* 2c:\tsll\tv0,a1,0x4 */\n/* 30:\taddu\tv0,v0,v1 */\n/* 34:\tlbu\tv1,9(v0) */\n/* 38:\tli\tv0,255 */\n/* 3c:\tbeql\tv1,v0,144 */\n/* 40:\taddiu\tv0,t2,1 */\n/* 44:\tblez\ta1,90 */\n/* 48:\tmove\ta0,zero */\n/* 4c:\tlw\ta3,132(t0) */\n/* 50:\tsra\ta1,a2,0x10 */\n/* 54:\tsll\tv1,a1,0x4 */\n/* 58:\taddu\tv1,v1,a3 */\n/* 5c:\tsll\tv0,a0,0x10 */\n/* 60:\tsra\tv0,v0,0xc */\n/* 64:\taddu\tv0,v0,a3 */\n/* 68:\tlw\tv1,12(v1) */\n/* 6c:\tlw\tv0,12(v0) */\n/* 70:\tbeq\tv1,v0,90 */\n/* 74:\taddiu\tv0,a0,1 */\n/* 78:\tmove\ta0,v0 */\n/* 7c:\tsll\tv0,v0,0x10 */\n/* 80:\tsra\tv0,v0,0x10 */\n/* 84:\tslt\tv0,v0,a1 */\n/* 88:\tbnez\tv0,58 */\n/* 8c:\tsll\tv1,a1,0x4 */\n/* 90:\tsll\tv0,a0,0x10 */\n/* 94:\tsra\tv1,v0,0x10 */\n/* 98:\tsll\tv0,t2,0x10 */\n/* 9c:\tsra\ta0,v0,0x10 */\n/* a0:\tbeq\tv1,a0,d8 */\n/* a4:\tsll\ta0,a0,0x4 */\n/* a8:\tlw\tv0,132(t0) */\n/* ac:\taddu\ta1,a0,v0 */\n/* b0:\tsll\tv1,v1,0x4 */\n/* b4:\taddu\tv0,v1,v0 */\n/* b8:\tlbu\tv0,3(v0) */\n/* bc:\tsb\tv0,3(a1) */\n/* c0:\tlw\tv0,132(t0) */\n/* c4:\taddu\ta0,a0,v0 */\n/* c8:\taddu\tv1,v1,v0 */\n/* cc:\tlbu\tv0,4(v1) */\n/* d0:\tj\t140 */\n/* d4:\tsb\tv0,4(a0) */\n/* d8:\tsll\tv1,t2,0x10 */\n/* dc:\tlw\tv0,132(t0) */\n/* e0:\tsra\tv1,v1,0xc */\n/* e4:\taddu\tv0,v1,v0 */\n/* e8:\tmove\ta0,t1 */\n/* ec:\taddiu\ta1,t1,1 */\n/* f0:\tsb\ta0,3(v0) */\n/* f4:\tlw\tv0,132(t0) */\n/* f8:\taddu\tv1,v1,v0 */\n/* fc:\tlw\tv0,12(v1) */\n/* 100:\tlw\tv0,48(v0) */\n/* 104:\tbeqz\tv0,118 */\n/* 108:\tmove\tt1,a1 */\n/* 10c:\tmove\tv0,t1 */\n/* 110:\taddiu\tt1,a1,1 */\n/* 114:\tsb\tv0,4(v1) */\n/* 118:\tsll\tv0,t1,0x10 */\n/* 11c:\tsra\tv0,v0,0x10 */\n/* 120:\tslti\tv0,v0,17 */\n/* 124:\tbnez\tv0,144 */\n/* 128:\taddiu\tv0,t2,1 */\n/* 12c:\tlui\ta0,0x0 */\n/* 130:\tjal\t0 */\n/* 134:\taddiu\ta0,a0,0 */\n/* 138:\tj\t160 */\n/* 13c:\tnop */\n/* 140:\taddiu\tv0,t2,1 */\n/* 144:\tmove\tt2,v0 */\n/* 148:\tsll\tv0,v0,0x10 */\n/* 14c:\tsra\tv0,v0,0x10 */\n/* 150:\tlh\tv1,18(t0) */\n/* 154:\tslt\tv0,v0,v1 */\n/* 158:\tbnez\tv0,20 */\n/* 15c:\tsll\tv0,t2,0x10 */\n/* 160:\tlw\tra,16(sp) */\n/* 164:\tjr\tra */\n/* 168:\taddiu\tsp,sp,24 */\n/* 16c:\tnop */\nvoid func_800230F8_23CF8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' at 0x3c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":100,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' at 0x3c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"static s8 data_rodata_0[0x14] = {\n 0x54,\n 0x65,\n 0x78,\n 0x74,\n 0x75,\n 0x72,\n 0x65,\n 0x20,\n 0x41,\n 0x6E,\n 0x69,\n 0x6D,\n 0x65,\n 0x20,\n 0x4F,\n 0x76,\n 0x65,\n 0x72,\n 0xA,\n 0,\n}; /* const */\n\nvoid func_800230F8_23CF8(HmfData *arg0) {\n HmfData_Unk84_Entry *temp_a3;\n HmfData_Unk84_Entry *temp_v0_2;\n HmfData_Unk84_Entry *temp_v0_3;\n s16 temp_v0;\n s16 var_a0;\n s16 var_t2;\n s16 var_v0_2;\n s32 temp_a1;\n s32 temp_a1_2;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n s8 temp_a1_3;\n s8 temp_v0_4;\n s8 var_t1;\n u8 *temp_v1_2;\n\n var_t1 = 4;\n var_t2 = 0;\n if (arg0->unk12 > 0) {\n var_v0 = 0 << 0x10;\nloop_2:\n temp_a1 = var_v0 >> 0x10;\n if (arg0->unk84[temp_a1].unk9 != 0xFF) {\n var_a0 = 0;\n if (temp_a1 > 0) {\n temp_a3 = arg0->unk84;\n temp_a1_2 = var_v0 >> 0x10;\n var_v1 = temp_a1_2 * 0x10;\nloop_5:\n temp_v0 = var_a0 + 1;\n if (temp_a3->unk0[var_v1].unkC != temp_a3->unk0[(s32) (var_a0 << 0x10) >> 0xC].unkC) {\n var_a0 = temp_v0;\n var_v1 = temp_a1_2 * 0x10;\n if (temp_v0 < temp_a1_2) {\n goto loop_5;\n }\n }\n }\n if (var_a0 != var_t2) {\n temp_v0_2 = arg0->unk84;\n temp_v0_2[var_t2].unk3 = temp_v0_2[var_a0].unk3;\n temp_v0_3 = arg0->unk84;\n temp_v0_3[var_t2].unk4 = temp_v0_3[var_a0].unk4;\n goto block_13;\n }\n temp_v1 = (s32) (var_t2 << 0x10) >> 0xC;\n temp_a1_3 = var_t1 + 1;\n arg0->unk84->unk0[temp_v1].unk3 = var_t1;\n temp_v1_2 = &arg0->unk84->unk0[temp_v1];\n var_t1 = temp_a1_3;\n if (temp_v1_2->unkC->unk30 != 0) {\n temp_v0_4 = var_t1;\n var_t1 = temp_a1_3 + 1;\n temp_v1_2->unk4 = temp_v0_4;\n }\n var_v0_2 = var_t2 + 1;\n if ((s16) var_t1 >= 0x11) {\n osSyncPrintf(data_rodata_0, temp_a1_3, var_v0);\n return;\n }\n goto block_14;\n }\nblock_13:\n var_v0_2 = var_t2 + 1;\nblock_14:\n var_t2 = var_v0_2;\n var_v0 = var_t2 << 0x10;\n if (var_v0_2 >= arg0->unk12) {\n\n } else {\n goto loop_2;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":62,"lines":96,"gotos":4,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5604: request for member `unkC' in something not a structure or union","/c.i:5621: request for member `unk3' in something not a structure or union","/c.i:5624: request for member `unkC' in something not a structure or union","/c.i:5627: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800230F8_23CF8` — benchmark function marioparty3:func_800230F8_23CF8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800230F8_23CF8\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n move\t$t0, $a0\n li\t$t1, 4\n lh\t$v0, 18($t0)\n blez\t$v0, .L160\n move\t$t2, $zero\n sll\t$v0, $t2, 0x10\n.L20:\n move\t$a2, $v0\n sra\t$a1, $v0, 0x10\n lw\t$v1, 132($t0)\n sll\t$v0, $a1, 0x4\n addu\t$v0, $v0, $v1\n lbu\t$v1, 9($v0)\n li\t$v0, 255\n beql\t$v1, $v0, .L144\n addiu\t$v0, $t2, 1\n blez\t$a1, .L90\n move\t$a0, $zero\n lw\t$a3, 132($t0)\n sra\t$a1, $a2, 0x10\n sll\t$v1, $a1, 0x4\n.L58:\n addu\t$v1, $v1, $a3\n sll\t$v0, $a0, 0x10\n sra\t$v0, $v0, 0xc\n addu\t$v0, $v0, $a3\n lw\t$v1, 12($v1)\n lw\t$v0, 12($v0)\n beq\t$v1, $v0, .L90\n addiu\t$v0, $a0, 1\n move\t$a0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$v0, $v0, $a1\n bnez\t$v0, .L58\n sll\t$v1, $a1, 0x4\n.L90:\n sll\t$v0, $a0, 0x10\n sra\t$v1, $v0, 0x10\n sll\t$v0, $t2, 0x10\n sra\t$a0, $v0, 0x10\n beq\t$v1, $a0, .Ld8\n sll\t$a0, $a0, 0x4\n lw\t$v0, 132($t0)\n addu\t$a1, $a0, $v0\n sll\t$v1, $v1, 0x4\n addu\t$v0, $v1, $v0\n lbu\t$v0, 3($v0)\n sb\t$v0, 3($a1)\n lw\t$v0, 132($t0)\n addu\t$a0, $a0, $v0\n addu\t$v1, $v1, $v0\n lbu\t$v0, 4($v1)\n j\t.L140\n sb\t$v0, 4($a0)\n.Ld8:\n sll\t$v1, $t2, 0x10\n lw\t$v0, 132($t0)\n sra\t$v1, $v1, 0xc\n addu\t$v0, $v1, $v0\n move\t$a0, $t1\n addiu\t$a1, $t1, 1\n sb\t$a0, 3($v0)\n lw\t$v0, 132($t0)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($v1)\n lw\t$v0, 48($v0)\n beqz\t$v0, .L118\n move\t$t1, $a1\n move\t$v0, $t1\n addiu\t$t1, $a1, 1\n sb\t$v0, 4($v1)\n.L118:\n sll\t$v0, $t1, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 17\n bnez\t$v0, .L144\n addiu\t$v0, $t2, 1\n lui\t$a0, %hi(data_rodata_0)\n jal\tosSyncPrintf\n addiu\t$a0, $a0, %lo(data_rodata_0)\n j\t.L160\n nop\n.L140:\n addiu\t$v0, $t2, 1\n.L144:\n move\t$t2, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n lh\t$v1, 18($t0)\n slt\t$v0, $v0, $v1\n bnez\t$v0, .L20\n sll\t$v0, $t2, 0x10\n.L160:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\n.rodata\nglabel data_rodata_0\n.word 0x54657874\n.word 0x75726520\n.word 0x416E696D\n.word 0x65204F76\n.word 0x65720A00\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800230F8_23CF8(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800230F8_23CF8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800230F8_23CF8` — benchmark function marioparty3:func_800230F8_23CF8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800230F8_23CF8: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:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tmove\tt0,a0\n c:\tli\tt1,4\n 10:\tlh\tv0,18(t0)\n 14:\tblez\tv0,160 \n 18:\tmove\tt2,zero\n 1c:\tsll\tv0,t2,0x10\n 20:\tmove\ta2,v0\n 24:\tsra\ta1,v0,0x10\n 28:\tlw\tv1,132(t0)\n 2c:\tsll\tv0,a1,0x4\n 30:\taddu\tv0,v0,v1\n 34:\tlbu\tv1,9(v0)\n 38:\tli\tv0,255\n 3c:\tbeql\tv1,v0,144 \n 40:\taddiu\tv0,t2,1\n 44:\tblez\ta1,90 \n 48:\tmove\ta0,zero\n 4c:\tlw\ta3,132(t0)\n 50:\tsra\ta1,a2,0x10\n 54:\tsll\tv1,a1,0x4\n 58:\taddu\tv1,v1,a3\n 5c:\tsll\tv0,a0,0x10\n 60:\tsra\tv0,v0,0xc\n 64:\taddu\tv0,v0,a3\n 68:\tlw\tv1,12(v1)\n 6c:\tlw\tv0,12(v0)\n 70:\tbeq\tv1,v0,90 \n 74:\taddiu\tv0,a0,1\n 78:\tmove\ta0,v0\n 7c:\tsll\tv0,v0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tslt\tv0,v0,a1\n 88:\tbnez\tv0,58 \n 8c:\tsll\tv1,a1,0x4\n 90:\tsll\tv0,a0,0x10\n 94:\tsra\tv1,v0,0x10\n 98:\tsll\tv0,t2,0x10\n 9c:\tsra\ta0,v0,0x10\n a0:\tbeq\tv1,a0,d8 \n a4:\tsll\ta0,a0,0x4\n a8:\tlw\tv0,132(t0)\n ac:\taddu\ta1,a0,v0\n b0:\tsll\tv1,v1,0x4\n b4:\taddu\tv0,v1,v0\n b8:\tlbu\tv0,3(v0)\n bc:\tsb\tv0,3(a1)\n c0:\tlw\tv0,132(t0)\n c4:\taddu\ta0,a0,v0\n c8:\taddu\tv1,v1,v0\n cc:\tlbu\tv0,4(v1)\n d0:\tj\t140 \n d4:\tsb\tv0,4(a0)\n d8:\tsll\tv1,t2,0x10\n dc:\tlw\tv0,132(t0)\n e0:\tsra\tv1,v1,0xc\n e4:\taddu\tv0,v1,v0\n e8:\tmove\ta0,t1\n ec:\taddiu\ta1,t1,1\n f0:\tsb\ta0,3(v0)\n f4:\tlw\tv0,132(t0)\n f8:\taddu\tv1,v1,v0\n fc:\tlw\tv0,12(v1)\n 100:\tlw\tv0,48(v0)\n 104:\tbeqz\tv0,118 \n 108:\tmove\tt1,a1\n 10c:\tmove\tv0,t1\n 110:\taddiu\tt1,a1,1\n 114:\tsb\tv0,4(v1)\n 118:\tsll\tv0,t1,0x10\n 11c:\tsra\tv0,v0,0x10\n 120:\tslti\tv0,v0,17\n 124:\tbnez\tv0,144 \n 128:\taddiu\tv0,t2,1\n 12c:\tlui\ta0,0x0\n 130:\tjal\t0 \n 134:\taddiu\ta0,a0,0\n 138:\tj\t160 \n 13c:\tnop\n 140:\taddiu\tv0,t2,1\n 144:\tmove\tt2,v0\n 148:\tsll\tv0,v0,0x10\n 14c:\tsra\tv0,v0,0x10\n 150:\tlh\tv1,18(t0)\n 154:\tslt\tv0,v0,v1\n 158:\tbnez\tv0,20 \n 15c:\tsll\tv0,t2,0x10\n 160:\tlw\tra,16(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,24\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-gcc272-9020ed8430fedb07/u.i\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\t0000016c func_800230F8_23CF8\n00000000 *UND*\t00000000 osSyncPrintf\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n000000d0 R_MIPS_26 .text\n0000012c R_MIPS_HI16 .rodata\n00000134 R_MIPS_LO16 .rodata\n00000130 R_MIPS_26 osSyncPrintf\n00000138 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 00804021 24090004 '.........@!$...\n 0010 85020012 18400052 00005021 000a1400 .....@.R..P!....\n 0020 00403021 00022c03 8d030084 00051100 .@0!..,.........\n 0030 00431021 90430009 240200ff 50620041 .C.!.C..$...Pb.A\n 0040 25420001 18a00012 00002021 8d070084 %B........ !....\n 0050 00062c03 00051900 00671821 00041400 ..,......g.!....\n 0060 00021303 00471021 8c63000c 8c42000c .....G.!.c...B..\n 0070 10620007 24820001 00402021 00021400 .b..$....@ !....\n 0080 00021403 0045102a 1440fff3 00051900 .....E.*.@......\n 0090 00041400 00021c03 000a1400 00022403 ..............$.\n 00a0 1064000d 00042100 8d020084 00822821 .d....!.......(!\n 00b0 00031900 00621021 90420003 a0a20003 .....b.!.B......\n 00c0 8d020084 00822021 00621821 90620004 ...... !.b.!.b..\n 00d0 08000050 a0820004 000a1c00 8d020084 ...P............\n 00e0 00031b03 00621021 01202021 25250001 .....b.!. !%%..\n 00f0 a0440003 8d020084 00621821 8c62000c .D.......b.!.b..\n 0100 8c420030 10400004 00a04821 01201021 .B.0.@....H!. .!\n 0110 24a90001 a0620004 00091400 00021403 $....b..........\n 0120 28420011 14400007 25420001 3c040000 (B...@..%B..<...\n 0130 0c000000 24840000 08000058 00000000 ....$......X....\n 0140 25420001 00405021 00021400 00021403 %B...@P!........\n 0150 85030012 0043102a 1440ffb1 000a1400 .....C.*.@......\n 0160 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a00007fc 00000000 00000000 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 54657874 75726520 416e696d 65204f76 Texture Anime Ov\n 0010 65720a00 er.. \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_800230F8_23CF8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_800230F8_23CF8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002FD48_30948\n jr\t$ra\n sw\t$zero, 160($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002FD48_30948(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002FD48_30948 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045314_45F14:gcc2.7.2","sym":"func_80045314_45F14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","arithmetic","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045314_45F14\n lui\t$v1, %hi(omovl)\n lw\t$v1, %lo(omovl)($v1)\n li\t$v0, 2\n beq\t$v1, $v0, .L24\n li\t$v0, 3\n beq\t$v1, $v0, .L28\n li\t$v0, -20\n j\t.L28\n move\t$v0, $zero\n.L24:\n li\t$v0, 20\n.L28:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045314_45F14 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045350_45F50:gcc2.7.2","sym":"func_80045350_45F50","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045350_45F50\n lui\t$v1, %hi(GwSystem)\n lb\t$v1, %lo(GwSystem)($v1)\n addiu\t$v1, $v1, -1\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800A6D44_A7944)\n addu\t$v1, $v1, $v0\n lbu\t$v1, %lo(D_800A6D44_A7944)($v1)\n li\t$v0, 6\n beq\t$v1, $v0, .L64\n nop\n move\t$v1, $zero\n lui\t$a0, %hi(GwPlayer)\n addiu\t$a0, $a0, %lo(GwPlayer)\n sll\t$v0, $v1, 0x3\n.L40:\n subu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x3\n addu\t$v0, $v0, $a0\n sh\t$zero, 6($v0)\n sh\t$zero, 8($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 4\n bnez\t$v0, .L40\n sll\t$v0, $v1, 0x3\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80045350_45F50(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045350_45F50 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045BF0_467F0:gcc2.7.2","sym":"func_80045BF0_467F0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","arithmetic","loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045BF0_467F0\n move\t$v1, $zero\n andi\t$a0, $a0, 0xff\n.L8:\n lui\t$v0, %hi(D_800A1590_A2190)\n addu\t$v0, $v0, $v1\n lbu\t$v0, %lo(D_800A1590_A2190)($v0)\n beq\t$a0, $v0, .L2c\n sltiu\t$v0, $v1, 9\n addiu\t$v1, $v1, 1\n sltiu\t$v0, $v1, 9\n bnez\t$v0, .L8\n nop\n.L2c:\n beqzl\t$v0, .L34\n li\t$v1, -1\n.L34:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_80045BF0_467F0(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045BF0_467F0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80047E90_48A90:gcc2.7.2","sym":"func_80047E90_48A90","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80047E90_48A90\n lw\t$v0, 16($a0)\n or\t$a1, $a1, $v0\n jr\t$ra\n sw\t$a1, 16($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80047E90_48A90(omObjData *obj, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80047E90_48A90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A444_4B044:gcc2.7.2","sym":"func_8004A444_4B044","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":5,"refSource":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz","proto":{"func_8004A444_4B044":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D1710_D2310"}],"outcome":"match","source":"void func_8004A444_4B044(u32 a0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = a0;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = (s8) arg0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A444_4B044\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\n lui\t$at, %hi(D_800D1710_D2310)\n jr\t$ra\n sb\t$a0, %lo(D_800D1710_D2310)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A444_4B044(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A444_4B044 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A468_4B068:gcc2.7.2","sym":"func_8004A468_4B068","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":7,"refSource":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz","proto":{"func_8004A468_4B068":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800CD2F4_CDEF4"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D4082_D4C82"},{"name":"D_800D6A56_D7656"}],"outcome":"match","source":"void func_8004A468_4B068(u32 a0, u32 a1, u32 a2) {\n D_800D4082_D4C82 = a0;\n D_800CD2F4_CDEF4 = a1;\n D_800D6A56_D7656 = a2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A468_4B068\n lui\t$at, %hi(D_800D4082_D4C82)\n sh\t$a0, %lo(D_800D4082_D4C82)($at)\n lui\t$at, %hi(D_800CD2F4_CDEF4)\n sh\t$a1, %lo(D_800CD2F4_CDEF4)($at)\n lui\t$at, %hi(D_800D6A56_D7656)\n sh\t$a2, %lo(D_800D6A56_D7656)($at)\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n jr\t$ra\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A468_4B068 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80052E14_53A14:gcc2.7.2","sym":"func_80052E14_53A14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80052E14_53A14\n lw\t$v0, 132($a0)\n sw\t$v0, 104($a0)\n lbu\t$v0, 136($a0)\n sb\t$v0, 108($a0)\n lhu\t$v0, 14($a0)\n sh\t$v0, 110($a0)\n lhu\t$v0, 138($a0)\n sh\t$v0, 114($a0)\n lhu\t$v0, 12($a0)\n sh\t$v0, 112($a0)\n lwc1\t$f0, 140($a0)\n swc1\t$f0, 116($a0)\n lwc1\t$f0, 16($a0)\n swc1\t$f0, 120($a0)\n lbu\t$v0, 146($a0)\n sb\t$v0, 126($a0)\n lhu\t$v0, 144($a0)\n sh\t$v0, 124($a0)\n sb\t$zero, 128($a0)\n jr\t$ra\n sb\t$zero, 127($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80052E14_53A14(HuSprite *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80052E14_53A14 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800560D8_56CD8:gcc2.7.2","sym":"func_800560D8_56CD8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800560D8_56CD8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nHuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800560D8_56CD8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005614C_56D4C:gcc2.7.2","sym":"func_8005614C_56D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":5,"refSource":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n HuSprite_Unk84_Unk00_Struct *entry = &D_800C9530_CA130[arg0]->unk00[arg1];\n\n return entry->unk00;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_8005614C_56D4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005614C_56D4C' — lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\taddu\tv0,v0,v1 */\n/* 2c:\tjr\tra */\n/* 30:\tlw\tv0,0(v0) */\n/* \t... */\nvoid func_8005614C_56D4C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n return *(((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005614C_56D4C\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n addu\t$v0, $v0, $v1\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_8005614C_56D4C(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005614C_56D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056254_56E54:gcc2.7.2","sym":"func_80056254_56E54","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80056254_56E54":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void func_80056254_56E54(s32 * a0) {\n return;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056254_56E54\n lw\t$v0, 0($a0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056254_56E54(HuSprite_Unk84_Struct **arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056254_56E54 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056260_56E60:gcc2.7.2","sym":"func_80056260_56E60","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056260_56E60\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(D_800C9530_CA130)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(D_800C9530_CA130)($v0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056260_56E60(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056260_56E60 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056C98_57898:gcc2.7.2","sym":"func_80056C98_57898","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056C98_57898\n lw\t$a1, 0($a0)\n lbu\t$v0, 0($a1)\n sll\t$v0, $v0, 0x18\n lbu\t$v1, 1($a1)\n sll\t$v1, $v1, 0x10\n addu\t$v0, $v0, $v1\n lbu\t$v1, 2($a1)\n sll\t$v1, $v1, 0x8\n addu\t$v0, $v0, $v1\n lbu\t$v1, 3($a1)\n addiu\t$a1, $a1, 4\n sw\t$a1, 0($a0)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056C98_57898 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800570A8_57CA8:gcc2.7.2","sym":"func_800570A8_57CA8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic","union","float","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800570A8_57CA8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(HuSprGrpData)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(HuSprGrpData)($v0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0xe\n addu\t$a1, $a1, $v0\n lw\t$a0, 16($a1)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0xe\n lui\t$v0, %hi(D_800D0A50_D1650)\n addu\t$v0, $v0, $a2\n lw\t$v0, %lo(D_800D0A50_D1650)($v0)\n sw\t$v0, 152($a0)\n lui\t$at, 0x3f80\n mtc1\t$at, $f0\n nop\n swc1\t$f0, 252($a0)\n move\t$v1, $zero\n li\t$a1, 0xffff\n sll\t$v0, $v1, 0x1\n.L58:\n addu\t$v0, $v0, $a0\n sh\t$a1, 156($v0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $a0\n sw\t$zero, 188($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 16\n bnezl\t$v0, .L58\n sll\t$v0, $v1, 0x1\n jr\t$ra\n sw\t$zero, 260($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800570A8_57CA8(s16 group, s16 member, s16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800570A8_57CA8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005FA90_60690:gcc2.7.2","sym":"func_8005FA90_60690","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","global","arithmetic","loop","nested-loop","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005FA90_60690\n move\t$t0, $zero\n lbu\t$a3, 0($a0)\n sll\t$a2, $t0, 0x10\n.Lc:\n sra\t$a1, $a2, 0x10\n lui\t$v0, %hi(D_800A232C_A2F2C)\n addu\t$v0, $v0, $a1\n lbu\t$v0, %lo(D_800A232C_A2F2C)($v0)\n bne\t$v0, $a3, .L50\n addiu\t$v0, $t0, 2\n lui\t$v1, %hi(D_800A232C_A2F2C)\n addu\t$v1, $v1, $a1\n lbu\t$v1, %lo(D_800A232C_A2F2C)($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .L50\n addiu\t$v0, $t0, 2\n srl\t$v0, $a2, 0x1f\n addu\t$v0, $a1, $v0\n srl\t$v0, $v0, 0x1\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.L50:\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 10\n bnez\t$v0, .Lc\n sll\t$a2, $t0, 0x10\n move\t$t0, $zero\n lui\t$t4, %hi(D_800A2344_A2F44)\n addiu\t$t4, $t4, %lo(D_800A2344_A2F44)\n lbu\t$t3, 0($a0)\n move\t$a3, $zero\n.L7c:\n sll\t$v1, $t0, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $t4\n lw\t$t1, 0($v0)\n sll\t$t2, $v1, 0x4\n sll\t$a1, $a3, 0x10\n.L98:\n sra\t$a2, $a1, 0x10\n addu\t$v1, $t1, $a2\n lbu\t$v0, 0($v1)\n bne\t$v0, $t3, .Ld4\n addiu\t$v0, $a3, 2\n lbu\t$v1, 1($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .Ld4\n addiu\t$v0, $a3, 2\n srl\t$v0, $a1, 0x1f\n addu\t$v0, $a2, $v0\n sra\t$v0, $v0, 0x1\n addu\t$v0, $v0, $t2\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.Ld4:\n move\t$a3, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 32\n bnez\t$v0, .L98\n sll\t$a1, $a3, 0x10\n addiu\t$v0, $t0, 1\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 16\n bnezl\t$v0, .L7c\n move\t$a3, $zero\n li\t$v0, 16\n.L10c:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 func_8005FA90_60690(u8 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005FA90_60690 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800600C0_60CC0:gcc2.7.2","sym":"func_800600C0_60CC0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic","bitwise"],"loc":10,"refSource":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *window;\n\n window = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n window->unk_38 |= 0x10;\n } else {\n window->unk_38 &= ~0x10;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","proto":{"func_800600C0_60CC0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"void func_800600C0_60CC0(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n","score":41,"maxScore":42,"compileErrors":null,"breakdown":{"insert":23,"delete":7,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":98,"lines":12,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *temp_a0;\n u32 var_v0;\n\n temp_a0 = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n var_v0 = temp_a0->unk_38 | 0x10;\n } else {\n var_v0 = temp_a0->unk_38 & ~0x10;\n }\n temp_a0->unk_38 = var_v0;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800600C0_60CC0\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n beqz\t$a1, .L38\n addu\t$a0, $v0, $v1\n lw\t$v0, 56($a0)\n j\t.L44\n ori\t$v0, $v0, 0x10\n.L38:\n lw\t$v0, 56($a0)\n li\t$v1, -17\n and\t$v0, $v0, $v1\n.L44:\n jr\t$ra\n sw\t$v0, 56($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800600C0_60CC0(s16 winId, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800600C0_60CC0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8006014C_60D4C:gcc2.7.2","sym":"func_8006014C_60D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_8006014C_60D4C(u32 a0) {\n return ((s8 *)((a0 * 160 - a0 << 2) + D_800CC69C_CD29C))[49];\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8006014C_60D4C\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n addu\t$v0, $v0, $v1\n jr\t$ra\n lb\t$v0, 49($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns8 func_8006014C_60D4C(s32 winId);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8006014C_60D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80071B40_72740:gcc2.7.2","sym":"func_80071B40_72740","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80071B40_72740\n jr\t$ra\n sh\t$a1, 22($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80071B40_72740(ALVoice *voice, s16 priority);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80071B40_72740 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8008A0D0_8ACD0:gcc2.7.2","sym":"func_8008A0D0_8ACD0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","union","array","field"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8008A0D0_8ACD0\n sw\t$zero, 60($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 48($a0)\n sw\t$zero, 44($a0)\n sw\t$zero, 40($a0)\n sw\t$zero, 36($a0)\n sw\t$zero, 32($a0)\n sw\t$zero, 24($a0)\n sw\t$zero, 16($a0)\n sw\t$zero, 12($a0)\n sw\t$zero, 4($a0)\n lui\t$v0, 0x1\n sw\t$v0, 20($a0)\n sw\t$v0, 0($a0)\n li\t$v0, 1\n sw\t$v0, 28($a0)\n jr\t$ra\n sw\t$v0, 8($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8008A0D0_8ACD0(Mtx *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8008A0D0_8ACD0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWBoardRecordGet:gcc2.7.2","sym":"GWBoardRecordGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","arithmetic","bitwise","strength-reduce"],"loc":12,"refSource":"u8 *GWBoardRecordGet(s16 arg0) {\n s16 idx = arg0;\n\n if (arg0 < 0) {\n idx = GwSystem.current_board_index;\n }\n\n if (GwSystem.playMode & 1) {\n return (u8 *)&GwCommon.unk_1D[2] + idx * 9;\n }\n return (u8 *)&GwCommon.unk_1D[0x38] + idx * 9;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"GwCommon","shape":"struct GwCommon_s (164 B)"},{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"nonmatch","source":"s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = (s32)(GwSystem.current_board_index << 24) >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n","score":20,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? GwCommon;\nextern u8 GwSystem;\n\nvoid *GWBoardRecordGet(s8 arg0) {\n s32 var_v0;\n s8 var_v1;\n\n var_v1 = arg0;\n if (arg0 & 0x8000) {\n var_v1 = (s8) GwSystem;\n }\n if (!(GwSystem & 1)) {\n var_v0 = (s16) var_v1 * 9;\n } else {\n var_v0 = (s16) var_v1 * 9;\n }\n return var_v0 + &GwCommon;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":16,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":20,"maxScore":26,"ratio":0.7692307692307693,"kinds":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWBoardRecordGet\n move\t$v1, $a0\n sll\t$a0, $a0, 0x10\n bgez\t$a0, .L20\n nop\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n.L20:\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L4c\n sll\t$v1, $v1, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n j\t.L60\n addiu\t$v1, $v1, %lo(GwCommon)\n.L4c:\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n addiu\t$v1, $v1, %lo(GwCommon)\n.L60:\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWBoardRecordGet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWMgNoSet:gcc2.7.2","sym":"GWMgNoSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global","struct","field","store"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWMgNoSet\n lui\t$at, %hi(GwSystem)\n jr\t$ra\n sb\t$a0, %lo(GwSystem)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWMgNoSet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:Hu3DCam3DToScreen:gcc2.7.2","sym":"Hu3DCam3DToScreen","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["float","array","arithmetic","struct","call"],"loc":37,"refSource":"void Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos) {\n f32 x;\n f32 y;\n f32 z;\n f32 projectedX;\n f32 projectedY;\n f32 projectedZ;\n HuCamera *camera;\n HuMtx4F viewMtx;\n\n camera = &gCameraList[camIndex];\n guLookAtF(\n viewMtx,\n camera->pos.x,\n camera->pos.y,\n camera->pos.z,\n camera->at.x,\n camera->at.y,\n camera->at.z,\n camera->up.x,\n camera->up.y,\n camera->up.z);\n\n x = worldPos->x;\n y = worldPos->y;\n z = worldPos->z;\n x -= camera->pos.x;\n y -= camera->pos.y;\n z -= camera->pos.z;\n projectedX = ((x * viewMtx[0][0]) + (y * viewMtx[1][0])) + (z * viewMtx[2][0]);\n projectedY = ((x * viewMtx[0][1]) + (y * viewMtx[1][1])) + (z * viewMtx[2][1]);\n projectedZ = ((x * viewMtx[0][2]) + (y * viewMtx[1][2])) + (z * viewMtx[2][2]);\n x = HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f) * projectedZ * ASPECT_RATIO;\n y = (HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f)) * projectedZ;\n outPos->x = (projectedX * (SCREEN_WIDTH_CENTER / (-x))) + SCREEN_WIDTH_CENTER;\n outPos->y = ((projectedY * (SCREEN_HEIGHT_CENTER / y)) + SCREEN_HEIGHT_CENTER);\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L135-L171","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlui\tat,0x3faa\n 158:\tori\tat,at,0xaaab\n 15c:\tmtc1\tat,$f0\n 160:\tnop\n 164:\tmul.s\t$f30,$f30,$f0\n 168:\tlwc1\t$f12,80(s0)\n 16c:\tjal\t0 \n 170:\tdiv.s\t$f12,$f12,$f26\n 174:\tmov.s\t$f28,$f0\n 178:\tlwc1\t$f12,80(s0)\n 17c:\tjal\t0 \n 180:\tdiv.s\t$f12,$f12,$f26\n 184:\tdiv.s\t$f28,$f28,$f0\n 188:\tmul.s\t$f28,$f28,$f20\n 18c:\tneg.s\t$f0,$f30\n 190:\tlui\tat,0x4320\n 194:\tmtc1\tat,$f2\n 198:\tnop\n 19c:\tdiv.s\t$f0,$f2,$f0\n 1a0:\tmul.s\t$f24,$f24,$f0\n 1a4:\tadd.s\t$f24,$f24,$f2\n 1a8:\tswc1\t$f24,0(s2)\n 1ac:\tlui\tat,0x42f0\n 1b0:\tmtc1\tat,$f2\n 1b4:\tnop\n 1b8:\tdiv.s\t$f0,$f2,$f28\n 1bc:\tmul.s\t$f22,$f22,$f0\n 1c0:\tadd.s\t$f22,$f22,$f2\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"Hu3DCam3DToScreen":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f1f2d05701a38846/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 Hu3DCam3DToScreen\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n0000016c R_MIPS_26 HuMathSin\n0000017c R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 3c013faa 3421aaab 44810000 F...<.?.4!..D...\n 0160 00000000 4600f782 c60c0050 0c000000 ....F......P....\n 0170 461a6303 46000706 c60c0050 0c000000 F.c.F......P....\n 0180 461a6303 4600e703 4614e702 4600f007 F.c.F...F...F...\n 0190 3c014320 44811000 00000000 46001003 <.C D.......F...\n 01a0 4600c602 4602c600 e6580000 3c0142f0 F...F....X..<.B.\n 01b0 44811000 00000000 461c1003 4600b582 D.......F...F...\n 01c0 4602b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501005 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'Hu3DCam3DToScreen' — lift: cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — 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,-168 */\n/* 4:\tsw\tra,116(sp) */\n/* 8:\tsw\ts2,112(sp) */\n/* c:\tsw\ts1,108(sp) */\n/* 10:\tsw\ts0,104(sp) */\n/* 14:\tsdc1\t$f30,160(sp) */\n/* 18:\tsdc1\t$f28,152(sp) */\n/* 1c:\tsdc1\t$f26,144(sp) */\n/* 20:\tsdc1\t$f24,136(sp) */\n/* 24:\tsdc1\t$f22,128(sp) */\n/* 28:\tsdc1\t$f20,120(sp) */\n/* 2c:\tmove\ts1,a1 */\n/* 30:\tmove\ts2,a2 */\n/* 34:\tsll\ta0,a0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\tsll\ts0,a0,0x3 */\n/* 40:\taddu\ts0,s0,a0 */\n/* 44:\tsll\ts0,s0,0x2 */\n/* 48:\tsubu\ts0,s0,a0 */\n/* 4c:\tsll\ts0,s0,0x4 */\n/* 50:\tlui\tv0,0x0 */\n/* 54:\tlw\tv0,0(v0) */\n/* 58:\taddu\ts0,s0,v0 */\n/* 5c:\tlwc1\t$f0,28(s0) */\n/* 60:\tswc1\t$f0,16(sp) */\n/* 64:\tlwc1\t$f0,32(s0) */\n/* 68:\tswc1\t$f0,20(sp) */\n/* 6c:\tlwc1\t$f0,36(s0) */\n/* 70:\tswc1\t$f0,24(sp) */\n/* 74:\tlwc1\t$f0,40(s0) */\n/* 78:\tswc1\t$f0,28(sp) */\n/* 7c:\tlwc1\t$f0,44(s0) */\n/* 80:\tswc1\t$f0,32(sp) */\n/* 84:\tlwc1\t$f0,48(s0) */\n/* 88:\tswc1\t$f0,36(sp) */\n/* 8c:\tlw\ta1,16(s0) */\n/* 90:\tlw\ta2,20(s0) */\n/* 94:\tlw\ta3,24(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\taddiu\ta0,sp,40 */\n/* a0:\tlwc1\t$f30,0(s1) */\n/* a4:\tlwc1\t$f28,4(s1) */\n/* a8:\tlwc1\t$f2,8(s1) */\n/* ac:\tlwc1\t$f0,16(s0) */\n/* b0:\tsub.s\t$f30,$f30,$f0 */\n/* b4:\tlwc1\t$f0,20(s0) */\n/* b8:\tsub.s\t$f28,$f28,$f0 */\n/* bc:\tlwc1\t$f0,24(s0) */\n/* c0:\tsub.s\t$f2,$f2,$f0 */\n/* c4:\tlwc1\t$f24,40(sp) */\n/* c8:\tmul.s\t$f24,$f30,$f24 */\n/* cc:\tlwc1\t$f0,56(sp) */\n/* d0:\tmul.s\t$f0,$f28,$f0 */\n/* d4:\tadd.s\t$f24,$f24,$f0 */\n/* d8:\tlwc1\t$f0,72(sp) */\n/* dc:\tmul.s\t$f0,$f2,$f0 */\n/* e0:\tadd.s\t$f24,$f24,$f0 */\n/* e4:\tlwc1\t$f22,44(sp) */\n/* e8:\tmul.s\t$f22,$f30,$f22 */\n/* ec:\tlwc1\t$f0,60(sp) */\n/* f0:\tmul.s\t$f0,$f28,$f0 */\n/* f4:\tadd.s\t$f22,$f22,$f0 */\n/* f8:\tlwc1\t$f0,76(sp) */\n/* fc:\tmul.s\t$f0,$f2,$f0 */\n/* 100:\tadd.s\t$f22,$f22,$f0 */\n/* 104:\tlwc1\t$f20,48(sp) */\n/* 108:\tmul.s\t$f20,$f30,$f20 */\n/* 10c:\tlwc1\t$f0,64(sp) */\n/* 110:\tmul.s\t$f0,$f28,$f0 */\n/* 114:\tadd.s\t$f20,$f20,$f0 */\n/* 118:\tlwc1\t$f0,80(sp) */\n/* 11c:\tmul.s\t$f2,$f2,$f0 */\n/* 120:\tadd.s\t$f20,$f20,$f2 */\n/* 124:\tlwc1\t$f12,80(s0) */\n/* 128:\tlui\tat,0x4000 */\n/* 12c:\tmtc1\tat,$f26 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tdiv.s\t$f12,$f12,$f26 */\n/* 13c:\tmov.s\t$f28,$f0 */\n/* 140:\tlwc1\t$f12,80(s0) */\n/* 144:\tjal\t0 */\n/* 148:\tdiv.s\t$f12,$f12,$f26 */\n/* 14c:\tdiv.s\t$f30,$f28,$f0 */\n/* 150:\tmul.s\t$f30,$f30,$f20 */\n/* 154:\tlui\tat,0x3faa */\n/* 158:\tori\tat,at,0xaaab */\n/* 15c:\tmtc1\tat,$f0 */\n/* 160:\tnop */\n/* 164:\tmul.s\t$f30,$f30,$f0 */\n/* 168:\tlwc1\t$f12,80(s0) */\n/* 16c:\tjal\t0 */\n/* 170:\tdiv.s\t$f12,$f12,$f26 */\n/* 174:\tmov.s\t$f28,$f0 */\n/* 178:\tlwc1\t$f12,80(s0) */\n/* 17c:\tjal\t0 */\n/* 180:\tdiv.s\t$f12,$f12,$f26 */\n/* 184:\tdiv.s\t$f28,$f28,$f0 */\n/* 188:\tmul.s\t$f28,$f28,$f20 */\n/* 18c:\tneg.s\t$f0,$f30 */\n/* 190:\tlui\tat,0x4320 */\n/* 194:\tmtc1\tat,$f2 */\n/* 198:\tnop */\n/* 19c:\tdiv.s\t$f0,$f2,$f0 */\n/* 1a0:\tmul.s\t$f24,$f24,$f0 */\n/* 1a4:\tadd.s\t$f24,$f24,$f2 */\n/* 1a8:\tswc1\t$f24,0(s2) */\n/* 1ac:\tlui\tat,0x42f0 */\n/* 1b0:\tmtc1\tat,$f2 */\n/* 1b4:\tnop */\n/* 1b8:\tdiv.s\t$f0,$f2,$f28 */\n/* 1bc:\tmul.s\t$f22,$f22,$f0 */\n/* 1c0:\tadd.s\t$f22,$f22,$f2 */\n/* 1c4:\tswc1\t$f22,4(s2) */\n/* 1c8:\tlw\tra,116(sp) */\n/* 1cc:\tlw\ts2,112(sp) */\n/* 1d0:\tlw\ts1,108(sp) */\n/* 1d4:\tlw\ts0,104(sp) */\n/* 1d8:\tldc1\t$f30,160(sp) */\n/* 1dc:\tldc1\t$f28,152(sp) */\n/* 1e0:\tldc1\t$f26,144(sp) */\n/* 1e4:\tldc1\t$f24,136(sp) */\n/* 1e8:\tldc1\t$f22,128(sp) */\n/* 1ec:\tldc1\t$f20,120(sp) */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,168 */\n/* \t... */\nvoid Hu3DCam3DToScreen(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos) {\n HuCamera *temp_s0;\n f32 temp_f20;\n f32 temp_f22;\n f32 temp_f24;\n f32 temp_f28;\n f32 temp_f28_2;\n f32 temp_f28_3;\n f32 temp_f28_4;\n f32 temp_f2;\n f32 temp_f30;\n f32 temp_f30_2;\n\n temp_s0 = &gCameraList[camIndex];\n guLookAtF((f32 (*)[4]) &sp28[0], temp_s0->pos.x, temp_s0->pos.y, temp_s0->pos.z, temp_s0->at.x, temp_s0->at.y, temp_s0->at.z, temp_s0->up.x, temp_s0->up.y, temp_s0->up.z);\n temp_f30 = worldPos->x - temp_s0->pos.x;\n temp_f28 = worldPos->y - temp_s0->pos.y;\n temp_f2 = worldPos->z - temp_s0->pos.z;\n temp_f24 = (temp_f30 * sp28[0]) + (temp_f28 * sp38) + (temp_f2 * sp48);\n temp_f22 = (temp_f30 * sp28[1]) + (temp_f28 * sp3C) + (temp_f2 * sp4C);\n temp_f20 = (temp_f30 * sp28[2]) + (temp_f28 * sp40) + (temp_f2 * sp50);\n temp_f28_2 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f30_2 = (temp_f28_2 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20 * 1.3333334f;\n temp_f28_3 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f28_4 = (temp_f28_3 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20;\n outPos->x = (temp_f24 * (160.0f / -temp_f30_2)) + 160.0f;\n outPos->y = (temp_f22 * (120.0f / temp_f28_4)) + 120.0f;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":27,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5563: `sp28' undeclared (first use this function)","/c.i:5563: (Each undeclared identifier is reported only once","/c.i:5563: for each function it appears in.)","/c.i:5567: `sp38' undeclared (first use this function)","/c.i:5567: `sp48' undeclared (first use this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Hu3DCam3DToScreen` — benchmark function marioparty3:Hu3DCam3DToScreen:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 Hu3DCam3DToScreen\n addiu\t$sp, $sp, -168\n sw\t$ra, 116($sp)\n sw\t$s2, 112($sp)\n sw\t$s1, 108($sp)\n sw\t$s0, 104($sp)\n sdc1\t$f30, 160($sp)\n sdc1\t$f28, 152($sp)\n sdc1\t$f26, 144($sp)\n sdc1\t$f24, 136($sp)\n sdc1\t$f22, 128($sp)\n sdc1\t$f20, 120($sp)\n move\t$s1, $a1\n move\t$s2, $a2\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$s0, $a0, 0x3\n addu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x2\n subu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x4\n lui\t$v0, %hi(gCameraList)\n lw\t$v0, %lo(gCameraList)($v0)\n addu\t$s0, $s0, $v0\n lwc1\t$f0, 28($s0)\n swc1\t$f0, 16($sp)\n lwc1\t$f0, 32($s0)\n swc1\t$f0, 20($sp)\n lwc1\t$f0, 36($s0)\n swc1\t$f0, 24($sp)\n lwc1\t$f0, 40($s0)\n swc1\t$f0, 28($sp)\n lwc1\t$f0, 44($s0)\n swc1\t$f0, 32($sp)\n lwc1\t$f0, 48($s0)\n swc1\t$f0, 36($sp)\n lw\t$a1, 16($s0)\n lw\t$a2, 20($s0)\n lw\t$a3, 24($s0)\n jal\tguLookAtF\n addiu\t$a0, $sp, 40\n lwc1\t$f30, 0($s1)\n lwc1\t$f28, 4($s1)\n lwc1\t$f2, 8($s1)\n lwc1\t$f0, 16($s0)\n sub.s\t$f30, $f30, $f0\n lwc1\t$f0, 20($s0)\n sub.s\t$f28, $f28, $f0\n lwc1\t$f0, 24($s0)\n sub.s\t$f2, $f2, $f0\n lwc1\t$f24, 40($sp)\n mul.s\t$f24, $f30, $f24\n lwc1\t$f0, 56($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f0, 72($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f22, 44($sp)\n mul.s\t$f22, $f30, $f22\n lwc1\t$f0, 60($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f0, 76($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f20, 48($sp)\n mul.s\t$f20, $f30, $f20\n lwc1\t$f0, 64($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f20, $f20, $f0\n lwc1\t$f0, 80($sp)\n mul.s\t$f2, $f2, $f0\n add.s\t$f20, $f20, $f2\n lwc1\t$f12, 80($s0)\n lui\t$at, 0x4000\n mtc1\t$at, $f26\n nop\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f30, $f28, $f0\n mul.s\t$f30, $f30, $f20\n lui\t$at, 0x3faa\n ori\t$at, $at, 0xaaab\n mtc1\t$at, $f0\n nop\n mul.s\t$f30, $f30, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f28, $f28, $f0\n mul.s\t$f28, $f28, $f20\n neg.s\t$f0, $f30\n lui\t$at, 0x4320\n mtc1\t$at, $f2\n nop\n div.s\t$f0, $f2, $f0\n mul.s\t$f24, $f24, $f0\n add.s\t$f24, $f24, $f2\n swc1\t$f24, 0($s2)\n lui\t$at, 0x42f0\n mtc1\t$at, $f2\n nop\n div.s\t$f0, $f2, $f28\n mul.s\t$f22, $f22, $f0\n add.s\t$f22, $f22, $f2\n swc1\t$f22, 4($s2)\n lw\t$ra, 116($sp)\n lw\t$s2, 112($sp)\n lw\t$s1, 108($sp)\n lw\t$s0, 104($sp)\n ldc1\t$f30, 160($sp)\n ldc1\t$f28, 152($sp)\n ldc1\t$f26, 144($sp)\n ldc1\t$f24, 136($sp)\n ldc1\t$f22, 128($sp)\n ldc1\t$f20, 120($sp)\n jr\t$ra\n addiu\t$sp, $sp, 168\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Hu3DCam3DToScreen # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Hu3DCam3DToScreen` — benchmark function marioparty3:Hu3DCam3DToScreen:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:Hu3DCam3DToScreen: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:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlui\tat,0x3faa\n 158:\tori\tat,at,0xaaab\n 15c:\tmtc1\tat,$f0\n 160:\tnop\n 164:\tmul.s\t$f30,$f30,$f0\n 168:\tlwc1\t$f12,80(s0)\n 16c:\tjal\t0 \n 170:\tdiv.s\t$f12,$f12,$f26\n 174:\tmov.s\t$f28,$f0\n 178:\tlwc1\t$f12,80(s0)\n 17c:\tjal\t0 \n 180:\tdiv.s\t$f12,$f12,$f26\n 184:\tdiv.s\t$f28,$f28,$f0\n 188:\tmul.s\t$f28,$f28,$f20\n 18c:\tneg.s\t$f0,$f30\n 190:\tlui\tat,0x4320\n 194:\tmtc1\tat,$f2\n 198:\tnop\n 19c:\tdiv.s\t$f0,$f2,$f0\n 1a0:\tmul.s\t$f24,$f24,$f0\n 1a4:\tadd.s\t$f24,$f24,$f2\n 1a8:\tswc1\t$f24,0(s2)\n 1ac:\tlui\tat,0x42f0\n 1b0:\tmtc1\tat,$f2\n 1b4:\tnop\n 1b8:\tdiv.s\t$f0,$f2,$f28\n 1bc:\tmul.s\t$f22,$f22,$f0\n 1c0:\tadd.s\t$f22,$f22,$f2\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-f1f2d05701a38846/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 Hu3DCam3DToScreen\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n0000016c R_MIPS_26 HuMathSin\n0000017c R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 3c013faa 3421aaab 44810000 F...<.?.4!..D...\n 0160 00000000 4600f782 c60c0050 0c000000 ....F......P....\n 0170 461a6303 46000706 c60c0050 0c000000 F.c.F......P....\n 0180 461a6303 4600e703 4614e702 4600f007 F.c.F...F...F...\n 0190 3c014320 44811000 00000000 46001003 <.C D.......F...\n 01a0 4600c602 4602c600 e6580000 3c0142f0 F...F....X..<.B.\n 01b0 44811000 00000000 461c1003 4600b582 D.......F...F...\n 01c0 4602b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501005 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Hu3DCam3DToScreen\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 Hu3DCam3DToScreen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:HuMemAllocTag:gcc2.7.2","sym":"HuMemAllocTag","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","struct","fnptr","global","sizeof","bitwise","call"],"loc":24,"refSource":"void *HuMemAllocTag(s32 size, s16 tag) {\n s32 alignedSize;\n void *data;\n HuMallocHeader *firstBlk;\n HuMallocHeader *newBlk;\n\n alignedSize = (size + 7) & ~7;\n data = gMallocFunc(alignedSize + sizeof(HuMallocHeader));\n newBlk = (HuMallocHeader *)((s32)data + alignedSize);\n\n firstBlk = gFirstMallocBlock;\n\n newBlk->prev = firstBlk;\n newBlk->next = firstBlk->next;\n firstBlk->next->prev = newBlk;\n firstBlk->next = newBlk;\n\n newBlk->tag = tag;\n newBlk->size = alignedSize;\n newBlk->data = data;\n newBlk->creationFrame = D_800D20AC_D2CAC;\n\n return newBlk->data;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/mallocblock.c#L30-L53","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:\tsw\ts1,20(sp)\n c:\tsw\ts0,16(sp)\n 10:\tmove\ts1,a1\n 14:\taddiu\ts0,a0,7\n 18:\tli\tv0,-8\n 1c:\tand\ts0,s0,v0\n 20:\tlui\tv0,0x0\n 24:\tlw\tv0,0(v0)\n 28:\tjalr\tv0\n 2c:\taddiu\ta0,s0,24\n 30:\taddu\tv1,v0,s0\n 34:\tlui\ta1,0x0\n 38:\tlw\ta1,0(a1)\n 3c:\tsw\ta1,16(v1)\n 40:\tlw\ta0,20(a1)\n 44:\tsw\ta0,20(v1)\n 48:\tlw\ta0,20(a1)\n 4c:\tsw\tv1,16(a0)\n 50:\tsw\tv1,20(a1)\n 54:\tsh\ts1,6(v1)\n 58:\tsw\ts0,8(v1)\n 5c:\tsw\tv0,0(v1)\n 60:\tlui\tv0,0x0\n 64:\tlw\tv0,0(v0)\n 68:\tsw\tv0,12(v1)\n 6c:\tlw\tv0,0(v1)\n 70:\tlw\tra,24(sp)\n 74:\tlw\ts1,20(sp)\n 78:\tlw\ts0,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,32\n\t...\n","proto":{"HuMemAllocTag":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a7c11b4b92162de0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 HuMemAllocTag\n00000000 *UND*\t00000000 gMallocFunc\n00000000 *UND*\t00000000 gFirstMallocBlock\n00000000 *UND*\t00000000 D_800D20AC_D2CAC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 gMallocFunc\n00000024 R_MIPS_LO16 gMallocFunc\n00000034 R_MIPS_HI16 gFirstMallocBlock\n00000038 R_MIPS_LO16 gFirstMallocBlock\n00000060 R_MIPS_HI16 D_800D20AC_D2CAC\n00000064 R_MIPS_LO16 D_800D20AC_D2CAC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 afb10014 afb00010 '...............\n 0010 00a08821 24900007 2402fff8 02028024 ...!$...$......$\n 0020 3c020000 8c420000 0040f809 26040018 <....B...@..&...\n 0030 00501821 3c050000 8ca50000 ac650010 .P.!<........e..\n 0040 8ca40014 ac640014 8ca40014 ac830010 .....d..........\n 0050 aca30014 a4710006 ac700008 ac620000 .....q...p...b..\n 0060 3c020000 8c420000 ac62000c 8c620000 <....B...b...b..\n 0070 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 0080 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .reginfo:\n 0000 a003003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'HuMemAllocTag' — lift: cannot lift 'HuMemAllocTag': function call 'jalr' 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,-32 */\n/* 4:\tsw\tra,24(sp) */\n/* 8:\tsw\ts1,20(sp) */\n/* c:\tsw\ts0,16(sp) */\n/* 10:\tmove\ts1,a1 */\n/* 14:\taddiu\ts0,a0,7 */\n/* 18:\tli\tv0,-8 */\n/* 1c:\tand\ts0,s0,v0 */\n/* 20:\tlui\tv0,0x0 */\n/* 24:\tlw\tv0,0(v0) */\n/* 28:\tjalr\tv0 */\n/* 2c:\taddiu\ta0,s0,24 */\n/* 30:\taddu\tv1,v0,s0 */\n/* 34:\tlui\ta1,0x0 */\n/* 38:\tlw\ta1,0(a1) */\n/* 3c:\tsw\ta1,16(v1) */\n/* 40:\tlw\ta0,20(a1) */\n/* 44:\tsw\ta0,20(v1) */\n/* 48:\tlw\ta0,20(a1) */\n/* 4c:\tsw\tv1,16(a0) */\n/* 50:\tsw\tv1,20(a1) */\n/* 54:\tsh\ts1,6(v1) */\n/* 58:\tsw\ts0,8(v1) */\n/* 5c:\tsw\tv0,0(v1) */\n/* 60:\tlui\tv0,0x0 */\n/* 64:\tlw\tv0,0(v0) */\n/* 68:\tsw\tv0,12(v1) */\n/* 6c:\tlw\tv0,0(v1) */\n/* 70:\tlw\tra,24(sp) */\n/* 74:\tlw\ts1,20(sp) */\n/* 78:\tlw\ts0,16(sp) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid HuMemAllocTag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'HuMemAllocTag': function call 'jalr' at 0x28 — 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 'HuMemAllocTag': function call 'jalr' at 0x28 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 D_800D20AC_D2CAC;\nextern void *gFirstMallocBlock;\nextern s32 (*gMallocFunc)(s32);\n\ns32 HuMemAllocTag(s32 arg0, s16 arg1) {\n s32 temp_s0;\n s32 temp_v0;\n void *temp_v1;\n\n temp_s0 = (arg0 + 7) & ~7;\n temp_v0 = gMallocFunc(temp_s0 + 0x18);\n temp_v1 = temp_v0 + temp_s0;\n temp_v1->unk10 = (void *) gFirstMallocBlock;\n temp_v1->unk14 = (void *) gFirstMallocBlock->unk14;\n gFirstMallocBlock->unk14->unk10 = temp_v1;\n gFirstMallocBlock->unk14 = temp_v1;\n temp_v1->unk6 = arg1;\n temp_v1->unk8 = temp_s0;\n temp_v1->unk0 = temp_v0;\n temp_v1->unkC = (s32) D_800D20AC_D2CAC;\n return temp_v1->unk0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: gcc 2.7.2 (docker) failed: /c.i:5551: conflicting types for `gFirstMallocBlock'","/c.i:5538: previous declaration of `gFirstMallocBlock'","/c.i:5552: conflicting types for `gMallocFunc'","/c.i:5537: previous declaration of `gMallocFunc'","/c.i:5559: warning: assignment makes pointer from integer without a cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemAllocTag` — benchmark function marioparty3:HuMemAllocTag:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemAllocTag\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n sw\t$s1, 20($sp)\n sw\t$s0, 16($sp)\n move\t$s1, $a1\n addiu\t$s0, $a0, 7\n li\t$v0, -8\n and\t$s0, $s0, $v0\n lui\t$v0, %hi(gMallocFunc)\n lw\t$v0, %lo(gMallocFunc)($v0)\n jalr\t$v0\n addiu\t$a0, $s0, 24\n addu\t$v1, $v0, $s0\n lui\t$a1, %hi(gFirstMallocBlock)\n lw\t$a1, %lo(gFirstMallocBlock)($a1)\n sw\t$a1, 16($v1)\n lw\t$a0, 20($a1)\n sw\t$a0, 20($v1)\n lw\t$a0, 20($a1)\n sw\t$v1, 16($a0)\n sw\t$v1, 20($a1)\n sh\t$s1, 6($v1)\n sw\t$s0, 8($v1)\n sw\t$v0, 0($v1)\n lui\t$v0, %hi(D_800D20AC_D2CAC)\n lw\t$v0, %lo(D_800D20AC_D2CAC)($v0)\n sw\t$v0, 12($v1)\n lw\t$v0, 0($v1)\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\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemAllocTag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemAllocTag` — benchmark function marioparty3:HuMemAllocTag:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemAllocTag: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:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tsw\ts1,20(sp)\n c:\tsw\ts0,16(sp)\n 10:\tmove\ts1,a1\n 14:\taddiu\ts0,a0,7\n 18:\tli\tv0,-8\n 1c:\tand\ts0,s0,v0\n 20:\tlui\tv0,0x0\n 24:\tlw\tv0,0(v0)\n 28:\tjalr\tv0\n 2c:\taddiu\ta0,s0,24\n 30:\taddu\tv1,v0,s0\n 34:\tlui\ta1,0x0\n 38:\tlw\ta1,0(a1)\n 3c:\tsw\ta1,16(v1)\n 40:\tlw\ta0,20(a1)\n 44:\tsw\ta0,20(v1)\n 48:\tlw\ta0,20(a1)\n 4c:\tsw\tv1,16(a0)\n 50:\tsw\tv1,20(a1)\n 54:\tsh\ts1,6(v1)\n 58:\tsw\ts0,8(v1)\n 5c:\tsw\tv0,0(v1)\n 60:\tlui\tv0,0x0\n 64:\tlw\tv0,0(v0)\n 68:\tsw\tv0,12(v1)\n 6c:\tlw\tv0,0(v1)\n 70:\tlw\tra,24(sp)\n 74:\tlw\ts1,20(sp)\n 78:\tlw\ts0,16(sp)\n 7c:\tjr\tra\n 80:\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-gcc272-a7c11b4b92162de0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 HuMemAllocTag\n00000000 *UND*\t00000000 gMallocFunc\n00000000 *UND*\t00000000 gFirstMallocBlock\n00000000 *UND*\t00000000 D_800D20AC_D2CAC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 gMallocFunc\n00000024 R_MIPS_LO16 gMallocFunc\n00000034 R_MIPS_HI16 gFirstMallocBlock\n00000038 R_MIPS_LO16 gFirstMallocBlock\n00000060 R_MIPS_HI16 D_800D20AC_D2CAC\n00000064 R_MIPS_LO16 D_800D20AC_D2CAC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 afb10014 afb00010 '...............\n 0010 00a08821 24900007 2402fff8 02028024 ...!$...$......$\n 0020 3c020000 8c420000 0040f809 26040018 <....B...@..&...\n 0030 00501821 3c050000 8ca50000 ac650010 .P.!<........e..\n 0040 8ca40014 ac640014 8ca40014 ac830010 .....d..........\n 0050 aca30014 a4710006 ac700008 ac620000 .....q...p...b..\n 0060 3c020000 8c420000 ac62000c 8c620000 <....B...b...b..\n 0070 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 0080 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .reginfo:\n 0000 a003003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"HuMemAllocTag\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 HuMemAllocTag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","arithmetic","do-while","loop","ternary","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemoryBlockGet\n move\t$v1, $a0\n move\t$a1, $zero\n.L8:\n lbu\t$v0, 5($v1)\n xori\t$v0, $v0, 0x1\n sltiu\t$v0, $v0, 1\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .L8\n addu\t$a1, $a1, $v0\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemoryBlockGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemoryBlockGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2","sym":"HuMemUsedMemorySizeGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemorySizeGet\n move\t$v1, $a0\n move\t$a1, $zero\n li\t$a2, 1\n.Lc:\n lbu\t$v0, 5($v1)\n bne\t$v0, $a2, .L20\n nop\n lw\t$v0, 0($v1)\n addu\t$a1, $a1, $v0\n.L20:\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .Lc\n nop\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemorySizeGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemorySizeGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuSprGrpCreate:gcc2.7.2","sym":"HuSprGrpCreate","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","loop","call"],"loc":35,"refSource":"s16 HuSprGrpCreate(u16 arg0, u16 arg1) {\n HuSprGrp *temp_v0_2;\n HuSprite **var_s2;\n HuSprite *temp_v0_3;\n s16 var_s4;\n s16 i;\n\n for (i = 0; i < HUSPR_GRP_MAX; i++) {\n if (HuSprGrpData[i] == NULL) {\n break;\n }\n }\n if (i == HUSPR_GRP_MAX) {\n return -1;\n }\n var_s4 = i;\n temp_v0_2 = func_80052468_53068(arg0, arg1);\n if (temp_v0_2 == NULL) {\n return -1;\n }\n HuSprGrpData[var_s4] = temp_v0_2;\n temp_v0_2->unk_0A = 0;\n temp_v0_2->unk_0C = 1;\n var_s2 = temp_v0_2->members;\n for (i = 0; i < arg0; i++) {\n *(var_s2++) = temp_v0_3 = HuMemAlloc(0x210);\n if (temp_v0_3 == NULL) {\n HuSprGrpKill(var_s4);\n return -1;\n }\n temp_v0_2->unk_0A++;\n }\n func_80052E68_53A68(temp_v0_2, arg0);\n return var_s4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L156-L190","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\tra,40(sp)\n 8:\tsw\ts5,36(sp)\n c:\tsw\ts4,32(sp)\n 10:\tsw\ts3,28(sp)\n 14:\tsw\ts2,24(sp)\n 18:\tsw\ts1,20(sp)\n 1c:\tsw\ts0,16(sp)\n 20:\tmove\ts5,a0\n 24:\tmove\ts0,zero\n 28:\tlui\tv1,0x0\n 2c:\taddiu\tv1,v1,0\n 30:\tsll\tv0,s0,0x10\n 34:\tsra\tv0,v0,0xe\n 38:\taddu\tv0,v0,v1\n 3c:\tlw\tv0,0(v0)\n 40:\tbeqz\tv0,60 \n 44:\taddiu\tv0,s0,1\n 48:\tmove\ts0,v0\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\tv0,v0,0x10\n 54:\tslti\tv0,v0,256\n 58:\tbnez\tv0,34 \n 5c:\tsll\tv0,s0,0x10\n 60:\tsll\tv0,s0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tli\tv1,256\n 6c:\tbeq\tv0,v1,a0 \n 70:\tmove\ts4,s0\n 74:\tandi\ta0,s5,0xffff\n 78:\tjal\t0 \n 7c:\tandi\ta1,a1,0xffff\n 80:\tmove\ts1,v0\n 84:\tbnez\ts1,a8 \n 88:\tsll\tv0,s4,0x10\n 8c:\tj\t128 \n 90:\tli\tv0,-1\n 94:\tsll\ta0,s4,0x10\n 98:\tjal\t0 \n 9c:\tsra\ta0,a0,0x10\n a0:\tj\t128 \n a4:\tli\tv0,-1\n a8:\tsra\tv0,v0,0xe\n ac:\tlui\tat,0x0\n b0:\taddu\tat,at,v0\n b4:\tsw\ts1,0(at)\n b8:\tsh\tzero,10(s1)\n bc:\tli\tv0,1\n c0:\tsw\tv0,12(s1)\n c4:\taddiu\ts2,s1,16\n c8:\tandi\tv0,s5,0xffff\n cc:\tbeqz\tv0,114 \n d0:\tmove\ts0,zero\n d4:\tandi\ts3,s5,0xffff\n d8:\tjal\t0 \n dc:\tli\ta0,528\n e0:\tsw\tv0,0(s2)\n e4:\tbeqz\tv0,94 \n e8:\taddiu\ts2,s2,4\n ec:\tlhu\tv0,10(s1)\n f0:\taddiu\tv0,v0,1\n f4:\tsh\tv0,10(s1)\n f8:\taddiu\tv0,s0,1\n fc:\tmove\ts0,v0\n 100:\tsll\tv0,v0,0x10\n 104:\tsra\tv0,v0,0x10\n 108:\tslt\tv0,v0,s3\n 10c:\tbnez\tv0,d8 \n 110:\tnop\n 114:\tmove\ta0,s1\n 118:\tjal\t0 \n 11c:\tandi\ta1,s5,0xffff\n 120:\tsll\tv0,s4,0x10\n 124:\tsra\tv0,v0,0x10\n 128:\tlw\tra,40(sp)\n 12c:\tlw\ts5,36(sp)\n 130:\tlw\ts4,32(sp)\n 134:\tlw\ts3,28(sp)\n 138:\tlw\ts2,24(sp)\n 13c:\tlw\ts1,20(sp)\n 140:\tlw\ts0,16(sp)\n 144:\tjr\tra\n 148:\taddiu\tsp,sp,48\n 14c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-89022a5870e5f80b/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000014c HuSprGrpCreate\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 func_80052468_53068\n00000000 *UND*\t00000000 HuSprGrpKill\n00000000 *UND*\t00000000 HuMemAlloc\n00000000 *UND*\t00000000 func_80052E68_53A68\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_HI16 HuSprGrpData\n0000002c R_MIPS_LO16 HuSprGrpData\n00000078 R_MIPS_26 func_80052468_53068\n0000008c R_MIPS_26 .text\n00000098 R_MIPS_26 HuSprGrpKill\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_HI16 HuSprGrpData\n000000b4 R_MIPS_LO16 HuSprGrpData\n000000d8 R_MIPS_26 HuMemAlloc\n00000118 R_MIPS_26 func_80052E68_53A68\n\n\nContents of section .text:\n 0000 27bdffd0 afbf0028 afb50024 afb40020 '......(...$... \n 0010 afb3001c afb20018 afb10014 afb00010 ................\n 0020 0080a821 00008021 3c030000 24630000 ...!...!<...$c..\n 0030 00101400 00021383 00431021 8c420000 .........C.!.B..\n 0040 10400007 26020001 00408021 00021400 .@..&....@.!....\n 0050 00021403 28420100 1440fff6 00101400 ....(B...@......\n 0060 00101400 00021403 24030100 1043000c ........$....C..\n 0070 0200a021 32a4ffff 0c000000 30a5ffff ...!2.......0...\n 0080 00408821 16200008 00141400 0800004a .@.!. .........J\n 0090 2402ffff 00142400 0c000000 00042403 $.....$.......$.\n 00a0 0800004a 2402ffff 00021383 3c010000 ...J$.......<...\n 00b0 00220821 ac310000 a620000a 24020001 .\".!.1... ..$...\n 00c0 ae22000c 26320010 32a2ffff 10400011 .\"..&2..2....@..\n 00d0 00008021 32b3ffff 0c000000 24040210 ...!2.......$...\n 00e0 ae420000 1040ffeb 26520004 9622000a .B...@..&R...\"..\n 00f0 24420001 a622000a 26020001 00408021 $B...\"..&....@.!\n 0100 00021400 00021403 0053102a 1440fff2 .........S.*.@..\n 0110 00000000 02202021 0c000000 32a5ffff ..... !....2...\n 0120 00141400 00021403 8fbf0028 8fb50024 ...........(...$\n 0130 8fb40020 8fb3001c 8fb20018 8fb10014 ... ............\n 0140 8fb00010 03e00008 27bd0030 00000000 ........'..0....\nContents of section .reginfo:\n 0000 a03f003e 00000000 00000000 00000000 .?.>............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'HuSprGrpCreate' — lift: cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — 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\tra,40(sp) */\n/* 8:\tsw\ts5,36(sp) */\n/* c:\tsw\ts4,32(sp) */\n/* 10:\tsw\ts3,28(sp) */\n/* 14:\tsw\ts2,24(sp) */\n/* 18:\tsw\ts1,20(sp) */\n/* 1c:\tsw\ts0,16(sp) */\n/* 20:\tmove\ts5,a0 */\n/* 24:\tmove\ts0,zero */\n/* 28:\tlui\tv1,0x0 */\n/* 2c:\taddiu\tv1,v1,0 */\n/* 30:\tsll\tv0,s0,0x10 */\n/* 34:\tsra\tv0,v0,0xe */\n/* 38:\taddu\tv0,v0,v1 */\n/* 3c:\tlw\tv0,0(v0) */\n/* 40:\tbeqz\tv0,60 */\n/* 44:\taddiu\tv0,s0,1 */\n/* 48:\tmove\ts0,v0 */\n/* 4c:\tsll\tv0,v0,0x10 */\n/* 50:\tsra\tv0,v0,0x10 */\n/* 54:\tslti\tv0,v0,256 */\n/* 58:\tbnez\tv0,34 */\n/* 5c:\tsll\tv0,s0,0x10 */\n/* 60:\tsll\tv0,s0,0x10 */\n/* 64:\tsra\tv0,v0,0x10 */\n/* 68:\tli\tv1,256 */\n/* 6c:\tbeq\tv0,v1,a0 */\n/* 70:\tmove\ts4,s0 */\n/* 74:\tandi\ta0,s5,0xffff */\n/* 78:\tjal\t0 */\n/* 7c:\tandi\ta1,a1,0xffff */\n/* 80:\tmove\ts1,v0 */\n/* 84:\tbnez\ts1,a8 */\n/* 88:\tsll\tv0,s4,0x10 */\n/* 8c:\tj\t128 */\n/* 90:\tli\tv0,-1 */\n/* 94:\tsll\ta0,s4,0x10 */\n/* 98:\tjal\t0 */\n/* 9c:\tsra\ta0,a0,0x10 */\n/* a0:\tj\t128 */\n/* a4:\tli\tv0,-1 */\n/* a8:\tsra\tv0,v0,0xe */\n/* ac:\tlui\tat,0x0 */\n/* b0:\taddu\tat,at,v0 */\n/* b4:\tsw\ts1,0(at) */\n/* b8:\tsh\tzero,10(s1) */\n/* bc:\tli\tv0,1 */\n/* c0:\tsw\tv0,12(s1) */\n/* c4:\taddiu\ts2,s1,16 */\n/* c8:\tandi\tv0,s5,0xffff */\n/* cc:\tbeqz\tv0,114 */\n/* d0:\tmove\ts0,zero */\n/* d4:\tandi\ts3,s5,0xffff */\n/* d8:\tjal\t0 */\n/* dc:\tli\ta0,528 */\n/* e0:\tsw\tv0,0(s2) */\n/* e4:\tbeqz\tv0,94 */\n/* e8:\taddiu\ts2,s2,4 */\n/* ec:\tlhu\tv0,10(s1) */\n/* f0:\taddiu\tv0,v0,1 */\n/* f4:\tsh\tv0,10(s1) */\n/* f8:\taddiu\tv0,s0,1 */\n/* fc:\tmove\ts0,v0 */\n/* 100:\tsll\tv0,v0,0x10 */\n/* 104:\tsra\tv0,v0,0x10 */\n/* 108:\tslt\tv0,v0,s3 */\n/* 10c:\tbnez\tv0,d8 */\n/* 110:\tnop */\n/* 114:\tmove\ta0,s1 */\n/* 118:\tjal\t0 */\n/* 11c:\tandi\ta1,s5,0xffff */\n/* 120:\tsll\tv0,s4,0x10 */\n/* 124:\tsra\tv0,v0,0x10 */\n/* 128:\tlw\tra,40(sp) */\n/* 12c:\tlw\ts5,36(sp) */\n/* 130:\tlw\ts4,32(sp) */\n/* 134:\tlw\ts3,28(sp) */\n/* 138:\tlw\ts2,24(sp) */\n/* 13c:\tlw\ts1,20(sp) */\n/* 140:\tlw\ts0,16(sp) */\n/* 144:\tjr\tra */\n/* 148:\taddiu\tsp,sp,48 */\n/* 14c:\tnop */\nvoid HuSprGrpCreate(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":92,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"void *func_80052468_53068(s32, s32); /* extern */\n? func_80052E68_53A68(void *, s32); /* extern */\n\ns16 HuSprGrpCreate(u16 arg0, u16 arg1) {\n s16 temp_v0;\n s16 temp_v0_4;\n s16 var_s0;\n s16 var_s0_2;\n s32 var_v0;\n void **var_s2;\n void *temp_v0_2;\n void *temp_v0_3;\n\n var_s0 = 0;\n var_v0 = 0 << 0x10;\nloop_1:\n temp_v0 = var_s0 + 1;\n if (*((var_v0 >> 0xE) + HuSprGrpData) != 0) {\n var_s0 = temp_v0;\n var_v0 = var_s0 << 0x10;\n if (temp_v0 < 0x100) {\n goto loop_1;\n }\n }\n if (var_s0 != 0x100) {\n temp_v0_2 = func_80052468_53068(arg0 & 0xFFFF, arg1 & 0xFFFF);\n if (temp_v0_2 == NULL) {\n return -1;\n }\n *(HuSprGrpData + ((s32) (var_s0 << 0x10) >> 0xE)) = temp_v0_2;\n temp_v0_2->unkA = 0U;\n temp_v0_2->unkC = 1;\n var_s2 = temp_v0_2 + 0x10;\n var_s0_2 = 0;\n if (arg0 & 0xFFFF) {\nloop_10:\n temp_v0_3 = HuMemAlloc(0x210);\n *var_s2 = temp_v0_3;\n var_s2 += 4;\n if (temp_v0_3 != NULL) {\n temp_v0_2->unkA = (u16) (temp_v0_2->unkA + 1);\n temp_v0_4 = var_s0_2 + 1;\n var_s0_2 = temp_v0_4;\n if (temp_v0_4 >= (arg0 & 0xFFFF)) {\n goto block_12;\n }\n goto loop_10;\n }\n HuSprGrpKill(var_s0);\n goto block_7;\n }\nblock_12:\n func_80052E68_53A68(temp_v0_2, arg0 & 0xFFFF);\n return var_s0;\n }\nblock_7:\n return -1;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":56,"gotos":4,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuSprGrpCreate` — benchmark function marioparty3:HuSprGrpCreate:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 HuSprGrpCreate\n addiu\t$sp, $sp, -48\n sw\t$ra, 40($sp)\n sw\t$s5, 36($sp)\n sw\t$s4, 32($sp)\n sw\t$s3, 28($sp)\n sw\t$s2, 24($sp)\n sw\t$s1, 20($sp)\n sw\t$s0, 16($sp)\n move\t$s5, $a0\n move\t$s0, $zero\n lui\t$v1, %hi(HuSprGrpData)\n addiu\t$v1, $v1, %lo(HuSprGrpData)\n sll\t$v0, $s0, 0x10\n.L34:\n sra\t$v0, $v0, 0xe\n addu\t$v0, $v0, $v1\n lw\t$v0, 0($v0)\n beqz\t$v0, .L60\n addiu\t$v0, $s0, 1\n move\t$s0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 256\n bnez\t$v0, .L34\n sll\t$v0, $s0, 0x10\n.L60:\n sll\t$v0, $s0, 0x10\n sra\t$v0, $v0, 0x10\n li\t$v1, 256\n beq\t$v0, $v1, .La0\n move\t$s4, $s0\n andi\t$a0, $s5, 0xffff\n jal\tfunc_80052468_53068\n andi\t$a1, $a1, 0xffff\n move\t$s1, $v0\n bnez\t$s1, .La8\n sll\t$v0, $s4, 0x10\n j\t.L128\n li\t$v0, -1\n.L94:\n sll\t$a0, $s4, 0x10\n jal\tHuSprGrpKill\n sra\t$a0, $a0, 0x10\n.La0:\n j\t.L128\n li\t$v0, -1\n.La8:\n sra\t$v0, $v0, 0xe\n lui\t$at, %hi(HuSprGrpData)\n addu\t$at, $at, $v0\n sw\t$s1, %lo(HuSprGrpData)($at)\n sh\t$zero, 10($s1)\n li\t$v0, 1\n sw\t$v0, 12($s1)\n addiu\t$s2, $s1, 16\n andi\t$v0, $s5, 0xffff\n beqz\t$v0, .L114\n move\t$s0, $zero\n andi\t$s3, $s5, 0xffff\n.Ld8:\n jal\tHuMemAlloc\n li\t$a0, 528\n sw\t$v0, 0($s2)\n beqz\t$v0, .L94\n addiu\t$s2, $s2, 4\n lhu\t$v0, 10($s1)\n addiu\t$v0, $v0, 1\n sh\t$v0, 10($s1)\n addiu\t$v0, $s0, 1\n move\t$s0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$v0, $v0, $s3\n bnez\t$v0, .Ld8\n nop\n.L114:\n move\t$a0, $s1\n jal\tfunc_80052E68_53A68\n andi\t$a1, $s5, 0xffff\n sll\t$v0, $s4, 0x10\n sra\t$v0, $v0, 0x10\n.L128:\n lw\t$ra, 40($sp)\n lw\t$s5, 36($sp)\n lw\t$s4, 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, 48\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 HuSprGrpCreate(u16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuSprGrpCreate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuSprGrpCreate` — benchmark function marioparty3:HuSprGrpCreate:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuSprGrpCreate: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:\taddiu\tsp,sp,-48\n 4:\tsw\tra,40(sp)\n 8:\tsw\ts5,36(sp)\n c:\tsw\ts4,32(sp)\n 10:\tsw\ts3,28(sp)\n 14:\tsw\ts2,24(sp)\n 18:\tsw\ts1,20(sp)\n 1c:\tsw\ts0,16(sp)\n 20:\tmove\ts5,a0\n 24:\tmove\ts0,zero\n 28:\tlui\tv1,0x0\n 2c:\taddiu\tv1,v1,0\n 30:\tsll\tv0,s0,0x10\n 34:\tsra\tv0,v0,0xe\n 38:\taddu\tv0,v0,v1\n 3c:\tlw\tv0,0(v0)\n 40:\tbeqz\tv0,60 \n 44:\taddiu\tv0,s0,1\n 48:\tmove\ts0,v0\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\tv0,v0,0x10\n 54:\tslti\tv0,v0,256\n 58:\tbnez\tv0,34 \n 5c:\tsll\tv0,s0,0x10\n 60:\tsll\tv0,s0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tli\tv1,256\n 6c:\tbeq\tv0,v1,a0 \n 70:\tmove\ts4,s0\n 74:\tandi\ta0,s5,0xffff\n 78:\tjal\t0 \n 7c:\tandi\ta1,a1,0xffff\n 80:\tmove\ts1,v0\n 84:\tbnez\ts1,a8 \n 88:\tsll\tv0,s4,0x10\n 8c:\tj\t128 \n 90:\tli\tv0,-1\n 94:\tsll\ta0,s4,0x10\n 98:\tjal\t0 \n 9c:\tsra\ta0,a0,0x10\n a0:\tj\t128 \n a4:\tli\tv0,-1\n a8:\tsra\tv0,v0,0xe\n ac:\tlui\tat,0x0\n b0:\taddu\tat,at,v0\n b4:\tsw\ts1,0(at)\n b8:\tsh\tzero,10(s1)\n bc:\tli\tv0,1\n c0:\tsw\tv0,12(s1)\n c4:\taddiu\ts2,s1,16\n c8:\tandi\tv0,s5,0xffff\n cc:\tbeqz\tv0,114 \n d0:\tmove\ts0,zero\n d4:\tandi\ts3,s5,0xffff\n d8:\tjal\t0 \n dc:\tli\ta0,528\n e0:\tsw\tv0,0(s2)\n e4:\tbeqz\tv0,94 \n e8:\taddiu\ts2,s2,4\n ec:\tlhu\tv0,10(s1)\n f0:\taddiu\tv0,v0,1\n f4:\tsh\tv0,10(s1)\n f8:\taddiu\tv0,s0,1\n fc:\tmove\ts0,v0\n 100:\tsll\tv0,v0,0x10\n 104:\tsra\tv0,v0,0x10\n 108:\tslt\tv0,v0,s3\n 10c:\tbnez\tv0,d8 \n 110:\tnop\n 114:\tmove\ta0,s1\n 118:\tjal\t0 \n 11c:\tandi\ta1,s5,0xffff\n 120:\tsll\tv0,s4,0x10\n 124:\tsra\tv0,v0,0x10\n 128:\tlw\tra,40(sp)\n 12c:\tlw\ts5,36(sp)\n 130:\tlw\ts4,32(sp)\n 134:\tlw\ts3,28(sp)\n 138:\tlw\ts2,24(sp)\n 13c:\tlw\ts1,20(sp)\n 140:\tlw\ts0,16(sp)\n 144:\tjr\tra\n 148:\taddiu\tsp,sp,48\n 14c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-89022a5870e5f80b/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000014c HuSprGrpCreate\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 func_80052468_53068\n00000000 *UND*\t00000000 HuSprGrpKill\n00000000 *UND*\t00000000 HuMemAlloc\n00000000 *UND*\t00000000 func_80052E68_53A68\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_HI16 HuSprGrpData\n0000002c R_MIPS_LO16 HuSprGrpData\n00000078 R_MIPS_26 func_80052468_53068\n0000008c R_MIPS_26 .text\n00000098 R_MIPS_26 HuSprGrpKill\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_HI16 HuSprGrpData\n000000b4 R_MIPS_LO16 HuSprGrpData\n000000d8 R_MIPS_26 HuMemAlloc\n00000118 R_MIPS_26 func_80052E68_53A68\n\n\nContents of section .text:\n 0000 27bdffd0 afbf0028 afb50024 afb40020 '......(...$... \n 0010 afb3001c afb20018 afb10014 afb00010 ................\n 0020 0080a821 00008021 3c030000 24630000 ...!...!<...$c..\n 0030 00101400 00021383 00431021 8c420000 .........C.!.B..\n 0040 10400007 26020001 00408021 00021400 .@..&....@.!....\n 0050 00021403 28420100 1440fff6 00101400 ....(B...@......\n 0060 00101400 00021403 24030100 1043000c ........$....C..\n 0070 0200a021 32a4ffff 0c000000 30a5ffff ...!2.......0...\n 0080 00408821 16200008 00141400 0800004a .@.!. .........J\n 0090 2402ffff 00142400 0c000000 00042403 $.....$.......$.\n 00a0 0800004a 2402ffff 00021383 3c010000 ...J$.......<...\n 00b0 00220821 ac310000 a620000a 24020001 .\".!.1... ..$...\n 00c0 ae22000c 26320010 32a2ffff 10400011 .\"..&2..2....@..\n 00d0 00008021 32b3ffff 0c000000 24040210 ...!2.......$...\n 00e0 ae420000 1040ffeb 26520004 9622000a .B...@..&R...\"..\n 00f0 24420001 a622000a 26020001 00408021 $B...\"..&....@.!\n 0100 00021400 00021403 0053102a 1440fff2 .........S.*.@..\n 0110 00000000 02202021 0c000000 32a5ffff ..... !....2...\n 0120 00141400 00021403 8fbf0028 8fb50024 ...........(...$\n 0130 8fb40020 8fb3001c 8fb20018 8fb10014 ... ............\n 0140 8fb00010 03e00008 27bd0030 00000000 ........'..0....\nContents of section .reginfo:\n 0000 a03f003e 00000000 00000000 00000000 .?.>............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\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 HuSprGrpCreate # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel UnlinkProcess\n lw\t$v1, 0($a1)\n beqz\t$v1, .L14\n nop\n lw\t$v0, 4($a1)\n sw\t$v0, 4($v1)\n.L14:\n lw\t$v1, 4($a1)\n beqz\t$v1, .L2c\n nop\n lw\t$v0, 0($a1)\n j\t.L34\n sw\t$v0, 0($v1)\n.L2c:\n lw\t$v0, 0($a1)\n sw\t$v0, 0($a0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void UnlinkProcess(Process **root, Process *process);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UnlinkProcess # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:AcroBikeHandleInputTurning:agbcc","sym":"AcroBikeHandleInputTurning","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","struct","field","pointer","call"],"loc":38,"refSource":"static u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys)\n{\n u8 direction;\n\n *newDirection = gPlayerAvatar.newDirBackup;\n gPlayerAvatar.bikeFrameCounter++;\n\n // Wait 6 frames before actually changing direction\n if (gPlayerAvatar.bikeFrameCounter > 6) // ... because it takes 6 frames to advance 1 tile.\n {\n gPlayerAvatar.runningState = TURN_DIRECTION;\n gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;\n Bike_SetBikeStill();\n return ACRO_TRANS_TURN_DIRECTION;\n }\n direction = GetPlayerMovementDirection();\n if (*newDirection == AcroBike_GetJumpDirection())\n {\n Bike_SetBikeStill(); // Bike_SetBikeStill sets speed to standing, but the next line immediately overrides it. could have just reset acroBikeState to 0 here instead of wasting a jump.\n gPlayerAvatar.bikeSpeed = PLAYER_SPEED_NORMAL;\n if (*newDirection == GetOppositeDirection(direction))\n {\n // do a turn jump.\n // no need to update runningState, didnt move.\n gPlayerAvatar.acroBikeState = ACRO_STATE_TURN_JUMP;\n return ACRO_TRANS_TURN_JUMP;\n }\n else\n {\n // do a sideways jump.\n gPlayerAvatar.runningState = MOVING; // we need to move, set state to moving.\n gPlayerAvatar.acroBikeState = ACRO_STATE_SIDE_JUMP;\n return ACRO_TRANS_SIDE_JUMP;\n }\n }\n *newDirection = direction;\n return ACRO_TRANS_FACE_DIRECTION;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/bike.c#L326-L363","targetAsm":"@ Generated by 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 AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-4bcee929a307.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gPlayerAvatar","shape":"struct PlayerAvatar (36 B)"}],"outcome":"nonmatch","source":"s32 AcroBikeHandleInputTurning(u8 * a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n *a0 = gPlayerAvatar.newDirBackup;\n v0 = gPlayerAvatar.bikeFrameCounter;\n gPlayerAvatar.bikeFrameCounter = v0 + 1;\n if ((u8)(v0 + 1) <= 6) {\n v1 = GetPlayerMovementDirection();\n if (*a0 != (u8)AcroBike_GetJumpDirection()) {\n *a0 = (u8)v1;\n v2 = 0;\n } else {\n Bike_SetBikeStill();\n gPlayerAvatar.bikeSpeed = 1;\n if (*a0 != (u8)GetOppositeDirection((u8)v1)) {\n gPlayerAvatar.runningState = 2;\n gPlayerAvatar.acroBikeState = 5;\n v2 = 8;\n } else {\n gPlayerAvatar.acroBikeState = 6;\n v2 = 9;\n }\n }\n } else {\n gPlayerAvatar.runningState = 1;\n gPlayerAvatar.acroBikeState = 0;\n Bike_SetBikeStill();\n v2 = 1;\n }\n return v2;\n}\n","score":44,"maxScore":68,"compileErrors":null,"breakdown":{"insert":14,"delete":14,"replace":0,"opMismatch":2,"argMismatch":14},"quality":{"score":94,"lines":32,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys) {\n u8 temp_r0;\n u8 temp_r6;\n\n *newDirection = gPlayerAvatar.newDirBackup;\n temp_r0 = gPlayerAvatar.bikeFrameCounter + 1;\n gPlayerAvatar.bikeFrameCounter = temp_r0;\n if ((u32) temp_r0 > 6U) {\n gPlayerAvatar.runningState = 1;\n gPlayerAvatar.acroBikeState = 0;\n Bike_SetBikeStill();\n return 1U;\n }\n temp_r6 = GetPlayerMovementDirection();\n if (*newDirection == AcroBike_GetJumpDirection()) {\n Bike_SetBikeStill();\n gPlayerAvatar.bikeSpeed = 1;\n if (*newDirection == GetOppositeDirection(temp_r6)) {\n gPlayerAvatar.acroBikeState = 6;\n return 9U;\n }\n gPlayerAvatar.runningState = 2;\n gPlayerAvatar.acroBikeState = 5;\n return 8U;\n }\n *newDirection = temp_r6;\n return 0U;\n}\n","score":2,"maxScore":55,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":27,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":55,"ratio":0.03636363636363636,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AcroBikeHandleInputTurning` — benchmark function pokeemerald:AcroBikeHandleInputTurning:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\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-4bcee929a307.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AcroBikeHandleInputTurning # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AcroBikeHandleInputTurning` — benchmark function pokeemerald:AcroBikeHandleInputTurning:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:AcroBikeHandleInputTurning:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AcroBikeHandleInputTurning # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc","sym":"AnimTask_FlashHealthboxOnLevelUp_Step","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","array","switch","ternary","call","comparison-tree"],"loc":36,"refSource":"static void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId)\n{\n u8 paletteNum;\n u32 paletteOffset, colorOffset;\n\n gTasks[taskId].data[0]++;\n if (gTasks[taskId].data[0]++ >= gTasks[taskId].data[11])\n {\n gTasks[taskId].data[0] = 0;\n paletteNum = IndexOfSpritePaletteTag(TAG_HEALTHBOX_PALS_1);\n colorOffset = gTasks[taskId].data[10] == 0 ? 6 : 2;\n switch (gTasks[taskId].data[1])\n {\n case 0:\n gTasks[taskId].data[2] += 2;\n if (gTasks[taskId].data[2] > 16)\n gTasks[taskId].data[2] = 16;\n\n paletteOffset = OBJ_PLTT_ID(paletteNum);\n BlendPalette(paletteOffset + colorOffset, 1, gTasks[taskId].data[2], RGB(20, 27, 31));\n if (gTasks[taskId].data[2] == 16)\n gTasks[taskId].data[1]++;\n break;\n case 1:\n gTasks[taskId].data[2] -= 2;\n if (gTasks[taskId].data[2] < 0)\n gTasks[taskId].data[2] = 0;\n\n paletteOffset = OBJ_PLTT_ID(paletteNum);\n BlendPalette(paletteOffset + colorOffset, 1, gTasks[taskId].data[2], RGB(20, 27, 31));\n if (gTasks[taskId].data[2] == 0)\n DestroyAnimVisualTask(taskId);\n break;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_anim_throw.c#L605-L640","targetAsm":"@ Generated by 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 AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-f77ea1056385.i.gz","proto":{"AnimTask_FlashHealthboxOnLevelUp_Step":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'AnimTask_FlashHealthboxOnLevelUp_Step' — raise: cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — 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.type\t AnimTask_FlashHealthboxOnLevelUp_Step,function */\n/* \t.thumb_func */\n/* AnimTask_FlashHealthboxOnLevelUp_Step: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr1, .L17 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr4, r0, r1 */\n/* \tldrh\tr0, [r4, #0x8] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tmov\tr6, #0x0 */\n/* \tadd\tr1, r0, #0x1 */\n/* \tstrh\tr1, [r4, #0x8] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tmov\tr2, #0x1e */\n/* \tldrsh\tr1, [r4, r2] */\n/* \tcmp\tr0, r1 */\n/* \tblt\t.L5\t@cond_branch */\n/* \tstrh\tr6, [r4, #0x8] */\n/* \tldr\tr0, .L17+0x4 */\n/* \tbl\tIndexOfSpritePaletteTag */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr2, r0, #0x18 */\n/* \tmov\tr3, #0x1c */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tmov\tr1, #0x2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x6 */\n/* .L6: */\n/* \tmov\tr3, #0xa */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tcmp\tr0, #0x1 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tb\t.L5 */\n/* .L18: */\n/* \t.align\t2, 0 */\n/* .L17: */\n/* \t.word\tgTasks */\n/* \t.word\t0xd709 */\n/* .L9: */\n/* \tldrh\tr0, [r4, #0xc] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x10 */\n/* \tble\t.L10\t@cond_branch */\n/* \tmov\tr0, #0x10 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* .L10: */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tldrb\tr2, [r4, #0xc] */\n/* \tldr\tr3, .L19 */\n/* \tmov\tr1, #0x1 */\n/* \tbl\tBlendPalette */\n/* \tmov\tr3, #0xc */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0x10 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tldrh\tr0, [r4, #0xa] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrh\tr0, [r4, #0xa] */\n/* \tb\t.L5 */\n/* .L20: */\n/* \t.align\t2, 0 */\n/* .L19: */\n/* \t.word\t0x7f74 */\n/* .L12: */\n/* \tldrh\tr0, [r4, #0xc] */\n/* \tsub\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L13\t@cond_branch */\n/* \tstrh\tr6, [r4, #0xc] */\n/* .L13: */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tldrb\tr2, [r4, #0xc] */\n/* \tldr\tr3, .L21 */\n/* \tmov\tr1, #0x1 */\n/* \tbl\tBlendPalette */\n/* \tmov\tr3, #0xc */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tDestroyAnimVisualTask */\n/* .L5: */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L22: */\n/* \t.align\t2, 0 */\n/* .L21: */\n/* \t.word\t0x7f74 */\n/* .Lfe1: */\n/* \t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step */\n/* .text */\n/* \t.align\t2, 0 */\nvoid AnimTask_FlashHealthboxOnLevelUp_Step(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":124,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId) {\n s16 temp_r0;\n s16 temp_r0_2;\n s16 temp_r0_3;\n s16 temp_r0_4;\n s32 var_r1;\n struct Task *temp_r4;\n u8 temp_r2;\n u8 temp_r5;\n\n temp_r5 = taskId;\n temp_r4 = &gTasks[temp_r5];\n temp_r0 = (u16) temp_r4->data[0] + 1;\n temp_r4->data[0] = temp_r0 + 1;\n if ((s32) temp_r0 >= (s32) temp_r4->data[0xB]) {\n temp_r4->data[0] = 0;\n temp_r2 = IndexOfSpritePaletteTag(0xD709U);\n var_r1 = 2;\n if (temp_r4->data[0xA] == 0) {\n var_r1 = 6;\n }\n temp_r0_2 = temp_r4->data[1];\n switch (temp_r0_2) { /* irregular */\n case 0:\n temp_r0_3 = (u16) temp_r4->data[2] + 2;\n temp_r4->data[2] = temp_r0_3;\n if ((s32) temp_r0_3 > 0x10) {\n temp_r4->data[2] = 0x10;\n }\n BlendPalette(((temp_r2 * 0x10) + 0x100) | var_r1, 1U, (u8) temp_r4->unkC, 0x7F74U);\n if (temp_r4->data[2] == 0x10) {\n temp_r4->data[1] = (u16) temp_r4->data[1] + 1;\n return;\n }\n break;\n case 1:\n temp_r0_4 = (u16) temp_r4->data[2] - 2;\n temp_r4->data[2] = temp_r0_4;\n if ((s32) (temp_r0_4 << 0x10) < 0) {\n temp_r4->data[2] = 0;\n }\n BlendPalette(((temp_r2 * 0x10) + 0x100) | var_r1, 1U, (u8) temp_r4->unkC, 0x7F74U);\n if (temp_r4->data[2] == 0) {\n DestroyAnimVisualTask(temp_r5);\n }\n break;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":48,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:11332: structure has no member named `unkC'","/c.c:11344: structure has no member named `unkC'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AnimTask_FlashHealthboxOnLevelUp_Step` — benchmark function pokeemerald:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\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-f77ea1056385.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AnimTask_FlashHealthboxOnLevelUp_Step # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AnimTask_FlashHealthboxOnLevelUp_Step` — benchmark function pokeemerald:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\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 \"AnimTask_FlashHealthboxOnLevelUp_Step\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AnimTask_FlashHealthboxOnLevelUp_Step # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","loop","nested-loop","shift","bitwise"],"loc":18,"refSource":"u16 CalcCRC16(const u8 *data, s32 length)\n{\n u16 i, j;\n u16 crc = 0x1121;\n\n for (i = 0; i < length; i++)\n {\n crc ^= data[i];\n for (j = 0; j < 8; j++)\n {\n if (crc & 1)\n crc = (crc >> 1) ^ 0x8408;\n else\n crc >>= 1;\n }\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = (u32)v2 >> 1;\n } else {\n v4 = (u16)((u32)v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n","score":45,"maxScore":55,"compileErrors":null,"breakdown":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21},"quality":{"score":86,"lines":30,"gotos":0,"casts":7,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 CalcCRC16(s32 arg0, s32 arg1) {\n u16 var_r1;\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (arg1 > 0) {\n do {\n var_r2 ^= *(arg0 + var_r3);\n var_r1 = 0;\nloop_3:\n if (var_r2 & 1) {\n var_r2 = (var_r2 >> 1) ^ 0x8408;\n } else {\n var_r2 = (u16) (var_r2 >> 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 <= 7U) {\n goto loop_3;\n }\n var_r3 += 1;\n } while ((s32) var_r3 < arg1);\n }\n return (u16) ~var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":84,"lines":25,"gotos":1,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":45,"maxScore":55,"ratio":0.8181818181818182,"kinds":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","cast","table","loop","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","global","table","shift","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Cmd_tryconversiontypechange:agbcc","sym":"Cmd_tryconversiontypechange","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","struct","do-while","loop","nested-loop","call"],"loc":60,"refSource":"static void Cmd_tryconversiontypechange(void)\n{\n u8 validMoves = 0;\n u8 moveChecked;\n u8 moveType;\n\n while (validMoves < MAX_MON_MOVES)\n {\n if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE)\n break;\n\n validMoves++;\n }\n\n for (moveChecked = 0; moveChecked < validMoves; moveChecked++)\n {\n moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;\n\n if (moveType == TYPE_MYSTERY)\n {\n if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))\n moveType = TYPE_GHOST;\n else\n moveType = TYPE_NORMAL;\n }\n if (moveType != gBattleMons[gBattlerAttacker].types[0]\n && moveType != gBattleMons[gBattlerAttacker].types[1])\n {\n break;\n }\n }\n\n if (moveChecked == validMoves)\n {\n gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);\n }\n else\n {\n do\n {\n while ((moveChecked = MOD(Random(), MAX_MON_MOVES)) >= validMoves);\n\n moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;\n\n if (moveType == TYPE_MYSTERY)\n {\n if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))\n moveType = TYPE_GHOST;\n else\n moveType = TYPE_NORMAL;\n }\n }\n while (moveType == gBattleMons[gBattlerAttacker].types[0] || moveType == gBattleMons[gBattlerAttacker].types[1]);\n\n SET_BATTLER_TYPE(gBattlerAttacker, moveType);\n PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);\n\n gBattlescriptCurrInstr += 5;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_script_commands.c#L7389-L7448","targetAsm":"@ Generated by 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 Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-49ee5beb3f01.i.gz","proto":{"Cmd_tryconversiontypechange":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Cmd_tryconversiontypechange' — structure: cannot structure 'Cmd_tryconversiontypechange': 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.type\t Cmd_tryconversiontypechange,function */\n/* \t.thumb_func */\n/* Cmd_tryconversiontypechange: */\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/* \tmov\tr6, #0x0 */\n/* \tldr\tr2, .L35 */\n/* \tldr\tr3, .L35+0x4 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr1, r2, #0 */\n/* \tadd\tr1, r1, #0xc */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0] */\n/* \tmov\tr8, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x58 */\n/* \tadd\tr2, r1, #0 */\n/* .L8: */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tcmp\tr6, #0x3 */\n/* \tbhi\t.L6\t@cond_branch */\n/* \tlsl\tr1, r6, #0x1 */\n/* \tldrb\tr0, [r3] */\n/* \tmul\tr0, r0, r5 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, r2 */\n/* \tldrh\tr0, [r1] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* .L6: */\n/* \tmov\tr3, #0x0 */\n/* \tcmp\tr3, r6 */\n/* \tbcs\t.L11\t@cond_branch */\n/* \tldr\tr0, .L35+0x8 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr5, .L35 */\n/* \tmov\tip, r5 */\n/* \tldr\tr7, .L35+0x4 */\n/* \tldrb\tr0, [r7] */\n/* \tmov\tr4, #0x58 */\n/* \tmov\tr5, r0 */\n/* \tmul\tr5, r5, r4 */\n/* \tmov\tr0, #0xc */\n/* \tadd\tr0, r0, ip */\n/* \tmov\tr9, r0 */\n/* .L13: */\n/* \tlsl\tr0, r3, #0x1 */\n/* \tadd\tr0, r0, r5 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, sl */\n/* \tldrb\tr2, [r0, #0x2] */\n/* \tcmp\tr2, #0x9 */\n/* \tbne\t.L14\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr1, r5, r0 */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x21 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbne\t.L15\t@cond_branch */\n/* .L16: */\n/* \tmov\tr2, #0x7 */\n/* \tb\t.L14 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgBattleMoves */\n/* .L15: */\n/* \tmov\tr2, #0x0 */\n/* .L14: */\n/* \tldrb\tr0, [r7] */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, ip */\n/* \tadd\tr1, r0, #0 */\n/* \tadd\tr1, r1, #0x21 */\n/* \tldrb\tr1, [r1] */\n/* \tcmp\tr2, r1 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr2, r0 */\n/* \tbne\t.L11\t@cond_branch */\n/* .L12: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, r6 */\n/* \tbcc\t.L13\t@cond_branch */\n/* .L11: */\n/* \tcmp\tr3, r6 */\n/* \tbne\t.L20\t@cond_branch */\n/* \tldr\tr3, .L37 */\n/* \tldr\tr2, [r3] */\n/* \tldrb\tr1, [r2, #0x1] */\n/* \tldrb\tr0, [r2, #0x2] */\n/* \tlsl\tr0, r0, #0x8 */\n/* \torr\tr1, r1, r0 */\n/* \tldrb\tr0, [r2, #0x3] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \torr\tr1, r1, r0 */\n/* \tldrb\tr0, [r2, #0x4] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \torr\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\n/* \tb\t.L21 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgBattlescriptCurrInstr */\n/* .L20: */\n/* \tmov\tr7, #0x3 */\n/* \tldr\tr5, .L39 */\n/* \tmov\tr9, r5 */\n/* .L25: */\n/* \tbl\tRandom */\n/* \tadd\tr3, r0, #0 */\n/* \tand\tr3, r3, r7 */\n/* \tcmp\tr3, r6 */\n/* \tbcs\t.L25\t@cond_branch */\n/* \tldr\tr4, .L39+0x4 */\n/* \tlsl\tr1, r3, #0x1 */\n/* \tldr\tr3, .L39+0x8 */\n/* \tldrb\tr2, [r3] */\n/* \tmov\tr0, #0x58 */\n/* \tmov\tr5, r2 */\n/* \tmul\tr5, r5, r0 */\n/* \tadd\tr1, r1, r5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tldrh\tr1, [r1] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrb\tr2, [r0, #0x2] */\n/* \tmov\tr8, r4 */\n/* \tadd\tr4, r3, #0 */\n/* \tcmp\tr2, #0x9 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr2, r5, r0 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x21 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L31\t@cond_branch */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbne\t.L30\t@cond_branch */\n/* .L31: */\n/* \tmov\tr2, #0x7 */\n/* \tb\t.L24 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgBattleMoves */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlerAttacker */\n/* .L30: */\n/* \tmov\tr2, #0x0 */\n/* .L24: */\n/* \tldrb\tr0, [r4] */\n/* \tmov\tr3, #0x58 */\n/* \tmul\tr0, r0, r3 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr1, r0, #0 */\n/* \tadd\tr1, r1, #0x21 */\n/* \tldrb\tr5, [r1] */\n/* \tcmp\tr2, r5 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr2, r0 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tstrb\tr2, [r1] */\n/* \tldrb\tr0, [r4] */\n/* \tmul\tr0, r0, r3 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr1, .L41 */\n/* \tmov\tr0, #0xfd */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr0, #0x3 */\n/* \tstrb\tr0, [r1, #0x1] */\n/* \tstrb\tr2, [r1, #0x2] */\n/* \tmov\tr0, #0xff */\n/* \tstrb\tr0, [r1, #0x3] */\n/* \tldr\tr1, .L41+0x4 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x5 */\n/* \tstr\tr0, [r1] */\n/* .L21: */\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/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgBattleTextBuff1 */\n/* \t.word\tgBattlescriptCurrInstr */\n/* .Lfe1: */\n/* \t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Cmd_tryconversiontypechange(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'Cmd_tryconversiontypechange': 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":241,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'Cmd_tryconversiontypechange': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Cmd_tryconversiontypechange(void) {\n struct BattlePokemon *temp_r0;\n struct BattlePokemon *temp_r0_2;\n struct BattlePokemon *temp_r1;\n struct BattlePokemon *temp_r2;\n u32 temp_r3;\n u8 var_r2;\n u8 var_r2_2;\n u8 var_r3;\n u8 var_r6;\n\n var_r6 = 0;\n if (*((0x58 * gBattlerAttacker) + gBattleMons->moves) != 0) {\nloop_2:\n var_r6 += 1;\n if ((u32) var_r6 <= 3U) {\n if (*((var_r6 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves) != 0) {\n goto loop_2;\n }\n }\n }\n var_r3 = 0;\n if ((u32) var_r6 > 0U) {\nloop_6:\n var_r2 = gBattleMoves[*((var_r3 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves)].type;\n if (var_r2 == 9) {\n temp_r1 = &gBattleMons[gBattlerAttacker];\n if ((temp_r1->types[0] == 7) || (temp_r1->types[1] == 7)) {\n var_r2 = 7;\n } else {\n var_r2 = 0;\n }\n }\n temp_r0 = &gBattleMons[gBattlerAttacker];\n if ((var_r2 == temp_r0->types[0]) || (var_r2 == temp_r0->types[1])) {\n var_r3 += 1;\n if ((u32) var_r3 < (u32) var_r6) {\n goto loop_6;\n }\n }\n }\n if (var_r3 == var_r6) {\n gBattlescriptCurrInstr = (u8 *) (gBattlescriptCurrInstr->unk1 | (gBattlescriptCurrInstr->unk2 << 8) | (gBattlescriptCurrInstr->unk3 << 0x10) | (gBattlescriptCurrInstr->unk4 << 0x18));\n return;\n }\n do {\nloop_17:\n temp_r3 = Random() & 3;\n if (temp_r3 >= (u32) var_r6) {\n goto loop_17;\n }\n var_r2_2 = gBattleMoves[*((temp_r3 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves)].type;\n if (var_r2_2 == 9) {\n temp_r2 = &gBattleMons[gBattlerAttacker];\n if ((temp_r2->types[0] == 7) || (temp_r2->types[1] == 7)) {\n var_r2_2 = 7;\n } else {\n var_r2_2 = 0;\n }\n }\n temp_r0_2 = &gBattleMons[gBattlerAttacker];\n if (var_r2_2 == temp_r0_2->types[0]) {\n goto loop_17;\n }\n } while (var_r2_2 == temp_r0_2->types[1]);\n temp_r0_2->types[0] = var_r2_2;\n gBattleMons[gBattlerAttacker].types[1] = var_r2_2;\n gBattleTextBuff1->unk0 = 0xFD;\n gBattleTextBuff1[1] = 3;\n gBattleTextBuff1[2] = var_r2_2;\n gBattleTextBuff1[3] = 0xFF;\n gBattlescriptCurrInstr += 5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":54,"lines":72,"gotos":4,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:8306: request for member `unk1' in something not a structure or union","/c.c:8306: request for member `unk2' in something not a structure or union","/c.c:8306: request for member `unk3' in something not a structure or union","/c.c:8306: request for member `unk4' in something not a structure or union","/c.c:8331: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Cmd_tryconversiontypechange` — benchmark function pokeemerald:Cmd_tryconversiontypechange:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\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-49ee5beb3f01.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void Cmd_tryconversiontypechange(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Cmd_tryconversiontypechange # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Cmd_tryconversiontypechange` — benchmark function pokeemerald:Cmd_tryconversiontypechange:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Cmd_tryconversiontypechange:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\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 \"Cmd_tryconversiontypechange\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cmd_tryconversiontypechange # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","loop","shift","bitwise"],"loc":13,"refSource":"int CountTrailingZeroBits(u32 value)\n{\n u8 i;\n\n for (i = 0; i < 32; i++)\n {\n if ((value & 1) == 0)\n value >>= 1;\n else\n return i;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = (u32)v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n","score":19,"maxScore":23,"compileErrors":null,"breakdown":{"insert":6,"delete":2,"replace":0,"opMismatch":2,"argMismatch":9},"quality":{"score":100,"lines":15,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CountTrailingZeroBits(u32 arg0) {\n u32 var_r2;\n u8 var_r1;\n\n var_r2 = arg0;\n var_r1 = 0;\nloop_1:\n if (var_r2 & 1) {\n return var_r1;\n }\n var_r2 = var_r2 >> 1;\n var_r1 += 1;\n if ((u32) var_r1 > 0x1FU) {\n return 0U;\n }\n goto loop_1;\n}\n","score":15,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9},"quality":{"score":88,"lines":16,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":19,"ratio":0.7894736842105263,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:DoForcedMovement:agbcc","sym":"DoForcedMovement","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["fnptr","branch","global","bitwise","call"],"loc":29,"refSource":"static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8))\n{\n struct PlayerAvatar *playerAvatar = &gPlayerAvatar;\n u8 collision = CheckForPlayerAvatarCollision(direction);\n\n playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;\n if (collision)\n {\n ForcedMovement_None();\n if (collision < COLLISION_STOP_SURFING)\n {\n return FALSE;\n }\n else\n {\n if (collision == COLLISION_LEDGE_JUMP)\n PlayerJumpLedge(direction);\n playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;\n playerAvatar->runningState = MOVING;\n return TRUE;\n }\n }\n else\n {\n playerAvatar->runningState = MOVING;\n moveFunc(direction);\n return TRUE;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/field_player_avatar.c#L443-L471","targetAsm":"@ Generated by 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 DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-8b0dad249cd1.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gPlayerAvatar","shape":"struct PlayerAvatar (36 B)"}],"outcome":"nonmatch","source":"s32 DoForcedMovement(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 a5) {\n s32 v0;\n s32 v1;\n v0 = CheckForPlayerAvatarCollision((u8)a0);\n v1 = 64;\n gPlayerAvatar.flags = gPlayerAvatar.flags | v1;\n if ((u8)v0 != 0) {\n ForcedMovement_None();\n if ((u8)v0 <= 4) {\n return 0;\n } else {\n if ((u8)v0 == 6) PlayerJumpLedge((u8)a0);\n gPlayerAvatar.flags = gPlayerAvatar.flags | v1;\n gPlayerAvatar.runningState = 2;\n return 1;\n }\n } else {\n gPlayerAvatar.runningState = 2;\n _call_via_r9((u8)a0, v1);\n return 1;\n }\n}\n","score":31,"maxScore":59,"compileErrors":null,"breakdown":{"insert":5,"delete":12,"replace":2,"opMismatch":0,"argMismatch":12},"quality":{"score":92,"lines":22,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u8 CheckForPlayerAvatarCollision(u8); /* extern */\n? ForcedMovement_None(); /* extern */\n\nu8 DoForcedMovement(u8 direction, void (*moveFunc)(u8)) {\n u8 temp_r4;\n u8 temp_r5;\n u8 temp_r7;\n\n temp_r5 = direction;\n temp_r4 = CheckForPlayerAvatarCollision(temp_r5);\n temp_r7 = temp_r4;\n gPlayerAvatar.flags |= 0x40;\n if (temp_r4 != 0) {\n ForcedMovement_None();\n if ((u32) temp_r4 <= 4U) {\n return 0U;\n }\n if (temp_r7 == 6) {\n PlayerJumpLedge(temp_r5);\n }\n gPlayerAvatar.flags |= 0x40;\n gPlayerAvatar.runningState = 2;\n goto block_7;\n }\n gPlayerAvatar.runningState = 2;\n moveFunc(temp_r5);\nblock_7:\n return 1U;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":86,"lines":27,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":31,"maxScore":59,"ratio":0.5254237288135594,"kinds":{"insert":5,"delete":12,"replace":2,"opMismatch":0,"argMismatch":12}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DoForcedMovement` — benchmark function pokeemerald:DoForcedMovement:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\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-8b0dad249cd1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8));\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DoForcedMovement # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DoForcedMovement` — benchmark function pokeemerald:DoForcedMovement:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:DoForcedMovement:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DoForcedMovement # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","macro","shift"],"loc":5,"refSource":"static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"sFeebasRngValue","shape":"scalar u32"}],"outcome":"match","source":"s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return (u32)(1103515245 * v0 + 12345) >> 16;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 sFeebasRngValue;\n\nu32 FeebasRandom(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * sFeebasRngValue) + 0x3039;\n sFeebasRngValue = temp_r0;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","global","struct","switch","bitwise","comparison-tree"],"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 || ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > 255 || ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 < 254) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n }\n }\n return v0;\n}\n","score":32,"maxScore":37,"compileErrors":null,"breakdown":{"insert":6,"delete":9,"replace":4,"opMismatch":4,"argMismatch":9},"quality":{"score":90,"lines":18,"gotos":0,"casts":7,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:GetMoveTarget:agbcc","sym":"GetMoveTarget","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","switch","do-while","loop","bitwise","soft-div","call","jump-table"],"loc":84,"refSource":"u8 GetMoveTarget(u16 move, u8 setTarget)\n{\n u8 targetBattler = 0;\n u8 moveTarget;\n u8 side;\n\n if (setTarget != NO_TARGET_OVERRIDE)\n moveTarget = setTarget - 1;\n else\n moveTarget = gBattleMoves[move].target;\n\n switch (moveTarget)\n {\n case MOVE_TARGET_SELECTED:\n side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));\n if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)\n {\n targetBattler = gSideTimers[side].followmeTarget;\n }\n else\n {\n side = GetBattlerSide(gBattlerAttacker);\n do\n {\n targetBattler = Random() % gBattlersCount;\n } while (targetBattler == gBattlerAttacker || side == GetBattlerSide(targetBattler) || gAbsentBattlerFlags & gBitTable[targetBattler]);\n if (gBattleMoves[move].type == TYPE_ELECTRIC\n && AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIDE, gBattlerAttacker, ABILITY_LIGHTNING_ROD, 0, 0)\n && gBattleMons[targetBattler].ability != ABILITY_LIGHTNING_ROD)\n {\n targetBattler ^= BIT_FLANK;\n RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);\n gSpecialStatuses[targetBattler].lightningRodRedirected = 1;\n }\n }\n break;\n case MOVE_TARGET_DEPENDS:\n case MOVE_TARGET_BOTH:\n case MOVE_TARGET_FOES_AND_ALLY:\n case MOVE_TARGET_OPPONENTS_FIELD:\n targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));\n if (gAbsentBattlerFlags & gBitTable[targetBattler])\n targetBattler ^= BIT_FLANK;\n break;\n case MOVE_TARGET_RANDOM:\n side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));\n if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)\n {\n targetBattler = gSideTimers[side].followmeTarget;\n }\n else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && moveTarget & MOVE_TARGET_RANDOM)\n {\n if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)\n {\n if (Random() & 1)\n targetBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);\n else\n targetBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);\n }\n else\n {\n if (Random() & 1)\n targetBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);\n else\n targetBattler = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);\n }\n if (gAbsentBattlerFlags & gBitTable[targetBattler])\n targetBattler ^= BIT_FLANK;\n }\n else\n {\n targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));\n }\n break;\n case MOVE_TARGET_USER_OR_SELECTED:\n case MOVE_TARGET_USER:\n targetBattler = gBattlerAttacker;\n break;\n }\n\n *(gBattleStruct->moveTarget + gBattlerAttacker) = targetBattler;\n\n return targetBattler;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_util.c#L3828-L3911","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GetMoveTarget' — lift: cannot lift 'GetMoveTarget': 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\tGetMoveTarget */\n/* \t.type\t GetMoveTarget,function */\n/* \t.thumb_func */\n/* GetMoveTarget: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r8 */\n/* \tpush\t{r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr7, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr0, r1, #0x18 */\n/* \tmov\tr5, #0x0 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tsub\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tb\t.L4 */\n/* .L3: */\n/* \tldr\tr1, .L38 */\n/* \tlsl\tr0, r7, #0x1 */\n/* \tadd\tr0, r0, r7 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr6, [r0, #0x6] */\n/* .L4: */\n/* \tcmp\tr6, #0x40 */\n/* \tbls\t.LCB32 */\n/* \tb\t.L5\t@long jump */\n/* .LCB32: */\n/* \tlsl\tr0, r6, #0x2 */\n/* \tldr\tr1, .L38+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\tgBattleMoves */\n/* \t.word\t.L34 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\t.L6 */\n/* \t.word\t.L18 */\n/* \t.word\t.L33 */\n/* \t.word\t.L5 */\n/* \t.word\t.L20 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L33 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* .L6: */\n/* \tldr\tr0, .L40 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tmov\tr1, #0x1 */\n/* \teor\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr1, .L40+0x4 */\n/* \tlsl\tr0, r4, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr2, r0, r1 */\n/* \tldrb\tr0, [r2, #0x8] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L7\t@cond_branch */\n/* \tldr\tr1, .L40+0x8 */\n/* \tldrb\tr4, [r2, #0x9] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0, #0x28] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.LCB80 */\n/* \tb\t.L36\t@long jump */\n/* .LCB80: */\n/* .L7: */\n/* \tldr\tr0, .L40 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tlsl\tr0, r7, #0x1 */\n/* \tmov\tr8, r0 */\n/* .L9: */\n/* \tbl\tRandom */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tldr\tr1, .L40+0xc */\n/* \tldrb\tr1, [r1] */\n/* \tbl\t__modsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr6, .L40 */\n/* \tldrb\tr3, [r6] */\n/* \tcmp\tr5, r3 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr4, r0 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tldr\tr0, .L40+0x10 */\n/* \tldrb\tr2, [r0] */\n/* \tldr\tr1, .L40+0x14 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tand\tr2, r2, r0 */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L9\t@cond_branch */\n/* \tldr\tr0, .L40+0x18 */\n/* \tmov\tr3, r8 */\n/* \tadd\tr1, r3, r7 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr1, r1, r0 */\n/* \tldrb\tr0, [r1, #0x2] */\n/* \tcmp\tr0, #0xd */\n/* \tbeq\t.LCB143 */\n/* \tb\t.L5\t@long jump */\n/* .LCB143: */\n/* \tldrb\tr1, [r6] */\n/* \tstr\tr2, [sp] */\n/* \tmov\tr0, #0x10 */\n/* \tmov\tr2, #0x1f */\n/* \tmov\tr3, #0x0 */\n/* \tbl\tAbilityBattleEffects */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB157 */\n/* \tb\t.L5\t@long jump */\n/* .LCB157: */\n/* \tldr\tr2, .L40+0x8 */\n/* \tmov\tr1, #0x58 */\n/* \tmov\tr0, r5 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr0, r0, r2 */\n/* \tadd\tr0, r0, #0x20 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x1f */\n/* \tbne\t.LCB167 */\n/* \tb\t.L5\t@long jump */\n/* .LCB167: */\n/* \tmov\tr4, #0x2 */\n/* \teor\tr5, r5, r4 */\n/* \tmov\tr0, r5 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr0, r0, r2 */\n/* \tadd\tr0, r0, #0x20 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tRecordAbilityBattle */\n/* \tldr\tr1, .L40+0x1c */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \torr\tr1, r1, r4 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L5 */\n/* .L41: */\n/* \t.align\t2, 0 */\n/* .L40: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgSideTimers */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlersCount */\n/* \t.word\tgAbsentBattlerFlags */\n/* \t.word\tgBitTable */\n/* \t.word\tgBattleMoves */\n/* \t.word\tgSpecialStatuses */\n/* .L18: */\n/* \tldr\tr0, .L42 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerPosition */\n/* \tadd\tr1, r0, #0 */\n/* \tmov\tr2, #0x1 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \teor\tr0, r0, r2 */\n/* \tb\t.L37 */\n/* .L43: */\n/* \t.align\t2, 0 */\n/* .L42: */\n/* \t.word\tgBattlerAttacker */\n/* .L20: */\n/* \tldr\tr0, .L44 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tmov\tr1, #0x1 */\n/* \teor\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr1, .L44+0x4 */\n/* \tlsl\tr0, r4, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr2, r0, r1 */\n/* \tldrb\tr0, [r2, #0x8] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L21\t@cond_branch */\n/* \tldr\tr1, .L44+0x8 */\n/* \tldrb\tr4, [r2, #0x9] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0, #0x28] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L21\t@cond_branch */\n/* .L36: */\n/* \tadd\tr5, r4, #0 */\n/* \tb\t.L5 */\n/* .L45: */\n/* \t.align\t2, 0 */\n/* .L44: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgSideTimers */\n/* \t.word\tgBattleMons */\n/* .L21: */\n/* \tldr\tr0, .L46 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tr4, #0x1 */\n/* \tand\tr0, r0, r4 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tmov\tr0, #0x4 */\n/* \tand\tr6, r6, r0 */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tldr\tr0, .L46+0x4 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tbl\tRandom */\n/* \tadd\tr1, r4, #0 */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L37 */\n/* .L47: */\n/* \t.align\t2, 0 */\n/* .L46: */\n/* \t.word\tgBattleTypeFlags */\n/* \t.word\tgBattlerAttacker */\n/* .L25: */\n/* \tmov\tr0, #0x3 */\n/* \tb\t.L37 */\n/* .L24: */\n/* \tbl\tRandom */\n/* \tadd\tr1, r4, #0 */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L28\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L37 */\n/* .L28: */\n/* \tmov\tr0, #0x2 */\n/* .L37: */\n/* \tbl\tGetBattlerAtPosition */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr0, .L48 */\n/* \tldrb\tr1, [r0] */\n/* \tldr\tr2, .L48+0x4 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tldr\tr0, [r0] */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tmov\tr0, #0x2 */\n/* \teor\tr5, r5, r0 */\n/* \tb\t.L5 */\n/* .L49: */\n/* \t.align\t2, 0 */\n/* .L48: */\n/* \t.word\tgAbsentBattlerFlags */\n/* \t.word\tgBitTable */\n/* .L23: */\n/* \tldr\tr0, .L50 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerPosition */\n/* \tadd\tr1, r0, #0 */\n/* \tmov\tr2, #0x1 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \teor\tr0, r0, r2 */\n/* \tbl\tGetBattlerAtPosition */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tb\t.L5 */\n/* .L51: */\n/* \t.align\t2, 0 */\n/* .L50: */\n/* \t.word\tgBattlerAttacker */\n/* .L33: */\n/* \tldr\tr0, .L52 */\n/* \tldrb\tr5, [r0] */\n/* .L5: */\n/* \tldr\tr0, .L52 */\n/* \tldrb\tr0, [r0] */\n/* \tldr\tr1, .L52+0x4 */\n/* \tldr\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tstrb\tr5, [r0, #0xc] */\n/* \tadd\tr0, r5, #0 */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3} */\n/* \tmov\tr8, r3 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L53: */\n/* \t.align\t2, 0 */\n/* .L52: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgBattleStruct */\n/* .Lfe1: */\n/* \t.size\t GetMoveTarget,.Lfe1-GetMoveTarget */\n/* .text */\n/* \t.align\t2, 0 */\nvoid GetMoveTarget(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'GetMoveTarget': 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":395,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'GetMoveTarget': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 AbilityBattleEffects(s32, u8, s32, s32); /* extern */\nu8 GetBattlerAtPosition(s32); /* extern */\ns32 GetBattlerPosition(u8); /* extern */\nu8 GetBattlerSide(u8); /* extern */\nu16 Random(); /* extern */\n? RecordAbilityBattle(u8, u8); /* extern */\nextern u8 gAbsentBattlerFlags;\nextern ? gBattleMons;\nextern ? gBattleMoves;\nextern s32 gBattleStruct;\nextern s32 gBattleTypeFlags;\nextern u8 gBattlerAttacker;\nextern u8 gBattlersCount;\nextern ? gBitTable;\nextern ? gSideTimers;\nextern ? gSpecialStatuses;\n\nu8 GetMoveTarget(u16 arg0, u8 arg1) {\n s32 temp_r2_2;\n s32 var_r0;\n u16 temp_r7;\n u8 *temp_r0_2;\n u8 temp_r0;\n u8 temp_r4;\n u8 var_r4;\n u8 var_r5;\n u8 var_r6;\n void *temp_r2;\n void *temp_r2_3;\n\n temp_r7 = arg0;\n temp_r0 = arg1;\n var_r5 = 0;\n if (temp_r0 != 0) {\n var_r6 = temp_r0 - 1;\n } else {\n var_r6 = ((temp_r7 * 0xC) + &gBattleMoves)->unk6;\n }\n switch ((u32) var_r6) { /* irregular */\n case 0x0:\n temp_r2 = ((u8) (GetBattlerSide(gBattlerAttacker) ^ 1) * 0xC) + &gSideTimers;\n if ((temp_r2->unk8 != 0) && (var_r4 = temp_r2->unk9, (((0x58 * var_r4) + &gBattleMons)->unk28 != 0))) {\nblock_23:\n var_r5 = var_r4;\n } else {\n temp_r4 = GetBattlerSide(gBattlerAttacker);\n do {\nloop_10:\n var_r5 = (u8) ((s32) Random() % (s32) gBattlersCount);\n if (var_r5 == gBattlerAttacker) {\n goto loop_10;\n }\n if (temp_r4 == GetBattlerSide(var_r5)) {\n goto loop_10;\n }\n temp_r2_2 = gAbsentBattlerFlags & *((var_r5 * 4) + &gBitTable);\n } while (temp_r2_2 != 0);\n if (((temp_r7 * 0xC) + &gBattleMoves)->unk2 != 0xD) {\n\n } else {\n unksp0 = temp_r2_2;\n if ((AbilityBattleEffects(0x10, gBattlerAttacker, 0x1F, 0) << 0x18) == 0) {\n\n } else if (((var_r5 * 0x58) + &gBattleMons)->unk20 == 0x1F) {\n\n } else {\n var_r5 ^= 2;\n RecordAbilityBattle(var_r5, ((var_r5 * 0x58) + &gBattleMons)->unk20);\n temp_r0_2 = (var_r5 * 0x14) + &gSpecialStatuses;\n *temp_r0_2 |= 2;\n }\n }\n }\n break;\n case 0x1:\n case 0x8:\n case 0x20:\n case 0x40:\n var_r0 = (1 & GetBattlerPosition(gBattlerAttacker)) ^ 1;\nblock_33:\n var_r5 = GetBattlerAtPosition(var_r0);\n if (gAbsentBattlerFlags & *((var_r5 * 4) + &gBitTable)) {\n var_r5 ^= 2;\n }\n break;\n case 0x4:\n temp_r2_3 = ((u8) (GetBattlerSide(gBattlerAttacker) ^ 1) * 0xC) + &gSideTimers;\n if (temp_r2_3->unk8 != 0) {\n var_r4 = temp_r2_3->unk9;\n if (((0x58 * var_r4) + &gBattleMons)->unk28 != 0) {\n goto block_23;\n }\n }\n if ((gBattleTypeFlags & 1) && (var_r6 & 4)) {\n if ((GetBattlerSide(gBattlerAttacker) << 0x18) == 0) {\n if (1 & Random()) {\n var_r0 = 1;\n } else {\n var_r0 = 3;\n }\n } else if (1 & Random()) {\n var_r0 = 0;\n } else {\n var_r0 = 2;\n }\n goto block_33;\n }\n var_r5 = GetBattlerAtPosition((1 & GetBattlerPosition(gBattlerAttacker)) ^ 1);\n break;\n case 0x2:\n case 0x10:\n var_r5 = gBattlerAttacker;\n break;\n }\n (gBattlerAttacker + gBattleStruct)->unkC = var_r5;\n return var_r5;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":112,"gotos":4,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetMoveTarget` — benchmark function pokeemerald:GetMoveTarget:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetMoveTarget # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetMoveTarget` — benchmark function pokeemerald:GetMoveTarget:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:GetMoveTarget:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetMoveTarget # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","memory","global","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","int64","call"],"loc":9,"refSource":"s32 MathUtil_Mul32(s32 x, s32 y)\n{\n s64 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | (u32)v0 >> 8;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adc'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 MathUtil_Mul32(s32 arg0, s32 arg1) {\n s32 temp_r1;\n s32 var_r7;\n u32 temp_r0;\n u32 temp_ret;\n u32 var_r6;\n\n temp_ret = __muldi3(arg0, arg0 >> 0x1F, arg1, arg1 >> 0x1F);\n temp_r0 = temp_ret;\n temp_r1 = SECOND_REG(temp_ret);\n var_r7 = temp_r1;\n var_r6 = temp_r0;\n if (temp_r1 < 0) {\n var_r6 = temp_r0 + 0xFF;\n var_r7 = temp_r1 + M2C_CARRY(var_r6);\n }\n return (var_r7 << 0x18) | (var_r6 >> 8);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","arithmetic","global","switch","soft-div","call","comparison-tree"],"loc":25,"refSource":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)\n{\n u16 retVal;\n\n // Don't modify HP, Accuracy, or Evasion by nature\n if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS)\n return stat;\n\n switch (gNatureStatTable[nature][statIndex - 1])\n {\n case 1:\n retVal = stat * 110;\n retVal /= 100;\n break;\n case -1:\n retVal = stat * 90;\n retVal /= 100;\n break;\n default:\n retVal = stat;\n break;\n }\n\n return retVal;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gNatureStatTable","shape":"s8[]"}],"outcome":"nonmatch","source":"s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[0][(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n","score":40,"maxScore":56,"compileErrors":null,"breakdown":{"insert":10,"delete":8,"replace":8,"opMismatch":2,"argMismatch":12},"quality":{"score":84,"lines":19,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex) {\n s32 var_r0;\n s8 temp_r1;\n u16 temp_r3;\n\n temp_r3 = stat;\n if ((u32) ((u32) ((statIndex << 0x18) + 0xFF000000) >> 0x18) > 4U) {\n return temp_r3;\n }\n temp_r1 = (s8) (u8) (*gNatureStatTable)[statIndex + ((nature * 5) - 1)];\n switch (temp_r1) { /* irregular */\n case 1:\n var_r0 = 0x6E;\nblock_6:\n return (u16) ((u16) (var_r0 * temp_r3) / 100U);\n case -1:\n var_r0 = 0x5A;\n goto block_6;\n default:\n return temp_r3;\n }\n}\n","score":31,"maxScore":55,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7},"quality":{"score":76,"lines":21,"gotos":1,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":55,"ratio":0.5636363636363636,"kinds":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","sizeof","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"loc":6,"refSource":"u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngValue","shape":"scalar u32"},{"name":"sRandCount","shape":"scalar u32"}],"outcome":"match","source":"s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return (u32)(1103515245 * v0 + 24691) >> 16;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 gRngValue;\nextern s32 sRandCount;\n\nu32 Random(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * gRngValue) + 0x6073;\n gRngValue = temp_r0;\n sRandCount += 1;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetMauvilleOldManLanguage:agbcc","sym":"SetMauvilleOldManLanguage","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","struct","memory","switch","loop","call","jump-table"],"loc":64,"refSource":"static void UNUSED SetMauvilleOldManLanguage(union OldMan *oldMan, u32 language1, u32 language2, u32 language3)\n{\n s32 i;\n\n switch (oldMan->common.id)\n {\n case MAUVILLE_MAN_TRADER:\n {\n struct MauvilleOldManTrader *trader = &oldMan->trader;\n\n for (i = 0; i < NUM_TRADER_ITEMS; i++)\n {\n if (IsStringJapanese(trader->playerNames[i]))\n trader->language[i] = language1;\n else\n trader->language[i] = language2;\n }\n }\n break;\n case MAUVILLE_MAN_STORYTELLER:\n {\n struct MauvilleManStoryteller *storyteller = &oldMan->storyteller;\n\n for (i = 0; i < NUM_STORYTELLER_TALES; i++)\n {\n if (IsStringJapanese(storyteller->trainerNames[i]))\n storyteller->language[i] = language1;\n else\n storyteller->language[i] = language2;\n }\n }\n break;\n case MAUVILLE_MAN_BARD:\n {\n struct MauvilleManBard *bard = &oldMan->bard;\n\n if (language3 == LANGUAGE_JAPANESE)\n bard->language = language1;\n else\n bard->language = language2;\n }\n break;\n case MAUVILLE_MAN_HIPSTER:\n {\n struct MauvilleManHipster *hipster = &oldMan->hipster;\n\n if (language3 == LANGUAGE_JAPANESE)\n hipster->language = language1;\n else\n hipster->language = language2;\n }\n break;\n case MAUVILLE_MAN_GIDDY:\n {\n struct MauvilleManGiddy *giddy = &oldMan->giddy;\n\n if (language3 == LANGUAGE_JAPANESE)\n giddy->language = language1;\n else\n giddy->language = language2;\n }\n break;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/mauville_old_man.c#L793-L856","targetAsm":"@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\n\n.text\n\t.align\t2, 0\n","proto":{"SetMauvilleOldManLanguage":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void SetMauvilleOldManLanguage(u8 * a0, u32 a1, u32 a2, u32 a3, u32 a4) {\n s32 v0;\n u8 * v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n u8 * v5;\n u8 * v6;\n switch (*a0) {\n case 0:\n if (a3 == 1) {\n v5 = a0 + 42;\n *v5 = a1;\n return;\n } else {\n v6 = a0 + 42;\n *v6 = a2;\n return;\n }\n case 1:\n if (a3 == 1) {\n a0[2] = a1;\n return;\n } else {\n a0[2] = a2;\n return;\n }\n case 2:\n v0 = 0;\n v1 = a0 + 50;\n do {\n if (IsStringJapanese(a0 + (11 * v0 + 5)) == 0) {\n *v1 = a2;\n } else {\n *v1 = a1;\n }\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v0 <= 3);\n return;\n case 3:\n v3 = a0 + 52;\n v2 = a0 + 8;\n v4 = 3;\n do {\n if (IsStringJapanese(v2) == 0) {\n *v3 = a2;\n } else {\n *v3 = a1;\n }\n v3 = v3 + 1;\n v2 = v2 + 7;\n v4 = v4 - 1;\n } while (v4 >= 0);\n return;\n case 4:\n if (a3 == 1) {\n v5 = a0 + 32;\n *v5 = a1;\n return;\n } else {\n v6 = a0 + 32;\n *v6 = a2;\n return;\n }\n default:\n return;\n }\n}\n","score":59,"maxScore":105,"compileErrors":null,"breakdown":{"insert":16,"delete":18,"replace":0,"opMismatch":2,"argMismatch":23},"quality":{"score":96,"lines":69,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 IsStringJapanese(void *); /* extern */\n\nvoid SetMauvilleOldManLanguage(void *arg0, s8 arg1, s8 arg2, s32 arg3) {\n s32 var_r5;\n s32 var_r5_2;\n s8 *var_r0;\n s8 *var_r0_2;\n s8 *var_r4;\n s8 *var_r4_2;\n u8 temp_r0;\n void *var_r6;\n\n temp_r0 = arg0->unk0;\n switch (temp_r0) {\n case 2:\n var_r5 = 0;\n var_r4 = arg0 + 0x32;\n do {\n if (IsStringJapanese(arg0 + ((0xB * var_r5) + 5)) != 0) {\n *var_r4 = arg1;\n } else {\n *var_r4 = arg2;\n }\n var_r4 += 1;\n var_r5 += 1;\n } while (var_r5 <= 3);\n return;\n case 3:\n var_r4_2 = arg0 + 0x34;\n var_r6 = arg0 + 8;\n var_r5_2 = 3;\n do {\n if (IsStringJapanese(var_r6) != 0) {\n *var_r4_2 = arg1;\n } else {\n *var_r4_2 = arg2;\n }\n var_r4_2 += 1;\n var_r6 += 7;\n var_r5_2 -= 1;\n } while (var_r5_2 >= 0);\n return;\n case 0:\n if (arg3 == 1) {\n var_r0 = arg0 + 0x2A;\nblock_22:\n *var_r0 = arg1;\n return;\n }\n var_r0_2 = arg0 + 0x2A;\nblock_24:\n *var_r0_2 = arg2;\n default:\n return;\n case 1:\n if (arg3 == 1) {\n arg0->unk2 = arg1;\n return;\n }\n arg0->unk2 = arg2;\n return;\n case 4:\n if (arg3 == 1) {\n var_r0 = arg0 + 0x20;\n goto block_22;\n }\n var_r0_2 = arg0 + 0x20;\n goto block_24;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":72,"lines":68,"gotos":2,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:8597: conflicting types for `IsStringJapanese'","/c.c:4062: previous declaration of `IsStringJapanese'","/c.c:8609: warning: dereferencing `void *' pointer","/c.c:8609: request for member `unk0' in something not a structure or union","/c.c:8653: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":59,"maxScore":105,"ratio":0.5619047619047619,"kinds":{"insert":16,"delete":18,"replace":0,"opMismatch":2,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetMauvilleOldManLanguage` — benchmark function pokeemerald:SetMauvilleOldManLanguage:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetMauvilleOldManLanguage # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetMauvilleOldManLanguage` — benchmark function pokeemerald:SetMauvilleOldManLanguage:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetMauvilleOldManLanguage:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\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 \"SetMauvilleOldManLanguage\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetMauvilleOldManLanguage # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","table","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","branch","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","array","loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","array","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","array","struct","table","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":"pokeemerald:TrySetCantSelectMoveBattleScript:agbcc","sym":"TrySetCantSelectMoveBattleScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","struct","bitfield","bitwise","call"],"loc":105,"refSource":"u8 TrySetCantSelectMoveBattleScript(void)\n{\n u8 limitations = 0;\n u16 move = gBattleMons[gActiveBattler].moves[gBattleBufferB[gActiveBattler][2]];\n u8 holdEffect;\n u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler];\n\n if (gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)\n {\n gBattleScripting.battler = gActiveBattler;\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMove;\n limitations = 1;\n }\n }\n\n if (move == gLastMoves[gActiveBattler] && move != MOVE_STRUGGLE && (gBattleMons[gActiveBattler].status2 & STATUS2_TORMENT))\n {\n CancelMultiTurnMoves(gActiveBattler);\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMove;\n limitations++;\n }\n }\n\n if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0)\n {\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTaunt;\n limitations++;\n }\n }\n\n if (GetImprisonedMovesCount(gActiveBattler, move))\n {\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMove;\n limitations++;\n }\n }\n\n if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)\n holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;\n else\n holdEffect = GetItemHoldEffect(gBattleMons[gActiveBattler].item);\n\n gPotentialItemEffectBattler = gActiveBattler;\n\n if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)\n {\n gCurrentMove = *choicedMove;\n gLastUsedItem = gBattleMons[gActiveBattler].item;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveChoiceItem;\n limitations++;\n }\n }\n\n if (gBattleMons[gActiveBattler].pp[gBattleBufferB[gActiveBattler][2]] == 0)\n {\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingMoveWithNoPP;\n limitations++;\n }\n }\n\n return limitations;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_util.c#L976-L1080","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-78a6659be413.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gActiveBattler","shape":"scalar u8"},{"name":"gBattleBufferB","shape":"u8[]"},{"name":"gBattleMons","shape":"array (88 B/elem)"},{"name":"gBattleMoves","shape":"array (12 B/elem)"},{"name":"gBattleScripting","shape":"struct BattleScripting (40 B)"},{"name":"gBattleStruct","shape":"pointer"},{"name":"gBattleTypeFlags","shape":"scalar u32"},{"name":"gCurrentMove","shape":"scalar u16"},{"name":"gDisableStructs","shape":"array (28 B/elem)"},{"name":"gEnigmaBerries","shape":"array (28 B/elem)"},{"name":"gLastMoves","shape":"u16[]"},{"name":"gLastUsedItem","shape":"scalar u16"},{"name":"gPalaceSelectionBattleScripts","shape":"u32[]"},{"name":"gPotentialItemEffectBattler","shape":"scalar u8"},{"name":"gProtectStructs","shape":"array (16 B/elem)"},{"name":"gSelectionBattleScripts","shape":"u32[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 field_0; u8 _pad0[511]; };\nstruct Elem1 { u8 _pad0[4]; u16 field_4; u8 _pad1[13]; u8 field_19; u8 _pad2[8]; };\nstruct Elem2 { u8 _pad0[2]; u8 field_2; u8 _pad1[13]; };\nstruct Elem3 { s32 field_0; u8 _pad0[84]; };\nstruct Elem4 { u8 _pad0[1]; u8 field_1; u8 _pad1[10]; };\nstruct Elem5 { u8 _pad0[46]; u16 field_46; u8 _pad1[40]; };\nstruct Elem6 { u8 _pad0[7]; u8 field_7; u8 _pad1[20]; };\nstruct Elem7 { u8 field_0; u8 _pad0[511]; };\ns32 TrySetCantSelectMoveBattleScript(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n v0 = gActiveBattler;\n v1 = *(u16 *)((((struct Elem0 *)((u32)&gBattleBufferB + 2))[v0].field_0 << 1) + 88 * v0 + ((u32)&gBattleMons + 12));\n v2 = gBattleStruct;\n if (((struct Elem1 *)&gDisableStructs)[v0].field_4 != v1 || v1 == 0) {\n v4 = 0;\n } else {\n gBattleScripting.battler = v0;\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingDisabledMove;\n v4 = 1;\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingDisabledMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n v4 = 0;\n }\n }\n if (v1 == gLastMoves[gActiveBattler] && v1 != 165 && ((struct Elem3 *)((u32)&gBattleMons + 80))[gActiveBattler].field_0 < 0) {\n CancelMultiTurnMoves(gActiveBattler);\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingTormentedMove;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingTormentedMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n if (((struct Elem1 *)&gDisableStructs)[gActiveBattler].field_19 << 28 != 0 && ((struct Elem4 *)&gBattleMoves)[v1].field_1 == 0) {\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveTaunt;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveTauntInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n if (GetImprisonedMovesCount(gActiveBattler, v1) << 24 != 0) {\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingImprisonedMove;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingImprisonedMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n v3 = gActiveBattler;\n if (((struct Elem5 *)&gBattleMons)[v3].field_46 != 175) {\n v5 = (u8)GetItemHoldEffect(((struct Elem5 *)&gBattleMons)[v3].field_46);\n } else {\n v5 = ((struct Elem6 *)&gEnigmaBerries)[v3].field_7;\n }\n gPotentialItemEffectBattler = gActiveBattler;\n if (v5 == 29) {\n if (*(u16 *)(v2 + ((v0 << 1) + 200)) != 0 && (*(u16 *)(v2 + ((v0 << 1) + 200)) != 65535 && *(u16 *)(v2 + ((v0 << 1) + 200)) != v1)) {\n gCurrentMove = *(u16 *)(v2 + ((v0 << 1) + 200));\n gLastUsedItem = ((struct Elem5 *)&gBattleMons)[gActiveBattler].field_46;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveChoiceItem;\n v4 = (u8)(v4 + 1);\n } else {\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n }\n if (*(u8 *)(88 * gActiveBattler + ((struct Elem7 *)((u32)&gBattleBufferB + 2))[gActiveBattler].field_0 + ((u32)&gBattleMons + 36)) == 0) {\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingMoveWithNoPP;\n v4 = (u8)(v4 + 1);\n } else {\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n return v4;\n}\n","score":303,"maxScore":435,"compileErrors":null,"breakdown":{"insert":46,"delete":53,"replace":37,"opMismatch":10,"argMismatch":157},"quality":{"score":68,"lines":91,"gotos":0,"casts":12,"unkGlue":0,"rawMem":6,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 TrySetCantSelectMoveBattleScript(void) {\n struct ProtectStruct *temp_r1;\n struct ProtectStruct *temp_r1_2;\n struct ProtectStruct *temp_r1_3;\n struct ProtectStruct *temp_r1_4;\n struct ProtectStruct *temp_r1_7;\n struct ProtectStruct *temp_r1_8;\n u16 *temp_r8;\n u16 temp_r1_6;\n u16 temp_r5;\n u8 var_r4;\n u8 var_r6;\n void *temp_r1_5;\n\n var_r6 = 0;\n temp_r5 = *((*((gActiveBattler << 9) + &gBattleBufferB[0][2]) * 2) + (0x58 * gActiveBattler) + gBattleMons->moves);\n temp_r8 = &gBattleStruct->choicedMove[gActiveBattler];\n if ((gDisableStructs[gActiveBattler].disabledMove == temp_r5) && (temp_r5 != 0)) {\n gBattleScripting.battler = gActiveBattler;\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace;\n temp_r1 = &gProtectStructs[gActiveBattler];\n temp_r1->unk2 = (u8) (temp_r1->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMove;\n var_r6 = 1;\n }\n }\n if ((temp_r5 == gLastMoves[gActiveBattler]) && (temp_r5 != 0xA5) && ((s32) *((0x58 * gActiveBattler) + &gBattleMons->status2) < 0)) {\n CancelMultiTurnMoves(gActiveBattler);\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace;\n temp_r1_2 = &gProtectStructs[gActiveBattler];\n temp_r1_2->unk2 = (u8) (temp_r1_2->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMove;\n var_r6 += 1;\n }\n }\n if (((gDisableStructs[gActiveBattler].unk13 << 0x1C) != 0) && (gBattleMoves[temp_r5].power == 0)) {\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;\n temp_r1_3 = &gProtectStructs[gActiveBattler];\n temp_r1_3->unk2 = (u8) (temp_r1_3->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTaunt;\n var_r6 += 1;\n }\n }\n if ((GetImprisonedMovesCount(gActiveBattler, temp_r5) << 0x18) != 0) {\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace;\n temp_r1_4 = &gProtectStructs[gActiveBattler];\n temp_r1_4->unk2 = (u8) (temp_r1_4->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMove;\n var_r6 += 1;\n }\n }\n temp_r1_5 = (0x58 * gActiveBattler) + gBattleMons;\n if (temp_r1_5->unk2E == 0xAF) {\n var_r4 = gEnigmaBerries[gActiveBattler].holdEffect;\n } else {\n var_r4 = GetItemHoldEffect(temp_r1_5->unk2E);\n }\n gPotentialItemEffectBattler = gActiveBattler;\n if (var_r4 == 0x1D) {\n temp_r1_6 = *temp_r8;\n if ((temp_r1_6 != 0) && (temp_r1_6 != 0xFFFF) && (temp_r1_6 != temp_r5)) {\n gCurrentMove = temp_r1_6;\n gLastUsedItem = ((0x58 * gActiveBattler) + gBattleMons)->unk2E;\n if (gBattleTypeFlags & 0x20000) {\n temp_r1_7 = &gProtectStructs[gActiveBattler];\n temp_r1_7->unk2 = (u8) (temp_r1_7->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveChoiceItem;\n var_r6 += 1;\n }\n }\n }\n if (gBattleMons->pp[(0x58 * gActiveBattler) + *((gActiveBattler << 9) + &gBattleBufferB[0][2])] == 0) {\n if (gBattleTypeFlags & 0x20000) {\n temp_r1_8 = &gProtectStructs[gActiveBattler];\n temp_r1_8->unk2 = (u8) (temp_r1_8->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingMoveWithNoPP;\n var_r6 += 1;\n }\n }\n return var_r6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":93,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:7056: structure has no member named `unk2'","/c.c:7067: structure has no member named `unk2'","/c.c:7073: structure has no member named `unk13'","/c.c:7078: structure has no member named `unk2'","/c.c:7089: structure has no member named `unk2'"]},"gapSize":{"decompiler":"asmlift","score":303,"maxScore":435,"ratio":0.696551724137931,"kinds":{"insert":46,"delete":53,"replace":37,"opMismatch":10,"argMismatch":157}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TrySetCantSelectMoveBattleScript` — benchmark function pokeemerald:TrySetCantSelectMoveBattleScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\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-78a6659be413.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 TrySetCantSelectMoveBattleScript(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TrySetCantSelectMoveBattleScript # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TrySetCantSelectMoveBattleScript` — benchmark function pokeemerald:TrySetCantSelectMoveBattleScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:TrySetCantSelectMoveBattleScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TrySetCantSelectMoveBattleScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:UpdateShoalTideFlag:agbcc","sym":"UpdateShoalTideFlag","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["table","array","branch","global","call"],"loc":39,"refSource":"void UpdateShoalTideFlag(void)\n{\n static const u8 tide[] =\n {\n 1, // 00\n 1, // 01\n 1, // 02\n 0, // 03\n 0, // 04\n 0, // 05\n 0, // 06\n 0, // 07\n 0, // 08\n 1, // 09\n 1, // 10\n 1, // 11\n 1, // 12\n 1, // 13\n 1, // 14\n 0, // 15\n 0, // 16\n 0, // 17\n 0, // 18\n 0, // 19\n 0, // 20\n 1, // 21\n 1, // 22\n 1, // 23\n };\n\n if (IsMapTypeOutdoors(GetLastUsedWarpMapType()))\n {\n RtcCalcLocalTime();\n if (tide[gLocalTime.hours])\n FlagSet(FLAG_SYS_SHOAL_TIDE);\n else\n FlagClear(FLAG_SYS_SHOAL_TIDE);\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/time_events.c#L54-L92","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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-4f862b3e7af0.i.gz","proto":{"UpdateShoalTideFlag":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateShoalTideFlag' — lift: cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.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 tide.3,object */\n/* tide.3: */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tUpdateShoalTideFlag */\n/* \t.type\t UpdateShoalTideFlag,function */\n/* \t.thumb_func */\n/* UpdateShoalTideFlag: */\n/* \tpush\t{lr} */\n/* \tbl\tGetLastUsedWarpMapType */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tbl\tIsMapTypeOutdoors */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tbl\tRtcCalcLocalTime */\n/* \tldr\tr1, .L6 */\n/* \tldr\tr0, .L6+0x4 */\n/* \tldrb\tr0, [r0, #0x2] */\n/* \tlsl\tr0, r0, #24 */\n/* \tasr\tr0, r0, #24 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldr\tr0, .L6+0x8 */\n/* \tbl\tFlagSet */\n/* \tb\t.L3 */\n/* .L7: */\n/* \t.align\t2, 0 */\n/* .L6: */\n/* \t.word\ttide.3 */\n/* \t.word\tgLocalTime */\n/* \t.word\t0x89a */\n/* .L4: */\n/* \tldr\tr0, .L8 */\n/* \tbl\tFlagClear */\n/* .L3: */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\t0x89a */\n/* .Lfe1: */\n/* \t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateShoalTideFlag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.byte) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":82,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.byte) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"static ? tide.3; /* unable to generate initializer: unknown type; const */\n\nvoid UpdateShoalTideFlag(void) {\n if ((IsMapTypeOutdoors(GetLastUsedWarpMapType()) << 0x18) != 0) {\n RtcCalcLocalTime();\n if (*((s8) (u8) gLocalTime.hours + &tide.3) != 0) {\n FlagSet(0x89AU);\n return;\n }\n FlagClear(0x89AU);\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":11,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateShoalTideFlag` — benchmark function pokeemerald:UpdateShoalTideFlag:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\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-4f862b3e7af0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateShoalTideFlag(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateShoalTideFlag # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateShoalTideFlag` — benchmark function pokeemerald:UpdateShoalTideFlag:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateShoalTideFlag:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\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 \"UpdateShoalTideFlag\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateShoalTideFlag # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","bitwise","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","sizeof","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["struct","field","pointer","branch","loop","sizeof","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","branch","global","loop","shift","bitwise","call","mmio"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","cast","struct","loop","sizeof"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","branch","loop","shift","bitwise"],"loc":15,"refSource":"void numToASCII(u8 digits[5], u16 number)\n{\n u8 i;\n\n for (i = 0; i < 4; number <<= 4, i++) {\n u16 value = ((number & 0xF000) >> 12);\n if (value > 9) {\n digits[i] = value + 87;\n } else {\n digits[i] = value + '0';\n }\n }\n\n digits[i] = 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\n","proto":{"numToASCII":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((u32)(v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = (u32)(v0 << 20) >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n","score":12,"maxScore":31,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10},"quality":{"score":84,"lines":22,"gotos":0,"casts":9,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void numToASCII(s32 arg0, u16 arg1) {\n s8 *var_r1;\n s8 var_r0;\n u16 var_r3;\n u32 temp_r0;\n u8 var_r2;\n\n var_r3 = arg1;\n var_r2 = 0;\n do {\n temp_r0 = (u32) (var_r3 & 0xF000) >> 0xC;\n if (temp_r0 > 9U) {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x57;\n } else {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x30;\n }\n *var_r1 = var_r0;\n var_r3 *= 0x10;\n var_r2 += 1;\n } while ((u32) var_r2 <= 3U);\n *(arg0 + var_r2) = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":23,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: warning: assignment makes pointer from integer without a cast","/c.c:322: warning: assignment makes pointer from integer without a cast","/c.c:329: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":12,"maxScore":31,"ratio":0.3870967741935484,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","union","bitfield"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:PackSaveSector:agbcc","sym":"PackSaveSector","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","memory","switch","loop","nested-loop","call","comparison-tree"],"loc":117,"refSource":"void PackSaveSector(SaveSectorData *sector, SaveGame *save)\n{\n s16 i;\n s16 j;\n s16 k;\n\n sector->header.magicNumber = 0x47544E4C;\n sector->header.sectorId += 1;\n sector->playerId = save->playerId;\n\n for (i = 0; i < 6; i++) {\n sector->playerName[i] = save->playerName[i];\n }\n\n sector->unk18 = 0;\n sector->unlockedCharacters = save->unlockedCharacters;\n sector->unlockedZones = save->unlockedZones;\n sector->continueZone = save->continueZone;\n sector->unk1C = 0;\n\n for (i = 0; i < 7; i++) {\n sector->chaoCount[i] = save->chaoCount[i];\n }\n\n for (i = 0; i < 7; i++) {\n sector->specialKeys[i] = save->specialKeys[i];\n }\n\n for (i = 0; i < 9; i++) {\n sector->unlockedStages[i] = save->unlockedStages[i];\n }\n\n for (i = 0; i < 9; i++) {\n for (j = 0; j < 4; j++) {\n sector->collectedMedals[i][j] = save->collectedMedals[i][j];\n }\n }\n\n sector->collectedEmeralds = save->collectedEmeralds;\n sector->unk62 = save->unk34;\n sector->unlockFlags = save->unlockFlags;\n sector->vsWins = save->vsWins;\n sector->vsDraws = save->vsDraws;\n sector->vsLosses = save->vsLosses;\n sector->unk67 = 0;\n\n for (i = 0; i < 10; i++) {\n sector->vsRecords[i].slotFilled = save->vsRecords[i].slotFilled;\n sector->vsRecords[i].wins = save->vsRecords[i].wins;\n sector->vsRecords[i].draws = save->vsRecords[i].draws;\n sector->vsRecords[i].losses = save->vsRecords[i].losses;\n\n sector->vsRecords[i].playerId = save->vsRecords[i].playerId;\n\n for (j = 0; j < 6; j++) {\n sector->vsRecords[i].playerName[j] = save->vsRecords[i].playerName[j];\n }\n }\n\n#define Zone i\n#define Act j\n#define Rank k\n for (Zone = 0; Zone < (s32)ARRAY_COUNT(save->timeRecords.table); Zone++) {\n for (Act = 0; Act < (s32)ARRAY_COUNT(save->timeRecords.table[0]); Act++) {\n for (Rank = 0; Rank < (s32)ARRAY_COUNT(save->timeRecords.table[0][0]); Rank++) {\n sector->timeRecords.table[Zone][Act][Rank].character1 = save->timeRecords.table[Zone][Act][Rank].character1;\n sector->timeRecords.table[Zone][Act][Rank].character2 = save->timeRecords.table[Zone][Act][Rank].character2;\n sector->timeRecords.table[Zone][Act][Rank].time = save->timeRecords.table[Zone][Act][Rank].time;\n }\n }\n }\n#undef Rank\n#undef Act\n#undef Zone\n\n switch (save->buttonConfig.jump) {\n case A_BUTTON:\n sector->buttonConfig.jump = 1;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 1;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 1;\n break;\n }\n\n switch (save->buttonConfig.attack) {\n case A_BUTTON:\n sector->buttonConfig.jump = 2;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 2;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 2;\n break;\n }\n\n switch (save->buttonConfig.trick) {\n case A_BUTTON:\n sector->buttonConfig.jump = 4;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 4;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 4;\n break;\n }\n\n sector->difficulty = save->difficulty;\n sector->disableTimeLimit = save->disableTimeLimit;\n sector->language = save->language;\n sector->unk367 = 0;\n sector->checksum = GetSaveSectorChecksum(sector);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L440-L556","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","proto":{"PackSaveSector":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'PackSaveSector' — lift: cannot lift 'PackSaveSector': 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\tPackSaveSector */\n/* \t.type\t PackSaveSector,function */\n/* \t.thumb_func */\n/* PackSaveSector: */\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, #-0x4c */\n/* \tadd\tr6, r0, #0 */\n/* \tmov\tr9, r1 */\n/* \tldr\tr0, .L82 */\n/* \tstr\tr0, [r6] */\n/* \tldr\tr0, [r6, #0x4] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstr\tr0, [r6, #0x4] */\n/* \tmov\tr3, r9 */\n/* \tldmia\tr3!, {r0} */\n/* \tstr\tr0, [r6, #0x8] */\n/* \tmov\tr5, #0x0 */\n/* \tadd\tr4, r6, #0 */\n/* \tadd\tr4, r4, #0xc */\n/* .L6: */\n/* \tlsl\tr1, r5, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x0 */\n/* \tstrb\tr1, [r6, #0x18] */\n/* \tmov\tr2, r9 */\n/* \tldrb\tr0, [r2, #0x10] */\n/* \tstrb\tr0, [r6, #0x19] */\n/* \tldrb\tr0, [r2, #0x11] */\n/* \tstrb\tr0, [r6, #0x1a] */\n/* \tldrb\tr0, [r2, #0x12] */\n/* \tstrb\tr0, [r6, #0x1b] */\n/* \tstrb\tr1, [r6, #0x1c] */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr3, #0x2c */\n/* \tadd\tr3, r3, r6 */\n/* \tmov\tr8, r3 */\n/* \tmov\tr7, r9 */\n/* \tadd\tr7, r7, #0x22 */\n/* \tmov\tr0, #0x33 */\n/* \tadd\tr0, r0, r6 */\n/* \tmov\tip, r0 */\n/* \tmov\tr1, #0x29 */\n/* \tadd\tr1, r1, r9 */\n/* \tmov\tsl, r1 */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x3e */\n/* \tstr\tr2, [sp, #0x48] */\n/* \tmov\tr3, r9 */\n/* \tadd\tr3, r3, #0x37 */\n/* \tstr\tr3, [sp, #0x3c] */\n/* \tmov\tr0, r9 */\n/* \tadd\tr0, r0, #0x32 */\n/* \tstr\tr0, [sp, #0x34] */\n/* \tadd\tr1, r6, #0 */\n/* \tadd\tr1, r1, #0x3c */\n/* \tstr\tr1, [sp, #0x40] */\n/* \tmov\tr2, r9 */\n/* \tldrh\tr3, [r2, #0x34] */\n/* \tmov\tr2, sp */\n/* \tstrh\tr3, [r2, #0x30] */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x62 */\n/* \tstr\tr0, [sp, #0x4] */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x33 */\n/* \tstr\tr1, [sp, #0x38] */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x3d */\n/* \tstr\tr2, [sp, #0x44] */\n/* \tmov\tr3, r9 */\n/* \tadd\tr3, r3, #0x60 */\n/* \tstr\tr3, [sp] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstr\tr0, [sp, #0x10] */\n/* \tadd\tr1, r1, #0x2f */\n/* \tstr\tr1, [sp, #0xc] */\n/* \tadd\tr2, r2, #0x28 */\n/* \tstr\tr2, [sp, #0x14] */\n/* \tadd\tr3, r3, #0x1 */\n/* \tstr\tr3, [sp, #0x8] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstr\tr0, [sp, #0x1c] */\n/* \tadd\tr1, r6, #0 */\n/* \tadd\tr1, r1, #0x67 */\n/* \tstr\tr1, [sp, #0x20] */\n/* \tadd\tr2, r2, #0x7 */\n/* \tstr\tr2, [sp, #0x28] */\n/* \tadd\tr3, r3, #0x3 */\n/* \tstr\tr3, [sp, #0x18] */\n/* \tadd\tr0, r0, #0xa */\n/* \tstr\tr0, [sp, #0x2c] */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x68 */\n/* \tstr\tr1, [sp, #0x24] */\n/* \tadd\tr4, r6, #0 */\n/* \tadd\tr4, r4, #0x1e */\n/* \tsub\tr3, r3, #0x50 */\n/* .L11: */\n/* \tlsl\tr1, r5, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x6 */\n/* \tble\t.L11\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr4, r8 */\n/* \tadd\tr3, r7, #0 */\n/* .L16: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x6 */\n/* \tble\t.L16\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr4, ip */\n/* \tmov\tr3, sl */\n/* .L21: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x8 */\n/* \tble\t.L21\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr2, [sp, #0x48] */\n/* \tmov\tip, r2 */\n/* \tldr\tr3, [sp, #0x3c] */\n/* \tmov\tr8, r3 */\n/* .L26: */\n/* \tmov\tr3, #0x0 */\n/* \tlsl\tr7, r5, #0x10 */\n/* \tasr\tr4, r7, #0xe */\n/* .L30: */\n/* \tlsl\tr0, r3, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr1, r0, r4 */\n/* \tmov\tr3, ip */\n/* \tadd\tr2, r3, r1 */\n/* \tadd\tr1, r1, r8 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x3 */\n/* \tble\t.L30\t@cond_branch */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x9 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x8 */\n/* \tble\t.L26\t@cond_branch */\n/* \tldr\tr2, [sp, #0x34] */\n/* \tldrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x40] */\n/* \tstrb\tr0, [r3] */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tr0, sp */\n/* \tldrh\tr2, [r0, #0x30] */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tstrh\tr2, [r0] */\n/* \tldr\tr3, [sp, #0x38] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x44] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x10] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0xc] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x14] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x8] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x1c] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x20] */\n/* \tstrb\tr1, [r3] */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr0, [sp, #0x2c] */\n/* \tmov\tr8, r0 */\n/* \tldr\tr7, [sp, #0x24] */\n/* .L36: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr2, r2, r0 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr1, r6, r2 */\n/* \tmov\tip, r1 */\n/* \tmov\tr0, r9 */\n/* \tadd\tr3, r0, r2 */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x74 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x68 */\n/* \tstrb\tr1, [r0] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x75 */\n/* \tldrb\tr0, [r0] */\n/* \tmov\tr1, ip */\n/* \tadd\tr1, r1, #0x69 */\n/* \tstrb\tr0, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x77 */\n/* \tldrb\tr0, [r0] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tstrb\tr0, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x76 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x6b */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr3, [sp, #0x28] */\n/* \tadd\tr1, r3, r2 */\n/* \tldr\tr3, [sp, #0x18] */\n/* \tadd\tr0, r3, r2 */\n/* \tldr\tr0, [r0] */\n/* \tstr\tr0, [r1] */\n/* \tmov\tr3, #0x0 */\n/* \tadd\tr4, r2, #0 */\n/* .L40: */\n/* \tlsl\tr1, r3, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tmov\tr3, r8 */\n/* \tadd\tr2, r3, r0 */\n/* \tadd\tr0, r7, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr3, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L40\t@cond_branch */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x9 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x9 */\n/* \tble\t.L36\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* .L46: */\n/* \tmov\tr3, #0x0 */\n/* \tlsl\tr7, r5, #0x10 */\n/* \tasr\tr1, r7, #0x10 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tmov\tsl, r0 */\n/* .L50: */\n/* \tmov\tr4, #0x0 */\n/* \tlsl\tr5, r3, #0x10 */\n/* \tasr\tr1, r5, #0x10 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tmov\tr8, r0 */\n/* .L54: */\n/* \tlsl\tr2, r4, #0x10 */\n/* \tasr\tr2, r2, #0x10 */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, sl */\n/* \tadd\tr3, r6, r0 */\n/* \tmov\tip, r3 */\n/* \tmov\tr1, r9 */\n/* \tadd\tr3, r1, r0 */\n/* \tmov\tr1, #0x96 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x98 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, ip */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr1, .L82+0x4 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tadd\tr1, r1, #0x4 */\n/* \tadd\tr1, r1, ip */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr1, #0x97 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrh\tr0, [r0] */\n/* \tadd\tr1, r1, #0x4 */\n/* \tadd\tr1, r1, ip */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r2, #0x1 */\n/* \tlsl\tr2, r2, #0x10 */\n/* \tlsr\tr4, r2, #0x10 */\n/* \tasr\tr2, r2, #0x10 */\n/* \tcmp\tr2, #0x4 */\n/* \tble\t.L54\t@cond_branch */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x9 */\n/* \tadd\tr0, r5, r2 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x3 */\n/* \tble\t.L50\t@cond_branch */\n/* \tadd\tr0, r7, r2 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x6 */\n/* \tble\t.L46\t@cond_branch */\n/* \tmov\tr0, #0xd7 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L60\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L64\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L59\t@cond_branch */\n/* \tb\t.L58 */\n/* .L83: */\n/* \t.align\t2, 0 */\n/* .L82: */\n/* \t.word\t0x47544e4c */\n/* \t.word\t0x12d */\n/* .L64: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L61\t@cond_branch */\n/* \tb\t.L58 */\n/* .L59: */\n/* \tmov\tr3, #0xd8 */\n/* \tlsl\tr3, r3, #0x2 */\n/* \tadd\tr0, r6, r3 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L58 */\n/* .L60: */\n/* \tldr\tr0, .L84 */\n/* \tadd\tr1, r6, r0 */\n/* \tb\t.L79 */\n/* .L85: */\n/* \t.align\t2, 0 */\n/* .L84: */\n/* \t.word\t0x361 */\n/* .L61: */\n/* \tldr\tr2, .L86 */\n/* \tadd\tr1, r6, r2 */\n/* .L79: */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r1] */\n/* .L58: */\n/* \tldr\tr0, .L86+0x4 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L67\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L71\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L66\t@cond_branch */\n/* \tb\t.L65 */\n/* .L87: */\n/* \t.align\t2, 0 */\n/* .L86: */\n/* \t.word\t0x362 */\n/* \t.word\t0x35e */\n/* .L71: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L68\t@cond_branch */\n/* \tb\t.L65 */\n/* .L66: */\n/* \tmov\tr3, #0xd8 */\n/* \tlsl\tr3, r3, #0x2 */\n/* \tb\t.L80 */\n/* .L67: */\n/* \tldr\tr2, .L88 */\n/* \tadd\tr0, r6, r2 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L65 */\n/* .L89: */\n/* \t.align\t2, 0 */\n/* .L88: */\n/* \t.word\t0x361 */\n/* .L68: */\n/* \tldr\tr3, .L90 */\n/* .L80: */\n/* \tadd\tr1, r6, r3 */\n/* \tmov\tr0, #0x2 */\n/* \tstrb\tr0, [r1] */\n/* .L65: */\n/* \tmov\tr2, #0xd8 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L74\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L78\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L73\t@cond_branch */\n/* \tb\t.L72 */\n/* .L91: */\n/* \t.align\t2, 0 */\n/* .L90: */\n/* \t.word\t0x362 */\n/* .L78: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L75\t@cond_branch */\n/* \tb\t.L72 */\n/* .L73: */\n/* \tadd\tr1, r6, r2 */\n/* \tb\t.L81 */\n/* .L74: */\n/* \tldr\tr2, .L92 */\n/* \tadd\tr1, r6, r2 */\n/* \tb\t.L81 */\n/* .L93: */\n/* \t.align\t2, 0 */\n/* .L92: */\n/* \t.word\t0x361 */\n/* .L75: */\n/* \tldr\tr3, .L94 */\n/* \tadd\tr1, r6, r3 */\n/* .L81: */\n/* \tmov\tr0, #0x4 */\n/* \tstrb\tr0, [r1] */\n/* .L72: */\n/* \tmov\tr0, #0xd9 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tmov\tr2, r9 */\n/* \tadd\tr1, r2, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tmov\tr2, #0x0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr0, .L94+0x4 */\n/* \tmov\tr3, r9 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr0, .L94+0x8 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr1, .L94+0xc */\n/* \tadd\tr0, r6, r1 */\n/* \tstrb\tr2, [r0] */\n/* \tadd\tr0, r6, #0 */\n/* \tbl\tGetSaveSectorChecksum */\n/* \tmov\tr2, #0xda */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr1, r6, r2 */\n/* \tstr\tr0, [r1] */\n/* \tadd\tsp, sp, #0x4c */\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/* .L95: */\n/* \t.align\t2, 0 */\n/* .L94: */\n/* \t.word\t0x362 */\n/* \t.word\t0x365 */\n/* \t.word\t0x366 */\n/* \t.word\t0x367 */\n/* .Lfe1: */\n/* \t.size\t PackSaveSector,.Lfe1-PackSaveSector */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid PackSaveSector(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'PackSaveSector': 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":534,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'PackSaveSector': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 GetSaveSectorChecksum(void *); /* extern */\n\nvoid PackSaveSector(void *arg0, void *arg1, s8 *arg4, void *arg5, void *arg6, void *arg7, u8 *arg9, u8 *argA, void *argB, u8 *argC, u8 *argD, void *argE) {\n s16 temp_r0_11;\n s16 temp_r0_7;\n s16 temp_r0_9;\n s16 temp_r1_2;\n s16 temp_r1_5;\n s16 temp_r1_8;\n s16 temp_r2_4;\n s16 var_r3;\n s16 var_r3_2;\n s16 var_r3_3;\n s16 var_r4;\n s16 var_r5;\n s16 var_r5_2;\n s16 var_r5_3;\n s16 var_r5_4;\n s16 var_r5_6;\n s16 var_r5_7;\n s32 temp_r0;\n s32 temp_r0_14;\n s32 temp_r0_16;\n s32 temp_r0_5;\n s32 temp_r1_6;\n s32 temp_r2_3;\n s32 var_r3_4;\n s8 *var_r1;\n s8 *var_r1_2;\n u16 temp_r0_12;\n u16 temp_r0_6;\n u16 temp_r0_8;\n u16 temp_r1;\n u16 temp_r1_10;\n u16 temp_r1_11;\n u16 temp_r1_12;\n u16 temp_r1_4;\n u16 temp_r1_9;\n u16 temp_r2_5;\n u32 temp_r0_10;\n u32 temp_r0_13;\n u32 temp_r0_15;\n u32 temp_r0_17;\n u32 var_r5_5;\n u8 *temp_r1_3;\n u8 *temp_r2;\n void *temp_r0_2;\n void *temp_r0_3;\n void *temp_r0_4;\n void *temp_r1_7;\n void *temp_r2_2;\n void *temp_r3;\n void *temp_r3_2;\n void *temp_r3_3;\n void *temp_r3_4;\n void *temp_r3_5;\n void *temp_r3_6;\n\n arg0->unk0 = 0x47544E4C;\n arg0->unk4 = (s32) (arg0->unk4 + 1);\n arg0->unk8 = (s32) arg1->unk0;\n var_r5 = 0;\n do {\n temp_r1_2 = var_r5;\n temp_r0 = temp_r1_2 * 2;\n *(arg0 + 0xC + temp_r0) = *(arg1 + 4 + temp_r0);\n temp_r1 = temp_r1_2 + 1;\n var_r5 = (s16) temp_r1;\n } while ((s32) (s16) temp_r1 <= 5);\n arg0->unk18 = 0;\n arg0->unk19 = (u8) arg1->unk10;\n arg0->unk1A = (u8) arg1->unk11;\n arg0->unk1B = (u8) arg1->unk12;\n arg0->unk1C = 0;\n var_r5_2 = 0;\n argE = arg0 + 0x3E;\n argB = arg1 + 0x37;\n arg9 = arg1 + 0x32;\n argC = arg0 + 0x3C;\n unksp0.unk30 = (u16) arg1->unk34;\n temp_r0_2 = arg0 + 0x62;\n unksp4 = temp_r0_2;\n temp_r1_3 = arg1 + 0x33;\n argA = temp_r1_3;\n temp_r2 = arg0 + 0x3D;\n argD = temp_r2;\n temp_r3 = arg1 + 0x60;\n unksp0 = temp_r3;\n temp_r0_3 = temp_r0_2 + 2;\n unksp10 = temp_r0_3;\n unkspC = temp_r1_3 + 0x2F;\n temp_r2_2 = temp_r2 + 0x28;\n unksp14 = temp_r2_2;\n temp_r3_2 = temp_r3 + 1;\n unksp8 = temp_r3_2;\n temp_r0_4 = temp_r0_3 + 2;\n unksp1C = temp_r0_4;\n arg4 = arg0 + 0x67;\n arg6 = temp_r2_2 + 7;\n temp_r3_3 = temp_r3_2 + 3;\n unksp18 = temp_r3_3;\n arg7 = temp_r0_4 + 0xA;\n arg5 = arg1 + 0x68;\n do {\n temp_r1_5 = var_r5_2;\n temp_r0_5 = temp_r1_5 * 2;\n *(arg0 + 0x1E + temp_r0_5) = *((temp_r3_3 - 0x50) + temp_r0_5);\n temp_r1_4 = temp_r1_5 + 1;\n var_r5_2 = (s16) temp_r1_4;\n } while ((s32) (s16) temp_r1_4 <= 6);\n var_r5_3 = 0;\n do {\n temp_r0_7 = var_r5_3;\n *(arg0 + 0x2C + temp_r0_7) = *(arg1 + 0x22 + temp_r0_7);\n temp_r0_6 = temp_r0_7 + 1;\n var_r5_3 = (s16) temp_r0_6;\n } while ((s32) (s16) temp_r0_6 <= 6);\n var_r5_4 = 0;\n do {\n temp_r0_9 = var_r5_4;\n *(arg0 + 0x33 + temp_r0_9) = *(arg1 + 0x29 + temp_r0_9);\n temp_r0_8 = temp_r0_9 + 1;\n var_r5_4 = (s16) temp_r0_8;\n } while ((s32) (s16) temp_r0_8 <= 8);\n var_r5_5 = 0;\n do {\n var_r3 = 0;\nloop_10:\n temp_r0_11 = var_r3;\n temp_r1_6 = temp_r0_11 + ((s32) (var_r5_5 << 0x10) >> 0xE);\n *(argE + temp_r1_6) = *(temp_r1_6 + argB);\n temp_r0_12 = temp_r0_11 + 1;\n var_r3 = (s16) temp_r0_12;\n if ((s32) (s16) temp_r0_12 <= 3) {\n goto loop_10;\n }\n temp_r0_10 = (var_r5_5 << 0x10) + 0x10000;\n var_r5_5 = temp_r0_10 >> 0x10;\n } while ((s32) ((s32) temp_r0_10 >> 0x10) <= 8);\n *argC = *arg9;\n *unksp4 = unksp0.unk30;\n *argD = *argA;\n *unksp10 = *unksp0;\n *unksp14 = *unkspC;\n *unksp1C = *unksp8;\n *arg4 = 0;\n var_r5_6 = 0;\n do {\n temp_r2_3 = var_r5_6 * 0x14;\n temp_r1_7 = arg0 + temp_r2_3;\n temp_r3_4 = arg1 + temp_r2_3;\n temp_r1_7->unk68 = (u8) temp_r3_4->unk74;\n temp_r1_7->unk69 = (u8) temp_r3_4->unk75;\n (temp_r1_7 + 0x69)->unk1 = (u8) temp_r3_4->unk77;\n temp_r1_7->unk6B = (u8) temp_r3_4->unk76;\n *(arg6 + temp_r2_3) = *(unksp18 + temp_r2_3);\n var_r3_2 = 0;\nloop_14:\n temp_r1_8 = var_r3_2;\n temp_r0_14 = (temp_r1_8 * 2) + temp_r2_3;\n *(arg7 + temp_r0_14) = *(arg5 + temp_r0_14);\n temp_r1_9 = temp_r1_8 + 1;\n var_r3_2 = (s16) temp_r1_9;\n if ((s32) (s16) temp_r1_9 <= 5) {\n goto loop_14;\n }\n temp_r0_13 = (var_r5_6 << 0x10) + 0x10000;\n var_r5_6 = (s16) (temp_r0_13 >> 0x10);\n } while ((s32) ((s32) temp_r0_13 >> 0x10) <= 9);\n var_r5_7 = 0;\n do {\n var_r3_3 = 0;\nloop_18:\n var_r4 = 0;\nloop_19:\n temp_r2_4 = var_r4;\n temp_r0_16 = (temp_r2_4 * 4) + (var_r3_3 * 0x14) + (var_r5_7 * 0x50);\n temp_r3_5 = arg0 + temp_r0_16;\n temp_r3_6 = arg1 + temp_r0_16;\n temp_r3_5->unk130 = (u8) temp_r3_6->unk12C;\n temp_r3_5->unk131 = (u8) temp_r3_6->unk12D;\n temp_r3_5->unk132 = (u16) temp_r3_6->unk12E;\n temp_r2_5 = temp_r2_4 + 1;\n var_r4 = (s16) temp_r2_5;\n if ((s32) (s16) temp_r2_5 <= 4) {\n goto loop_19;\n }\n temp_r0_17 = (var_r3_3 << 0x10) + 0x10000;\n var_r3_3 = (s16) (temp_r0_17 >> 0x10);\n if ((s32) ((s32) temp_r0_17 >> 0x10) <= 3) {\n goto loop_18;\n }\n temp_r0_15 = (var_r5_7 << 0x10) + 0x10000;\n var_r5_7 = (s16) (temp_r0_15 >> 0x10);\n } while ((s32) ((s32) temp_r0_15 >> 0x10) <= 6);\n temp_r1_10 = arg1->unk35C;\n switch (temp_r1_10) { /* switch 1; irregular */\n case 0x1: /* switch 1 */\n arg0->unk360 = (s8) temp_r1_10;\n break;\n case 0x2: /* switch 1 */\n var_r1 = arg0 + 0x361;\nblock_31:\n *var_r1 = 1;\n break;\n case 0x100: /* switch 1 */\n var_r1 = arg0 + 0x362;\n goto block_31;\n }\n temp_r1_11 = arg1->unk35E;\n switch (temp_r1_11) { /* switch 2; irregular */\n case 0x1: /* switch 2 */\n var_r3_4 = 0x360;\nblock_41:\n *(arg0 + var_r3_4) = 2;\n break;\n case 0x2: /* switch 2 */\n arg0->unk361 = (s8) temp_r1_11;\n break;\n case 0x100: /* switch 2 */\n var_r3_4 = 0x362;\n goto block_41;\n }\n temp_r1_12 = arg1->unk360;\n switch (temp_r1_12) { /* switch 3; irregular */\n case 0x1: /* switch 3 */\n var_r1_2 = arg0 + 0x360;\nblock_51:\n *var_r1_2 = 4;\n break;\n case 0x2: /* switch 3 */\n var_r1_2 = arg0 + 0x361;\n goto block_51;\n case 0x100: /* switch 3 */\n var_r1_2 = arg0 + 0x362;\n goto block_51;\n }\n arg0->unk364 = (u8) arg1->unk364;\n arg0->unk365 = (u8) arg1->unk365;\n arg0->unk366 = (u8) arg1->unk366;\n arg0->unk367 = 0;\n arg0->unk368 = GetSaveSectorChecksum(arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":241,"gotos":8,"casts":52,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1876: warning: dereferencing `void *' pointer","/c.c:1876: request for member `unk0' in something not a structure or union","/c.c:1877: warning: dereferencing `void *' pointer","/c.c:1877: request for member `unk4' in something not a structure or union","/c.c:1878: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PackSaveSector` — benchmark function sa3:PackSaveSector:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\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 PackSaveSector # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PackSaveSector` — benchmark function sa3:PackSaveSector:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:PackSaveSector:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"PackSaveSector\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PackSaveSector # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","union","bitfield","field","loop","nested-loop","sizeof","bitwise","call","mmio","dma"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","memory","sizeof","shift","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","cast","loop","bitwise","mmio","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","shift","bitwise","mmio","dma","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","arithmetic","loop","bitwise","mmio","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","bitwise"],"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/scopebase","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 v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = (s32)(*(s16 *)(a0 + 2) * v0) >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = (s32)(*(s16 *)(a0 + 4) * v2) >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n p0 = (u16 *)&gSineTable;\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":82,"maxScore":129,"compileErrors":null,"breakdown":{"insert":21,"delete":19,"replace":6,"opMismatch":3,"argMismatch":33},"quality":{"score":74,"lines":40,"gotos":0,"casts":7,"unkGlue":0,"rawMem":4,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_8083504(void *arg0, void *arg1, void *arg2) {\n s16 temp_r1;\n s16 temp_r1_2;\n s32 var_r0;\n s32 var_r3;\n s32 var_r4;\n u16 temp_r1_3;\n u16 temp_r1_4;\n\n temp_r1 = arg1->unk2;\n if (temp_r1 != 0x400) {\n var_r3 = (s32) (arg0->unk8 * temp_r1) >> 0xA;\n arg2->unk2 = (s16) ((s32) (arg0->unk2 * temp_r1) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n temp_r1_2 = arg1->unk4;\n if (temp_r1_2 != 0x400) {\n var_r4 = (s32) (arg0->unkC * temp_r1_2) >> 0xA;\n arg2->unk4 = (s16) ((s32) (arg0->unk4 * temp_r1_2) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n if (arg1->unk0 != 0) {\n temp_r1_3 = arg1->unk0;\n arg2->unk8 = (s32) (arg1->unk8 + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_3 + 0x100] << 0x10) >> 0x16)) >> 8) - ((s32) (((s32) ((u16) gSineTable[temp_r1_3] << 0x10) >> 0x16) * var_r4) >> 8)));\n temp_r1_4 = arg1->unk0;\n var_r0 = arg1->unkC + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_4] << 0x10) >> 0x16)) >> 8) + ((s32) (((s32) ((u16) gSineTable[temp_r1_4 + 0x100] << 0x10) >> 0x16) * var_r4) >> 8));\n } else {\n arg2->unk8 = (s32) (arg1->unk8 + var_r3);\n var_r0 = arg1->unkC + var_r4;\n }\n arg2->unkC = var_r0;\n arg2->unk0 = (s16) ((arg1->unk0 + arg0->unk0) & 0x3FF);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":21,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:330: warning: dereferencing `void *' pointer","/c.c:330: request for member `unk2' in something not a structure or union","/c.c:332: warning: dereferencing `void *' pointer","/c.c:332: request for member `unk8' in something not a structure or union","/c.c:333: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":82,"maxScore":129,"ratio":0.6356589147286822,"kinds":{"insert":21,"delete":19,"replace":6,"opMismatch":3,"argMismatch":33}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","bitwise"],"loc":14,"refSource":"s16 SA2_LABEL(sub_808558C)(u16 angleA, u16 angleB, u8 numDecimalBits)\n{\n u32 c1 = (1 << numDecimalBits);\n u16 c2 = c1 - 1;\n\n angleB -= angleA;\n angleB &= c2;\n\n if (angleB <= (c1 / 2)) {\n return angleB;\n } else {\n return (angleB - c1);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= (u32)(1 << (u8)a2) >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n","score":22,"maxScore":26,"compileErrors":null,"breakdown":{"insert":1,"delete":8,"replace":4,"opMismatch":1,"argMismatch":8},"quality":{"score":88,"lines":9,"gotos":0,"casts":15,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sa2__sub_808558C(u16 arg0, u16 arg1, u8 arg2) {\n s32 var_r0;\n u16 temp_r3;\n u32 temp_r4;\n\n temp_r4 = 1 << arg2;\n temp_r3 = (arg1 - arg0) & (temp_r4 - 1);\n if ((u32) temp_r3 > (u32) (temp_r4 >> 1)) {\n var_r0 = (temp_r3 - temp_r4) << 0x10;\n } else {\n var_r0 = temp_r3 << 0x10;\n }\n return var_r0 >> 0x10;\n}\n","score":16,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":25,"ratio":0.64,"kinds":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"loc":6,"refSource":"u32 SA2_LABEL(sub_80855C0)(s32 a, s32 b, s32 c, u8 d)\n{\n s64 e = (s64)c * (a - b);\n\n return a - (e >> d);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_80855C0(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n","score":31,"maxScore":38,"compileErrors":null,"breakdown":{"insert":12,"delete":7,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_80855C0(s32 arg0, s32 arg1, s32 arg2, u8 arg3) {\n s32 temp_r4;\n s32 temp_ret;\n\n temp_r4 = arg0 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r4, temp_r4 >> 0x1F);\n return arg0 - __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n}\n","score":20,"maxScore":28,"compileErrors":null,"breakdown":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":20,"maxScore":28,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["arithmetic","int64","do-while","loop","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadIntr:agbcc","sym":"Sio32MultiLoadIntr","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","branch","bitwise","mmio"],"loc":38,"refSource":"void Sio32MultiLoadIntr(void)\n{\n // Saves received data\n u32 recvTmp = REG_SIODATA32;\n // Slave prepares to receive\n if (gSio32MultiLoadArea.type != SIO_SCK_IN)\n REG_SIOCNT |= SIO_ENABLE;\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n REG_SIO32ML_TIMER_H = 0; // Stops timer\n // Process sending data\n if (gSio32MultiLoadArea.dataCounter < 0) // Sets synchronous data\n REG_SIODATA32 = SIO32ML_SYNC_DATA;\n else if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4) // Sets sending\n // data\n REG_SIODATA32 = gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter];\n else\n REG_SIODATA32 = gSio32MultiLoadArea.checkSum; // Sets check sum\n } else {\n // Process receiving data\n if (gSio32MultiLoadArea.dataCounter < 0) { // Checks synchronous data\n if (recvTmp != SIO32ML_SYNC_DATA)\n --gSio32MultiLoadArea.dataCounter;\n } else if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4) // Saves\n // receiving\n // data\n gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter] = recvTmp;\n else\n gSio32MultiLoadArea.checkSum = recvTmp; // Saves check sum\n }\n if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4 + 3) {\n ++gSio32MultiLoadArea.dataCounter;\n // Master starts to sending\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n REG_SIOCNT |= SIO_ENABLE; // Restarts sending\n REG_SIO32ML_TIMER_H = TIMER_1CLK | TIMER_INTR_ENABLE | TIMER_ENABLE; // Restarts timer\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sio32_multi_load.c#L97-L134","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-d92540a45b92.i.gz","proto":{"Sio32MultiLoadIntr":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSio32MultiLoadArea"},{"name":"REG_TM3CNT_H","shape":"scalar u16"}],"outcome":"nonmatch","source":"struct Struct0 { u8 field_0; s32 field_4; s32 field_8; s32 field_12; };\nvoid Sio32MultiLoadIntr(void) {\n s32 v0;\n v0 = *(s32 *)67109152;\n if (*(u8 *)&gSio32MultiLoadArea == 1) {\n REG_TM3CNT_H = 0;\n if (((s32 *)&gSio32MultiLoadArea)[2] >= 0) {\n if (((s32 *)&gSio32MultiLoadArea)[2] > 8191) {\n *(s32 *)67109152 = ((s32 *)&gSio32MultiLoadArea)[3];\n } else {\n *(s32 *)67109152 = ((s32 *)((s32 *)&gSio32MultiLoadArea)[1])[((s32 *)&gSio32MultiLoadArea)[2]];\n }\n } else {\n *(s32 *)67109152 = -16843010;\n }\n } else {\n *(u16 *)67109160 = *(u16 *)67109160 | 128;\n if (((s32 *)&gSio32MultiLoadArea)[2] >= 0) {\n if (((s32 *)&gSio32MultiLoadArea)[2] > 8191) {\n ((s32 *)&gSio32MultiLoadArea)[3] = v0;\n } else {\n ((s32 *)((s32 *)&gSio32MultiLoadArea)[1])[((s32 *)&gSio32MultiLoadArea)[2]] = v0;\n }\n } else {\n if (v0 != -16843010) ((s32 *)&gSio32MultiLoadArea)[2] = ((s32 *)&gSio32MultiLoadArea)[2] - 1;\n }\n }\n if (((s32 *)&gSio32MultiLoadArea)[2] <= 8194) {\n ((s32 *)&gSio32MultiLoadArea)[2] = ((s32 *)&gSio32MultiLoadArea)[2] + 1;\n if (*(u8 *)&gSio32MultiLoadArea == 1) {\n *(u16 *)67109160 = *(u16 *)67109160 | 128;\n REG_TM3CNT_H = 192;\n }\n }\n return;\n}\n","score":76,"maxScore":106,"compileErrors":null,"breakdown":{"insert":17,"delete":16,"replace":12,"opMismatch":5,"argMismatch":26},"quality":{"score":88,"lines":36,"gotos":0,"casts":28,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Sio32MultiLoadIntr(void) {\n u32 temp_r3;\n\n temp_r3 = *(u32 *)0x04000120;\n if (gSio32MultiLoadArea.type != 1) {\n *(u16 *)0x04000128 |= 0x80;\n if ((s32) gSio32MultiLoadArea.dataCounter < 0) {\n if (temp_r3 != 0xFEFEFEFE) {\n gSio32MultiLoadArea.dataCounter -= 1;\n }\n } else if ((s32) gSio32MultiLoadArea.dataCounter <= 0x1FFF) {\n gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter] = temp_r3;\n } else {\n gSio32MultiLoadArea.checkSum = temp_r3;\n }\n } else {\n *(s16 *)0x0400010E = 0;\n if ((s32) gSio32MultiLoadArea.dataCounter < 0) {\n *(u32 *)0x04000120 = 0xFEFEFEFE;\n } else if ((s32) gSio32MultiLoadArea.dataCounter <= 0x1FFF) {\n *(u32 *)0x04000120 = gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter];\n } else {\n *(u32 *)0x04000120 = gSio32MultiLoadArea.checkSum;\n }\n }\n if ((s32) gSio32MultiLoadArea.dataCounter <= 0x2002) {\n gSio32MultiLoadArea.dataCounter += 1;\n if (gSio32MultiLoadArea.type == 1) {\n *(void *)0x04000128 = (u16) (*(void *)0x04000128 | 0x80);\n *(void *)0x0400010E = 0xC0;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":32,"gotos":0,"casts":16,"unkGlue":0,"rawMem":0,"addrDeref":9},"errorMarkers":["agbcc failed: /c.c:409: warning: dereferencing `void *' pointer","/c.c:409: void value not ignored as it ought to be","/c.c:409: invalid use of void expression","/c.c:410: warning: dereferencing `void *' pointer","/c.c:410: invalid use of void expression"]},"gapSize":{"decompiler":"asmlift","score":76,"maxScore":106,"ratio":0.7169811320754716,"kinds":{"insert":17,"delete":16,"replace":12,"opMismatch":5,"argMismatch":26}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sio32MultiLoadIntr` — benchmark function sa3:Sio32MultiLoadIntr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\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-d92540a45b92.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid Sio32MultiLoadIntr(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sio32MultiLoadIntr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sio32MultiLoadIntr` — benchmark function sa3:Sio32MultiLoadIntr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadIntr:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\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 \"Sio32MultiLoadIntr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sio32MultiLoadIntr # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:Sio32MultiLoadMain:agbcc","sym":"Sio32MultiLoadMain","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","switch","loop","shift","bitwise","mmio","jump-table"],"loc":77,"refSource":"u32 Sio32MultiLoadMain(u32 *progressCounterp)\n{\n s32 dataCounter, dataCounterBak;\n UNUSED s32 i, ii; // declared in SDK\n\n switch (gSio32MultiLoadArea.state) {\n case 0:\n if (gSio32MultiLoadArea.type || gSio32MultiLoadArea.frameCounter) // Slave SIO Mode switch delay wait\n gSio32MultiLoadArea.state = 1;\n break;\n case 1:\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n if (gSio32MultiLoadArea.frameCounter < SIO32ML_MODE_WAIT_FRAMES) // Master wait\n break;\n } else // Slave\n REG_SIOCNT = SIO_32BIT_MODE; // Switches to SIO mode\n REG_SIODATA32 = 0; // Clears data registery\n REG_IF = INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG; // Resets IF\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) { // Sets Master\n REG_SIOCNT |= SIO_ENABLE; // Starts communication\n REG_SIO32ML_TIMER = SIO32ML_TIMER_COUNT | ((TIMER_1CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16); // Starts timer\n REG_IME = 0;\n REG_IE |= SIO32ML_TIMER_INTR_FLAG; // Enables timer interrupt\n REG_IME = 1;\n } else { // Sets Slave\n REG_SIOCNT |= SIO_INTR_ENABLE | SIO_ENABLE; // Starts communication\n REG_IME = 0;\n REG_IE |= INTR_FLAG_SERIAL; // Enables SIO interrupt\n REG_IME = 1;\n }\n gSio32MultiLoadArea.frameCounter = 0;\n gSio32MultiLoadArea.state = 2;\n break;\n case 2:\n dataCounter = gSio32MultiLoadArea.dataCounter;\n dataCounterBak = dataCounter;\n if (dataCounter > SIO32ML_BLOCK_SIZE / 4)\n dataCounter = SIO32ML_BLOCK_SIZE / 4;\n else if (dataCounter < 0)\n dataCounter = 0;\n if (progressCounterp)\n *progressCounterp = dataCounter; // Set progress counter\n if (gSio32MultiLoadArea.type != SIO_SCK_IN) { // Slave\n while (gSio32MultiLoadArea.checkSumCounter < dataCounter) // Receiving data sum check\n gSio32MultiLoadArea.checkSumTmp += ((s32 *)gSio32MultiLoadArea.datap)[gSio32MultiLoadArea.checkSumCounter++];\n if (dataCounterBak > SIO32ML_BLOCK_SIZE / 4)\n if ((gSio32MultiLoadArea.checkSum += gSio32MultiLoadArea.checkSumTmp) == -1)\n gSio32MultiLoadArea.downloadSuccessFlag = 1; // Succeeds download\n }\n if (dataCounterBak > SIO32ML_BLOCK_SIZE / 4 // Complete communication\n || gSio32MultiLoadArea.frameCounter == 0x8C) // SIO32ML_LD_TIMEOUT_FRAMES in SDK doesn't match\n gSio32MultiLoadArea.state = 3; // Load time out\n break;\n case 3:\n REG_IME = 0;\n REG_IE &= ~(INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG); // Disables SIO and timer interrupt\n REG_IME = 1;\n REG_SIOCNT = SIO_32BIT_MODE; // Stops SIO32\n *(vu32 *)REG_ADDR_SIOCNT = SIO_MULTI_MODE; // Switches to SIO mode\n *(vu32 *)REG_ADDR_SIOCNT = SIO_MULTI_MODE | MULTI_SIO_BAUD_RATE_NO;\n *(vu64 *)REG_ADDR_SIODATA32 = 0; // Clears data register\n if (gSio32MultiLoadArea.type) // Master\n REG_SIO32ML_TIMER = 0; // Resets timer\n REG_IF = INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG; // Resets IF\n if (!gSio32MultiLoadArea.type)\n return 1; // Slave comes back first\n gSio32MultiLoadArea.frameCounter = 0;\n gSio32MultiLoadArea.state = 4;\n break;\n case 4:\n if (gSio32MultiLoadArea.frameCounter >= 3) // Master comes back later\n return 1;\n break;\n }\n ++gSio32MultiLoadArea.frameCounter;\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sio32_multi_load.c#L15-L91","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Sio32MultiLoadMain' — lift: cannot lift 'Sio32MultiLoadMain': 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\tSio32MultiLoadMain */\n/* \t.type\t Sio32MultiLoadMain,function */\n/* \t.thumb_func */\n/* Sio32MultiLoadMain: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr2, r0, #0 */\n/* \tldr\tr0, .L36 */\n/* \tldrb\tr1, [r0, #0x1] */\n/* \tadd\tr5, r0, #0 */\n/* \tcmp\tr1, #0x4 */\n/* \tbls\t.LCB11 */\n/* \tb\t.L3\t@long jump */\n/* .LCB11: */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L36+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L37: */\n/* \t.align\t2, 0 */\n/* .L36: */\n/* \t.word\tgSio32MultiLoadArea */\n/* \t.word\t.L31 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L31: */\n/* \t.word\t.L4 */\n/* \t.word\t.L6 */\n/* \t.word\t.L12 */\n/* \t.word\t.L26 */\n/* \t.word\t.L29 */\n/* .L4: */\n/* \tldr\tr0, [r5] */\n/* \tldr\tr1, .L38 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB36 */\n/* \tb\t.L3\t@long jump */\n/* .LCB36: */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\t0xff00ff */\n/* .L6: */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0x1 */\n/* \tbne\t.L7\t@cond_branch */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x5 */\n/* \tbhi\t.LCB59 */\n/* \tb\t.L3\t@long jump */\n/* .LCB59: */\n/* \tb\t.L9 */\n/* .L7: */\n/* \tldr\tr1, .L40 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x5 */\n/* \tadd\tr0, r2, #0 */\n/* \tstrh\tr0, [r1] */\n/* .L9: */\n/* \tldr\tr0, .L40+0x4 */\n/* \tmov\tr6, #0x0 */\n/* \tstr\tr6, [r0] */\n/* \tldr\tr1, .L40+0x8 */\n/* \tmov\tr0, #0xc0 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr4, [r5] */\n/* \tcmp\tr4, #0x1 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tldr\tr2, .L40 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x80 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr1, .L40+0xc */\n/* \tldr\tr0, .L40+0x10 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr3, .L40+0x14 */\n/* \tstrh\tr6, [r3] */\n/* \tadd\tr2, r2, #0xd8 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x40 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tstrh\tr4, [r3] */\n/* \tb\t.L11 */\n/* .L41: */\n/* \t.align\t2, 0 */\n/* .L40: */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000120 */\n/* \t.word\t0x4000202 */\n/* \t.word\t0x400010c */\n/* \t.word\t0xc0f318 */\n/* \t.word\t0x4000208 */\n/* .L10: */\n/* \tldr\tr2, .L42 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr3, #0x81 */\n/* \tlsl\tr3, r3, #0x7 */\n/* \tadd\tr1, r3, #0 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr3, .L42+0x4 */\n/* \tstrh\tr6, [r3] */\n/* \tadd\tr2, r2, #0xd8 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x80 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tmov\tr0, #0x1 */\n/* \tstrh\tr0, [r3] */\n/* .L11: */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tmov\tr0, #0x2 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L43: */\n/* \t.align\t2, 0 */\n/* .L42: */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000208 */\n/* .L12: */\n/* \tldr\tr6, [r5, #0x8] */\n/* \tadd\tr4, r6, #0 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tble\t.L13\t@cond_branch */\n/* \tadd\tr4, r0, #0 */\n/* \tb\t.L14 */\n/* .L13: */\n/* \tcmp\tr6, #0 */\n/* \tbge\t.L14\t@cond_branch */\n/* \tmov\tr4, #0x0 */\n/* .L14: */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tstr\tr4, [r2] */\n/* .L16: */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0x1 */\n/* \tbeq\t.L17\t@cond_branch */\n/* \tldr\tr0, [r5, #0x14] */\n/* \tcmp\tr0, r4 */\n/* \tbge\t.L19\t@cond_branch */\n/* \tadd\tr3, r5, #0 */\n/* \tldr\tr7, [r5, #0x4] */\n/* .L20: */\n/* \tldr\tr2, [r3, #0x14] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r7 */\n/* \tldr\tr1, [r3, #0x10] */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr1, r1, r0 */\n/* \tstr\tr1, [r3, #0x10] */\n/* \tadd\tr2, r2, #0x1 */\n/* \tstr\tr2, [r3, #0x14] */\n/* \tcmp\tr2, r4 */\n/* \tblt\t.L20\t@cond_branch */\n/* .L19: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tble\t.L34\t@cond_branch */\n/* \tldr\tr0, [r5, #0xc] */\n/* \tldr\tr1, [r5, #0x10] */\n/* \tadd\tr0, r0, r1 */\n/* \tstr\tr0, [r5, #0xc] */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tcmp\tr0, r1 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r5, #0x3] */\n/* .L17: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tbgt\t.L25\t@cond_branch */\n/* .L34: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x8c */\n/* \tbne\t.L3\t@cond_branch */\n/* .L25: */\n/* \tmov\tr0, #0x3 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L26: */\n/* \tldr\tr3, .L44 */\n/* \tmov\tr4, #0x0 */\n/* \tstrh\tr4, [r3] */\n/* \tldr\tr2, .L44+0x4 */\n/* \tldrh\tr1, [r2] */\n/* \tldr\tr0, .L44+0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tmov\tr0, #0x1 */\n/* \tstrh\tr0, [r3] */\n/* \tldr\tr1, .L44+0xc */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x5 */\n/* \tadd\tr0, r2, #0 */\n/* \tstrh\tr0, [r1] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tstr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x3 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr2, .L44+0x10 */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tr1, #0 */\n/* \tstr\tr0, [r2] */\n/* \tstr\tr1, [r2, #0x4] */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tldr\tr1, .L44+0x14 */\n/* \tmov\tr0, #0x0 */\n/* \tstr\tr0, [r1] */\n/* .L27: */\n/* \tldr\tr0, .L44+0x18 */\n/* \tmov\tr1, #0xc0 */\n/* \tstrh\tr1, [r0] */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L35\t@cond_branch */\n/* \tstrb\tr4, [r5, #0x2] */\n/* \tmov\tr0, #0x4 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L45: */\n/* \t.align\t2, 0 */\n/* .L44: */\n/* \t.word\t0x4000208 */\n/* \t.word\t0x4000200 */\n/* \t.word\t0xff3f */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000120 */\n/* \t.word\t0x400010c */\n/* \t.word\t0x4000202 */\n/* .L29: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x2 */\n/* \tbls\t.L3\t@cond_branch */\n/* .L35: */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L33 */\n/* .L3: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tmov\tr0, #0x0 */\n/* .L33: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Sio32MultiLoadMain(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Sio32MultiLoadMain': 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":275,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Sio32MultiLoadMain': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? gSio32MultiLoadArea;\n\ns32 Sio32MultiLoadMain(s32 *arg0) {\n s32 temp_r0;\n s32 temp_r2;\n s32 var_r4;\n\n switch ((u32) gSio32MultiLoadArea.unk1) { /* irregular */\n case 0:\n if (!(gSio32MultiLoadArea.unk0 & 0xFF00FF)) {\n\n } else {\n gSio32MultiLoadArea.unk1 = 1U;\n }\n default:\nblock_37:\n gSio32MultiLoadArea.unk2 = (u8) (gSio32MultiLoadArea.unk2 + 1);\n return 0;\n case 1:\n if ((u8) gSio32MultiLoadArea.unk0 == 1) {\n if ((u32) gSio32MultiLoadArea.unk2 <= 5U) {\n\n } else {\n goto block_11;\n }\n } else {\n (void *)0x04000128->unk0 = 0x1000U;\nblock_11:\n (void *)0x04000120->unk0 = 0;\n *(s16 *)0x04000202 = 0xC0;\n if ((u8) gSio32MultiLoadArea.unk0 == 1) {\n (void *)0x04000128->unk0 = (u16) ((void *)0x04000128->unk0 | 0x80);\n *(s32 *)0x0400010C = 0xC0F318;\n *(s16 *)0x04000208 = 0;\n (void *)0x04000128->unkD8 = (u16) ((void *)0x04000128->unkD8 | 0x40);\n *(s16 *)0x04000208 = (s16) (u8) gSio32MultiLoadArea.unk0;\n } else {\n (void *)0x04000128->unk0 = (u16) ((void *)0x04000128->unk0 | 0x4080);\n *(void *)0x04000208 = 0;\n (void *)0x04000128->unkD8 = (u16) ((void *)0x04000128->unkD8 | 0x80);\n *(void *)0x04000208 = 1;\n }\n gSio32MultiLoadArea.unk2 = 0U;\n gSio32MultiLoadArea.unk1 = 2U;\n }\n goto block_37;\n case 2:\n var_r4 = gSio32MultiLoadArea.unk8;\n if ((s32) gSio32MultiLoadArea.unk8 > 0x2000) {\n var_r4 = 0x2000;\n } else if ((s32) gSio32MultiLoadArea.unk8 < 0) {\n var_r4 = 0;\n }\n if (arg0 != NULL) {\n *arg0 = var_r4;\n }\n if ((u8) gSio32MultiLoadArea.unk0 != 1) {\n if ((s32) gSio32MultiLoadArea.unk14 < var_r4) {\n do {\n gSio32MultiLoadArea.unk10 = (s32) (gSio32MultiLoadArea.unk10 + *((gSio32MultiLoadArea.unk14 * 4) + gSio32MultiLoadArea.unk4));\n temp_r2 = gSio32MultiLoadArea.unk14 + 1;\n gSio32MultiLoadArea.unk14 = temp_r2;\n } while (temp_r2 < var_r4);\n }\n if ((s32) gSio32MultiLoadArea.unk8 > 0x2000) {\n temp_r0 = gSio32MultiLoadArea.unkC + gSio32MultiLoadArea.unk10;\n gSio32MultiLoadArea.unkC = temp_r0;\n if (temp_r0 == -1) {\n gSio32MultiLoadArea.unk3 = 1;\n }\n goto block_28;\n }\n goto block_29;\n }\nblock_28:\n if ((s32) gSio32MultiLoadArea.unk8 <= 0x2000) {\nblock_29:\n if (gSio32MultiLoadArea.unk2 == 0x8C) {\n goto block_30;\n }\n } else {\nblock_30:\n gSio32MultiLoadArea.unk1 = 3U;\n }\n goto block_37;\n case 3:\n *(void *)0x04000208 = 0;\n *(u16 *)0x04000200 &= 0xFF3F;\n *(void *)0x04000208 = 1;\n (void *)0x04000128->unk0 = 0x1000U;\n (void *)0x04000128->unk0 = 0x2000;\n (void *)0x04000128->unk0 = 0x2003;\n (void *)0x04000120->unk0 = 0;\n (void *)0x04000120->unk4 = 0;\n if ((u8) gSio32MultiLoadArea.unk0 != 0) {\n *(void *)0x0400010C = 0;\n }\n *(void *)0x04000202 = 0xC0;\n if ((u8) gSio32MultiLoadArea.unk0 != 0) {\n gSio32MultiLoadArea.unk2 = 0U;\n gSio32MultiLoadArea.unk1 = 4U;\n goto block_37;\n }\nblock_36:\n return 1;\n case 4:\n if ((u32) gSio32MultiLoadArea.unk2 > 2U) {\n goto block_36;\n }\n goto block_37;\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":108,"gotos":9,"casts":44,"unkGlue":0,"rawMem":0,"addrDeref":11},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sio32MultiLoadMain` — benchmark function sa3:Sio32MultiLoadMain:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sio32MultiLoadMain # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sio32MultiLoadMain` — benchmark function sa3:Sio32MultiLoadMain:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadMain:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sio32MultiLoadMain # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_802DFC8:agbcc","sym":"sub_802DFC8","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","ternary","bitwise","call"],"loc":65,"refSource":"void sub_802DFC8(s16 direction, Sprite *s)\n{\n s32 mask = 0;\n s32 variant;\n\n if (direction & 0x8) {\n variant = 6;\n\n mask = (direction & 1) ? SPRITE_FLAG(X_FLIP, 1) : 0;\n } else if (direction & 0x4) {\n variant = 4;\n\n if (direction & 0x2) {\n mask = SPRITE_FLAG(X_FLIP, 1);\n }\n\n if (direction & 0x1) {\n mask |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } else if (direction & 0x2) {\n variant = 2;\n\n if (direction & 0x1) {\n mask = SPRITE_FLAG(X_FLIP, 1);\n }\n } else {\n variant = 0;\n\n if (direction & 0x1) {\n mask = SPRITE_FLAG(Y_FLIP, 1);\n }\n }\n\n if (gStageData.gameMode != GAME_MODE_MP_SINGLE_PACK) {\n if ((gStageData.act >= ACT_1) && (gStageData.act <= ACT_BONUS_CAPSULE)) {\n if (gStageData.zone == ZONE_6) {\n s->tiles = ALLOC_TILES(ANIM_SPRING_6);\n s->anim = ANIM_SPRING_6;\n } else if (gStageData.zone == ZONE_4) {\n s->tiles = ALLOC_TILES(ANIM_SPRING_4);\n s->anim = ANIM_SPRING_4;\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n }\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n }\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n mask |= SPRITE_FLAG_MASK_MOSAIC;\n }\n\n s->variant = variant;\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = Q(0);\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = HITBOX_STATE_INACTIVE;\n s->frameFlags = mask | SPRITE_FLAG(PRIORITY, 1);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/spring.c#L174-L238","targetAsm":"@ Generated by gcc 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_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-0735218e8a5b.i.gz","proto":{"sub_802DFC8":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sub_802DFC8' — lift: cannot lift 'sub_802DFC8': branch target '.L19' 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\tsub_802DFC8 */\n/* \t.type\t sub_802DFC8,function */\n/* \t.thumb_func */\n/* sub_802DFC8: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tr4, r1, #0 */\n/* \tmov\tr5, #0x0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tmov\tr0, #0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tmov\tr6, #0x6 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tneg\tr1, r0 */\n/* \torr\tr1, r1, r0 */\n/* \tasr\tr5, r1, #0x1f */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tand\tr5, r5, r0 */\n/* \tb\t.L6 */\n/* .L3: */\n/* \tmov\tr0, #0x4 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L7\t@cond_branch */\n/* \tmov\tr6, #0x4 */\n/* \tmov\tr0, #0x2 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L8\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* .L8: */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \torr\tr5, r5, r0 */\n/* \tb\t.L6 */\n/* .L7: */\n/* \tmov\tr0, #0x2 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L11\t@cond_branch */\n/* \tmov\tr6, #0x2 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tb\t.L6 */\n/* .L11: */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x4 */\n/* .L6: */\n/* \tldr\tr1, .L23 */\n/* \tldrb\tr0, [r1, #0x3] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tldrb\tr0, [r1, #0xa] */\n/* \tsub\tr0, r0, #0x3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x5 */\n/* \tbhi\t.L16\t@cond_branch */\n/* \tldrb\tr0, [r1, #0x9] */\n/* \tcmp\tr0, #0x5 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0xf */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tmov\tr0, #0xea */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L24: */\n/* \t.align\t2, 0 */\n/* .L23: */\n/* \t.word\tgStageData */\n/* .L17: */\n/* \tcmp\tr0, #0x3 */\n/* \tbne\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L25 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L26: */\n/* \t.align\t2, 0 */\n/* .L25: */\n/* \t.word\t0x3db */\n/* .L19: */\n/* .L16: */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L27 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L28: */\n/* \t.align\t2, 0 */\n/* .L27: */\n/* \t.word\t0x362 */\n/* .L15: */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L29 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \torr\tr5, r5, r0 */\n/* .L22: */\n/* \tmov\tr1, #0x0 */\n/* \tstrb\tr6, [r4, #0x1a] */\n/* \tmov\tr2, #0x0 */\n/* \tmov\tr0, #0xc0 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tstrh\tr0, [r4, #0x14] */\n/* \tstrh\tr1, [r4, #0xe] */\n/* \tstrh\tr1, [r4, #0x16] */\n/* \tmov\tr0, #0xff */\n/* \tstrb\tr0, [r4, #0x1b] */\n/* \tmov\tr0, #0x10 */\n/* \tstrb\tr0, [r4, #0x1c] */\n/* \tstrb\tr2, [r4, #0x1f] */\n/* \tsub\tr0, r0, #0x11 */\n/* \tstr\tr0, [r4, #0x20] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x5 */\n/* \torr\tr5, r5, r0 */\n/* \tstr\tr5, [r4, #0x8] */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L30: */\n/* \t.align\t2, 0 */\n/* .L29: */\n/* \t.word\t0x362 */\n/* .Lfe1: */\n/* \t.size\t sub_802DFC8,.Lfe1-sub_802DFC8 */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sub_802DFC8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sub_802DFC8': branch target '.L19' 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":166,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sub_802DFC8': branch target '.L19' is not a code block in this function (a data label, or outside the sliced function)"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sub_802DFC8(s16 direction, Sprite *s) {\n s16 temp_r1;\n s32 temp_r0;\n s32 var_r5;\n u8 var_r6;\n\n var_r5 = 0;\n temp_r1 = direction;\n if (8 & temp_r1) {\n var_r6 = 6;\n temp_r0 = 1 & temp_r1;\n var_r5 = ((s32) ((0 - temp_r0) | temp_r0) >> 0x1F) & 0x400;\n } else if (4 & temp_r1) {\n var_r6 = 4;\n if (2 & temp_r1) {\n var_r5 = 0x400;\n }\n if (1 & temp_r1) {\n var_r5 |= 0x800;\n }\n } else if (2 & temp_r1) {\n var_r6 = 2;\n if (1 & temp_r1) {\n var_r5 = 0x400;\n }\n } else {\n var_r6 = 0;\n if (1 & temp_r1) {\n var_r5 = 0x800;\n }\n }\n if (gStageData.gameMode != 7) {\n if ((u32) (u8) (gStageData.act - 3) <= 5U) {\n if (gStageData.zone == 5) {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x3A8;\n } else if (gStageData.zone == 3) {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x3DB;\n } else {\n goto block_18;\n }\n } else {\nblock_18:\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x362;\n }\n } else {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x362;\n var_r5 |= 0x200;\n }\n s->variant = var_r6;\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n}\n","score":0,"maxScore":128,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":86,"lines":61,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_802DFC8` — benchmark function sa3:sub_802DFC8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-0735218e8a5b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_802DFC8(s16 direction, Sprite *s);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_802DFC8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_802DFC8` — benchmark function sa3:sub_802DFC8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_802DFC8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_802DFC8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_802DFC8 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_803213C:agbcc","sym":"sub_803213C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","ternary","bitwise","call"],"loc":30,"refSource":"void sub_803213C(u8 unk38, u8 unk39, Sprite *s)\n{\n u32 mask = (unk39 & 0x1) ? SPRITE_FLAG(X_FLIP, 1) : 0;\n\n if (gStageData.gameMode != GAME_MODE_MP_SINGLE_PACK) {\n if (unk38 != 0) {\n s->tiles = ALLOC_TILES(ANIM_RAMP);\n s->anim = ANIM_RAMP;\n s->variant = 0;\n } else {\n s->tiles = ALLOC_TILES_VARIANT(ANIM_RAMP, 1);\n s->anim = ANIM_RAMP;\n s->variant = 1;\n }\n } else {\n s->tiles = ALLOC_TILES_VARIANT(ANIM_RAMP, 1);\n s->anim = ANIM_RAMP;\n s->variant = 1;\n mask |= SPRITE_FLAG(MOSAIC, 1);\n }\n\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = Q(0);\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = HITBOX_STATE_INACTIVE;\n s->frameFlags = SPRITE_FLAG(PRIORITY, 1) | mask;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/ramp.c#L340-L369","targetAsm":"@ Generated by gcc 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_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-c4f423915ef9.i.gz","proto":{"sub_803213C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Struct0 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u8 _pad1[4]; u16 field_20; u16 field_22; u8 _pad2[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad3[2]; u8 field_31; s32 field_32; };\nvoid sub_803213C(s32 a0, s32 a1, struct Struct0 * a2) {\n s32 v0;\n s32 v1;\n v0 = 1;\n if (((u8 *)&gStageData)[3] == 7) {\n a2->field_0 = VramMalloc(15, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = v0;\n v1 = (-((u8)a1 & v0) | (u8)a1 & v0) >> 31 & 128 << 3 | 128 << 2;\n } else {\n if ((u8)a0 == 0) {\n a2->field_0 = VramMalloc(15, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = v0;\n } else {\n a2->field_0 = VramMalloc(20, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = 0;\n }\n v1 = (-((u8)a1 & v0) | (u8)a1 & v0) >> 31 & 128 << 3;\n }\n a2->field_20 = 192 << 3;\n a2->field_14 = 0;\n a2->field_22 = 0;\n a2->field_27 = 255;\n a2->field_28 = 16;\n a2->field_31 = 0;\n a2->field_32 = 16 - 17;\n a2->field_8 = v1 | 128 << 5;\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":32,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'sub_803213C': agbcc failed: /c.c:2338: too many arguments to function `VramMalloc'"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sub_803213C(u8 unk38, u8 unk39, Sprite *s) {\n s32 temp_r1;\n s32 var_r5;\n\n temp_r1 = unk39 & 1;\n var_r5 = ((s32) ((0 - temp_r1) | temp_r1) >> 0x1F) & 0x400;\n if (gStageData.gameMode != 7) {\n if (unk38 != 0) {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x366;\n s->variant = 0;\n } else {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x366;\n s->variant = 1;\n }\n } else {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x366;\n s->variant = 1;\n var_r5 |= 0x200;\n }\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n}\n","score":0,"maxScore":71,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":30,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_803213C` — benchmark function sa3:sub_803213C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-c4f423915ef9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_803213C(u8 unk38, u8 unk39, Sprite *s);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_803213C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_803213C` — benchmark function sa3:sub_803213C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_803213C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_803213C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_803213C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_804D360:agbcc","sym":"sub_804D360","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","branch","switch","bitwise","call","comparison-tree"],"loc":47,"refSource":"void sub_804D360(Sprite *s, s16 i, s16 param2)\n{\n u32 flags = 0;\n\n switch (i) {\n case 0: {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n if (param2 == 2) {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } break;\n\n case 1: {\n if (param2 == 2) {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } break;\n\n case 2: {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n\n if (param2 == 0) {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n }\n } break;\n\n case 3: {\n if (param2 == 0) {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n }\n } break;\n }\n\n s->tiles = ALLOC_TILES_VARIANT(ANIM_MAZE, 6);\n s->anim = ANIM_MAZE;\n s->variant = 6;\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->qAnimDelay = 0;\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = flags | SPRITE_FLAG(PRIORITY, 1);\n UpdateSpriteAnimation(s);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/maze.c#L344-L390","targetAsm":"@ Generated by gcc 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_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-753afb45dfc7.i.gz","proto":{"sub_804D360":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/defsite","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u8 _pad1[4]; u16 field_20; u16 field_22; u8 _pad2[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad3[2]; u8 field_31; s32 field_32; };\nvoid sub_804D360(struct Struct0 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = 0;\n if ((s16)a1 == 1) {\n if ((u16)a2 == 2) v0 = 128 << 4;\n } else {\n if ((s16)a1 > 1) {\n switch ((s16)a1) {\n case 2:\n if ((u16)a2 != 0) {\n v0 = 128 << 4;\n } else {\n v0 = 128 << 4 | 128 << 3;\n }\n break;\n case 3:\n if ((u16)a2 == 0) v0 = 128 << 3;\n break;\n default:\n }\n } else {\n if ((s16)a1 == 0) {\n if ((u16)a2 != 2) {\n v0 = 128 << 3;\n } else {\n v0 = 128 << 3 | 128 << 4;\n }\n }\n }\n }\n a0->field_0 = VramMalloc(9, (s16)a1, (u16)a2);\n a0->field_12 = 235 << 2;\n a0->field_26 = 6;\n a0->field_20 = 192 << 3;\n a0->field_14 = 0;\n a0->field_22 = 0;\n a0->field_27 = 255;\n a0->field_28 = 16;\n a0->field_31 = 0;\n a0->field_32 = 16 - 17;\n a0->field_8 = v0 | 128 << 5;\n UpdateSpriteAnimation(a0, 0, 0);\n return;\n}\n","score":56,"maxScore":91,"compileErrors":null,"breakdown":{"insert":16,"delete":8,"replace":2,"opMismatch":6,"argMismatch":24},"quality":{"score":84,"lines":45,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sub_804D360(Sprite *s, s16 i, s16 param2) {\n s16 temp_r1;\n s32 var_r5;\n u16 temp_r2;\n\n temp_r2 = (u16) param2;\n var_r5 = 0;\n temp_r1 = i;\n switch (temp_r1) { /* irregular */\n case 0:\n var_r5 = 0x400;\n if (temp_r2 == 2) {\n var_r5 = 0x400 | 0x800;\n }\n break;\n case 1:\n if (temp_r2 == 2) {\n var_r5 = 0x800;\n }\n break;\n case 2:\n var_r5 = 0x800;\n if (temp_r2 == 0) {\n var_r5 = 0x800 | 0x400;\n }\n break;\n case 3:\n if (temp_r2 == 0) {\n var_r5 = 0x400;\n }\n break;\n }\n s->tiles = VramMalloc(9U);\n s->anim = 0x3AC;\n s->variant = 6;\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n UpdateSpriteAnimation(s);\n}\n","score":6,"maxScore":75,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":44,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":75,"ratio":0.08,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_804D360` — benchmark function sa3:sub_804D360:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-753afb45dfc7.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_804D360(Sprite *s, s16 i, s16 param2);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_804D360 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_804D360` — benchmark function sa3:sub_804D360:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_804D360:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_804D360\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_804D360 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_804DC38:agbcc","sym":"sub_804DC38","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","switch","loop","shift","bitwise","soft-div","call","comparison-tree"],"loc":92,"refSource":"u16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me)\n{\n s32 r0;\n s32 r1;\n s32 r2_32;\n s16 r2;\n bool32 r6;\n u16 i;\n\n // TODO(Jace): This was likely not written this way, and might actually be a bug?\n // I don't think MapEntity structs are always aligned in memory.\n u32 data = *((u32 *)&me->d.uData[1]);\n if (data & 0x00FFFF00) {\n if (me->d.uData[3] < me->d.uData[2]) {\n r2_32 = (me->d.uData[2] * (TILE_WIDTH / 2));\n r1 = worldX;\n r0 = worldX + (me->d.sData[0] * TILE_WIDTH);\n r6 = FALSE;\n } else {\n r2_32 = (me->d.uData[3] * (TILE_WIDTH / 2));\n r1 = worldY;\n r0 = worldY + (me->d.sData[1] * TILE_WIDTH);\n r6 = TRUE;\n }\n\n r2 = ((r1 - (r0 + r2_32)) << 14) / r2_32;\n if (r2 >= 0) {\n for (i = 0; (i < Q(1)) && (r2 > SIN(i));) {\n i += 4;\n }\n\n switch (kind) {\n case 0: {\n return Q(2) - i;\n } break;\n\n case 1: {\n if (r6) {\n return i;\n } else {\n return Q(2) - i;\n }\n } break;\n\n case 2: {\n if (!r6) {\n return i;\n } else {\n return Q(2) - i;\n }\n } break;\n\n default: {\n return i;\n }\n }\n\n } else {\n for (i = Q(2); (i < Q(3)) && (r2 < SIN(i));) {\n i += 4;\n }\n\n switch (kind) {\n case 0: {\n return i;\n } break;\n\n case 1: {\n if (!r6) {\n return i;\n } else {\n return Q(6) - i;\n }\n } break;\n\n case 2: {\n if (r6) {\n return i;\n } else {\n return Q(6) - i;\n }\n } break;\n\n case 3: {\n return Q(6) - i;\n } break;\n }\n }\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/platform_shared.c#L8-L99","targetAsm":"@ Generated by gcc 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_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-dde16f46c6da.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sub_804DC38' — raise: cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — 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\tsub_804DC38 */\n/* \t.type\t sub_804DC38,function */\n/* \t.thumb_func */\n/* sub_804DC38: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr6, r1, #0 */\n/* \tadd\tr5, r2, #0 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr0, [r3, #0x4] */\n/* \tldr\tr1, .L47 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB16 */\n/* \tb\t.L3\t@long jump */\n/* .LCB16: */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tldrb\tr1, [r3, #0x5] */\n/* \tcmp\tr0, r1 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldrb\tr0, [r3, #0x5] */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr1, r6, #0 */\n/* \tmov\tr0, #0x3 */\n/* \tldrsb\tr0, [r3, r0] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r1, r0 */\n/* \tmov\tr6, #0x0 */\n/* \tb\t.L5 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\t0xffff00 */\n/* .L4: */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr1, r5, #0 */\n/* \tmov\tr0, #0x4 */\n/* \tldrsb\tr0, [r3, r0] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r1, r0 */\n/* \tmov\tr6, #0x1 */\n/* .L5: */\n/* \tadd\tr0, r0, r2 */\n/* \tsub\tr0, r1, r0 */\n/* \tlsl\tr0, r0, #0xe */\n/* \tadd\tr1, r2, #0 */\n/* \tbl\t__divsi3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tcmp\tr2, #0 */\n/* \tblt\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x0 */\n/* \tldr\tr3, .L49 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr0, [r3, r5] */\n/* \tcmp\tr2, r0 */\n/* \tble\t.L8\t@cond_branch */\n/* .L10: */\n/* \tadd\tr0, r1, #0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr1, r0, #0x10 */\n/* \tcmp\tr1, #0xff */\n/* \tbhi\t.L8\t@cond_branch */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tbgt\t.L10\t@cond_branch */\n/* .L8: */\n/* \tcmp\tr4, #0x1 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tcmp\tr4, #0x1 */\n/* \tbgt\t.L23\t@cond_branch */\n/* \tcmp\tr4, #0 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tb\t.L45 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgSineTable */\n/* .L23: */\n/* \tcmp\tr4, #0x2 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tb\t.L45 */\n/* .L14: */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr0, r2, #0 */\n/* \tb\t.L44 */\n/* .L15: */\n/* \tcmp\tr6, #0 */\n/* \tbne\t.L45\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x2 */\n/* \tadd\tr0, r5, #0 */\n/* \tb\t.L44 */\n/* .L18: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tmov\tr7, #0x80 */\n/* \tlsl\tr7, r7, #0x2 */\n/* \tb\t.L46 */\n/* .L6: */\n/* \tldr\tr3, .L51 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tadd\tr0, r3, r5 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tbge\t.L26\t@cond_branch */\n/* \tldr\tr5, .L51+0x4 */\n/* .L28: */\n/* \tadd\tr0, r1, #0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr1, r0, #0x10 */\n/* \tcmp\tr1, r5 */\n/* \tbhi\t.L26\t@cond_branch */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tblt\t.L28\t@cond_branch */\n/* .L26: */\n/* \tcmp\tr4, #0x1 */\n/* \tbeq\t.L33\t@cond_branch */\n/* \tcmp\tr4, #0x1 */\n/* \tbgt\t.L42\t@cond_branch */\n/* \tcmp\tr4, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tb\t.L3 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgSineTable */\n/* \t.word\t0x2ff */\n/* .L42: */\n/* \tcmp\tr4, #0x2 */\n/* \tbeq\t.L36\t@cond_branch */\n/* \tcmp\tr4, #0x3 */\n/* \tbeq\t.L39\t@cond_branch */\n/* \tb\t.L3 */\n/* .L33: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tmov\tr2, #0xc0 */\n/* \tlsl\tr2, r2, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tb\t.L44 */\n/* .L36: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L37\t@cond_branch */\n/* .L45: */\n/* \tadd\tr0, r1, #0 */\n/* \tb\t.L43 */\n/* .L37: */\n/* \tmov\tr5, #0xc0 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tadd\tr0, r5, #0 */\n/* \tb\t.L44 */\n/* .L39: */\n/* \tmov\tr7, #0xc0 */\n/* \tlsl\tr7, r7, #0x3 */\n/* .L46: */\n/* \tadd\tr0, r7, #0 */\n/* .L44: */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tb\t.L43 */\n/* .L3: */\n/* \tmov\tr0, #0x0 */\n/* .L43: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sub_804DC38,.Lfe1-sub_804DC38 */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sub_804DC38(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":196,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"typedef struct MapEntity {\n /* 0x0 */ u8 x;\n /* 0x1 */ u8 y;\n /* 0x2 */ u8 index;\n /* 0x3 */ ? unk3; /* inferred */\n /* 0x3 */ char pad3[1];\n /* 0x4 */ union _anonymous d;\n} MapEntity; /* size = 0xC */\n\nu16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me) {\n s16 temp_r2;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r1_2;\n s32 var_r2;\n s32 var_r6;\n s32 var_r7;\n u16 var_r1;\n u8 temp_r4;\n\n temp_r4 = kind;\n if (!(me->unk4 & 0xFFFF00)) {\n return 0U;\n }\n if ((u32) (u8) me->d.sData[2] < (u32) (u8) me->d.sData[1]) {\n var_r2 = (u8) me->d.sData[1] * 4;\n var_r1_2 = worldX;\n var_r0_2 = var_r1_2 + (me->unk3 * 8);\n var_r6 = 0;\n } else {\n var_r2 = (u8) me->d.sData[2] * 4;\n var_r1_2 = worldY;\n var_r0_2 = var_r1_2 + (me->d.sData[0] * 8);\n var_r6 = 1;\n }\n temp_r2 = (s16) ((s32) ((var_r1_2 - (var_r0_2 + var_r2)) << 0xE) / var_r2);\n if ((s32) temp_r2 >= 0) {\n var_r1 = 0;\n if ((s32) temp_r2 > (s32) gSineTable->unk0) {\nloop_7:\n var_r1 += 4;\n if ((u32) var_r1 <= 0xFFU) {\n if ((s32) temp_r2 > (s32) gSineTable[var_r1]) {\n goto loop_7;\n }\n }\n }\n switch (temp_r4) { /* switch 1; irregular */\n case 0: /* switch 1 */\n var_r0 = 0x200;\n goto block_38;\n case 1: /* switch 1 */\n if (var_r6 == 0) {\n var_r0 = 0x200;\n goto block_38;\n }\n goto block_34;\n case 2: /* switch 1 */\n if (var_r6 != 0) {\n var_r7 = 0x200;\n goto block_37;\n }\n goto block_34;\n }\n } else {\n var_r1 = 0x200;\n if ((s32) temp_r2 < (s32) gSineTable[0x200]) {\nloop_22:\n var_r1 += 4;\n if ((u32) var_r1 <= 0x2FFU) {\n if ((s32) temp_r2 < (s32) gSineTable[var_r1]) {\n goto loop_22;\n }\n }\n }\n switch (temp_r4) { /* switch 2; irregular */\n case 1: /* switch 2 */\n if (var_r6 != 0) {\n var_r0 = 0x600;\nblock_38:\n return (u16) (var_r0 - var_r1);\n }\n case 0: /* switch 2 */\nblock_34:\n return var_r1;\n case 2: /* switch 2 */\n if (var_r6 != 0) {\n goto block_34;\n }\n var_r0 = 0x600;\n goto block_38;\n case 3: /* switch 2 */\n var_r7 = 0x600;\nblock_37:\n var_r0 = var_r7;\n goto block_38;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":97,"gotos":10,"casts":20,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:996: redefinition of `struct MapEntity'","/c.c:1000: syntax error before `?'","/c.c:1000: warning: no semicolon at end of struct or union","/c.c:1003: syntax error before `}'","/c.c:1003: warning: useless keyword or type name in empty declaration"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_804DC38` — benchmark function sa3:sub_804DC38:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-dde16f46c6da.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_804DC38 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_804DC38` — benchmark function sa3:sub_804DC38:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_804DC38:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\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 sub_804DC38 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_806132C:agbcc","sym":"sub_806132C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","global","call"],"loc":54,"refSource":"void sub_806132C(Hariisen *enemy)\n{\n u8 *vram = VramMalloc(18);\n Sprite2 *s = &enemy->s;\n\n s->tiles = vram;\n vram += (gUnknown_080D2044[0].numTiles * TILE_SIZE_4BPP);\n s->anim = gUnknown_080D2044[0].anim;\n s->variant = gUnknown_080D2044[0].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x480;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n\n s = &enemy->s2;\n s->tiles = vram;\n vram += (gUnknown_080D2044[3].numTiles * TILE_SIZE_4BPP);\n s->anim = gUnknown_080D2044[3].anim;\n s->variant = gUnknown_080D2044[3].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x4C0;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n\n s = &enemy->s3;\n s->tiles = vram;\n s->anim = gUnknown_080D2044[4].anim;\n s->variant = gUnknown_080D2044[4].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x4C0;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/enemies/hariisen.c#L55-L108","targetAsm":"@ Generated by gcc 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_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-8415744e08a9.i.gz","proto":{"sub_806132C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Struct0 { u8 _pad0[6]; u16 field_6; u16 field_8; u8 _pad1[26]; s32 field_36; s32 field_40; u8 _pad2[48]; s32 field_92; };\nstruct Struct1 { u16 field_0; u8 field_2; s32 field_4; u8 _pad0[16]; u16 field_24; u8 field_26; s32 field_28; u16 field_32; };\nstruct Struct2 { u8 _pad0[8]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nstruct Struct3 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nstruct Struct4 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nvoid sub_806132C(struct Struct0 * a0, s32 a1, s32 a2, s32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * p0;\n u16 * p1;\n u8 * p2;\n p0 = (s32 *)&gUnknown_080D2044;\n p1 = (u16 *)&gUnknown_080D2044;\n p2 = (u8 *)&gUnknown_080D2044;\n v0 = VramMalloc(18);\n a0->field_92 = v0;\n v1 = p0[1];\n v2 = 0;\n ((struct Struct2 *)(a0 + 92))->field_12 = *p1;\n ((struct Struct2 *)(a0 + 92))->field_26 = p2[2];\n ((struct Struct2 *)(a0 + 92))->field_27 = 255;\n ((struct Struct2 *)(a0 + 92))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct2 *)(a0 + 92))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct2 *)(a0 + 92))->field_20 = 144 << 3;\n ((struct Struct2 *)(a0 + 92))->field_14 = v2;\n ((struct Struct2 *)(a0 + 92))->field_22 = v2;\n ((struct Struct2 *)(a0 + 92))->field_28 = 16;\n ((struct Struct2 *)(a0 + 92))->field_31 = 0;\n ((struct Struct2 *)(a0 + 92))->field_8 = 128 << 5;\n ((struct Struct2 *)(a0 + 92))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 92, -1, a0 + 92, 0);\n ((struct Struct3 *)(a0 + 140))->field_0 = v0 + (v1 << 5);\n v3 = p0[7];\n ((struct Struct3 *)(a0 + 140))->field_12 = p1[12];\n ((struct Struct3 *)(a0 + 140))->field_26 = p2[26];\n ((struct Struct3 *)(a0 + 140))->field_27 = -1;\n ((struct Struct3 *)(a0 + 140))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct3 *)(a0 + 140))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct3 *)(a0 + 140))->field_20 = 152 << 3;\n ((struct Struct3 *)(a0 + 140))->field_14 = v2;\n ((struct Struct3 *)(a0 + 140))->field_22 = v2;\n ((struct Struct3 *)(a0 + 140))->field_28 = 16;\n ((struct Struct3 *)(a0 + 140))->field_31 = 0;\n ((struct Struct3 *)(a0 + 140))->field_8 = 128 << 5;\n ((struct Struct3 *)(a0 + 140))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 140, -1, a0 + 140, 0);\n ((struct Struct4 *)(a0 + 188))->field_0 = v0 + (v1 << 5) + (v3 << 5);\n ((struct Struct4 *)(a0 + 188))->field_12 = p1[16];\n ((struct Struct4 *)(a0 + 188))->field_26 = p2[34];\n ((struct Struct4 *)(a0 + 188))->field_27 = -1;\n ((struct Struct4 *)(a0 + 188))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct4 *)(a0 + 188))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct4 *)(a0 + 188))->field_20 = 152 << 3;\n ((struct Struct4 *)(a0 + 188))->field_14 = v2;\n ((struct Struct4 *)(a0 + 188))->field_22 = v2;\n ((struct Struct4 *)(a0 + 188))->field_28 = 16;\n ((struct Struct4 *)(a0 + 188))->field_31 = 0;\n ((struct Struct4 *)(a0 + 188))->field_8 = 128 << 5;\n ((struct Struct4 *)(a0 + 188))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 188, -1, a0 + 188, 0);\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":64,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'sub_806132C': agbcc failed: /c.c:1540: warning: assignment makes integer from pointer without a cast"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sub_806132C(Hariisen *enemy) {\n u8 *temp_r0;\n u8 *temp_r5;\n u8 *temp_r5_2;\n\n temp_r0 = VramMalloc(0x12U);\n enemy->s.tiles = temp_r0;\n temp_r5 = temp_r0 + (gUnknown_080D2044->numTiles << 5);\n enemy->s.anim = gUnknown_080D2044->anim;\n enemy->s.variant = gUnknown_080D2044->variant;\n enemy->s.prevVariant = 0xFF;\n enemy->s.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s.oamFlags = 0x480;\n enemy->s.animCursor = 0;\n enemy->s.qAnimDelay = 0;\n enemy->s.animSpeed = 0x10;\n enemy->s.palId = 0;\n enemy->s.frameFlags = 0x1000;\n enemy->s.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s);\n enemy->s2.tiles = temp_r5;\n temp_r5_2 = temp_r5 + (gUnknown_080D2044[3].numTiles << 5);\n enemy->s2.anim = gUnknown_080D2044[3].anim;\n enemy->s2.variant = gUnknown_080D2044[3].variant;\n enemy->s2.prevVariant = -1U;\n enemy->s2.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s2.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s2.oamFlags = 0x4C0;\n enemy->s2.animCursor = 0;\n enemy->s2.qAnimDelay = 0;\n enemy->s2.animSpeed = 0x10;\n enemy->s2.palId = 0;\n enemy->s2.frameFlags = 0x1000;\n enemy->s2.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s2);\n enemy->s3.tiles = temp_r5_2;\n enemy->s3.anim = gUnknown_080D2044[4].anim;\n enemy->s3.variant = gUnknown_080D2044[4].variant;\n enemy->s3.prevVariant = -1U;\n enemy->s3.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s3.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s3.oamFlags = 0x4C0;\n enemy->s3.animCursor = 0;\n enemy->s3.qAnimDelay = 0;\n enemy->s3.animSpeed = 0x10;\n enemy->s3.palId = 0;\n enemy->s3.frameFlags = 0x1000;\n enemy->s3.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s3);\n}\n","score":171,"maxScore":216,"compileErrors":null,"breakdown":{"insert":58,"delete":8,"replace":1,"opMismatch":0,"argMismatch":104},"quality":{"score":92,"lines":50,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":171,"maxScore":216,"ratio":0.7916666666666666,"kinds":{"insert":58,"delete":8,"replace":1,"opMismatch":0,"argMismatch":104}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_806132C` — benchmark function sa3:sub_806132C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-8415744e08a9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_806132C(Hariisen *enemy);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_806132C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_806132C` — benchmark function sa3:sub_806132C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_806132C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_806132C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_806132C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["pointer","cast","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","branch","loop"],"loc":14,"refSource":"u16 VramGetTotalAllocatedTiles(void)\n{\n u16 i;\n u16 count = 0;\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; ++i) {\n if (gVramHeapState[i]) {\n count += gVramHeapState[i];\n i = gVramHeapState[i] - 1 + i; // next slot to check, -1 because of ++i\n }\n }\n return count * VRAM_TILE_SLOTS_PER_SEGMENT;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gVramHeapMaxTileSlots","shape":"scalar u16"},{"name":"gVramHeapState","shape":"u16[]"}],"outcome":"nonmatch","source":"s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= (u32)v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < (u32)v0 >> 2);\n }\n return (u32)(v2 << 18) >> 16;\n}\n","score":22,"maxScore":43,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":0,"opMismatch":1,"argMismatch":11},"quality":{"score":90,"lines":20,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 VramGetTotalAllocatedTiles(void) {\n u16 temp_r1;\n u16 var_r2;\n u16 var_r3;\n u32 temp_r0;\n\n var_r3 = 0;\n var_r2 = 0;\n temp_r0 = (u16) gVramHeapMaxTileSlots >> 2;\n if (temp_r0 > 0U) {\n do {\n temp_r1 = gVramHeapState[var_r2];\n if (temp_r1 != 0) {\n var_r3 += temp_r1;\n var_r2 = temp_r1 + (var_r2 + 0xFFFF);\n }\n var_r2 += 1;\n } while ((u32) var_r2 < temp_r0);\n }\n return (u16) (var_r3 * 4);\n}\n","score":16,"maxScore":38,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11},"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":38,"ratio":0.42105263157894735,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","branch","pointer","loop","nested-loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80014440_15040\n lui\t$v0, %hi(gDefaultFontPalette)\n addiu\t$v0, $v0, %lo(gDefaultFontPalette)\n sh\t$zero, 0($v0)\n li\t$a0, 1\n li\t$a1, 0xffff\n addiu\t$v1, $v0, 2\n.L18:\n sh\t$a1, 0($v1)\n addiu\t$a0, $a0, 1\n slti\t$v0, $a0, 256\n bnez\t$v0, .L18\n addiu\t$v1, $v1, 2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80014440_15040 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc","sym":"func_800154A8_160A8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800154A8_160A8\n andi\t$a1, $a1, 0xffff\n beqz\t$a1, .L24\n nop\n addu\t$a1, $a1, $a0\n sb\t$zero, 0($a0)\n.L14:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L14\n sb\t$zero, 0($a0)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800154A8_160A8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc","sym":"func_800167B0_173B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","bitwise","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800167B0_173B0\n addiu\t$sp, $sp, -24\n move\t$a3, $a0\n sw\t$ra, 16($sp)\n lbu\t$v0, 12($a3)\n bnez\t$v0, .L60\n addiu\t$v0, $v0, -1\n lbu\t$v0, 13($a3)\n addiu\t$v0, $v0, 1\n sb\t$v0, 13($a3)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L48\n nop\n lbu\t$v0, 14($a3)\n addiu\t$v0, $v0, 1\n andi\t$v0, $v0, 0x1\n sb\t$v0, 14($a3)\n addiu\t$v0, $v0, 7\n sh\t$v0, 8($a3)\n.L48:\n lbu\t$v1, 13($a3)\n li\t$v0, 16\n bne\t$v1, $v0, .L68\n li\t$a0, 8\n li\t$v0, 30\n sb\t$zero, 13($a3)\n.L60:\n sb\t$v0, 12($a3)\n li\t$a0, 8\n.L68:\n lui\t$a2, %hi(func_8000FED0_10AD0)\n addiu\t$a2, $a2, %lo(func_8000FED0_10AD0)\n jal\tdebugEnqueueCallback\n li\t$a1, 1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800167B0_173B0(Struct16728 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800167B0_173B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc","sym":"func_80018DC0_199C0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","global","branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80018DC0_199C0\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tallocateTaskMemory\n li\t$a0, 4\n sb\t$zero, 2($v0)\n lui\t$v1, %hi(D_800A8CC8_A0038)\n lbu\t$v1, %lo(D_800A8CC8_A0038)($v1)\n sh\t$zero, 0($v0)\n li\t$v0, 4\n beq\t$v1, $v0, .L34\n nop\n jal\tfunc_800574A0_580A0\n li\t$a0, 2\n.L34:\n lui\t$v0, %hi(D_800A8CC8_A0038)\n lbu\t$v0, %lo(D_800A8CC8_A0038)($v0)\n sll\t$v0, $v0, 0x2\n lui\t$a0, %hi(D_8008D78C_8E38C)\n addu\t$a0, $a0, $v0\n lw\t$a0, %lo(D_8008D78C_8E38C)($a0)\n jal\tcreateTaskQueue\n li\t$a1, 90\n lui\t$a0, %hi(func_80018E2C_19A2C)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80018E2C_19A2C)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80018DC0_199C0(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80018DC0_199C0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc","sym":"func_8001BCDC_1C8DC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","global","branch","loop","nested-loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BCDC_1C8DC\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n nop\n move\t$t0, $v0\n move\t$a2, $zero\n.L18:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 8($v0)\n move\t$a1, $zero\n blez\t$v0, .L68\n move\t$a0, $zero\n move\t$a3, $v0\n addu\t$v0, $t0, $a0\n.L38:\n lbu\t$v0, 1434($v0)\n xori\t$v1, $v0, 0x1\n sltiu\t$v1, $v1, 1\n xori\t$v0, $v0, 0x3\n sltiu\t$v0, $v0, 1\n or\t$v1, $v1, $v0\n bnezl\t$v1, .L58\n addiu\t$a1, $a1, 1\n.L58:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a3\n bnez\t$v0, .L38\n addu\t$v0, $t0, $a0\n.L68:\n andi\t$v0, $a1, 0xff\n bnezl\t$v0, .L80\n addiu\t$a2, $a2, 1\n addu\t$v0, $t0, $a2\n sb\t$zero, 1464($v0)\n addiu\t$a2, $a2, 1\n.L80:\n slti\t$v0, $a2, 9\n bnez\t$v0, .L18\n nop\n lw\t$ra, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BCDC_1C8DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc","sym":"func_8001BD74_1C974","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","pointer","memory"],"loc":10,"refSource":"void func_8001BD74_1C974(s8 *a0) {\n if (*a0 == 3) {\n *a0 = 2;\n } else if (*a0 == 8) {\n *a0 = 7;\n } else if (*a0 != 4) {\n } else {\n *a0 = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\n","proto":{"func_8001BD74_1C974":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BD74_1C974' — lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlb\tv1,0(a0) */\n/* 4:\tli\tv0,3 */\n/* 8:\tbne\tv1,v0,1c */\n/* c:\tli\tv0,8 */\n/* 10:\tli\tv0,2 */\n/* 14:\tj\t38 */\n/* 18:\tsb\tv0,0(a0) */\n/* 1c:\tbne\tv1,v0,30 */\n/* 20:\tli\tv0,4 */\n/* 24:\tli\tv0,7 */\n/* 28:\tj\t38 */\n/* 2c:\tsb\tv0,0(a0) */\n/* 30:\tbeql\tv1,v0,38 */\n/* 34:\tsb\tzero,0(a0) */\n/* 38:\tjr\tra */\n/* 3c:\tnop */\nvoid func_8001BD74_1C974(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8001BD74_1C974(s8 *arg0) {\n s8 temp_v1;\n\n temp_v1 = *arg0;\n switch (temp_v1) { /* irregular */\n case 3:\n *arg0 = 2;\n return;\n case 8:\n *arg0 = 7;\n return;\n case 4:\n *arg0 = 0;\n return;\n }\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/1BBA0.c: remaps a state byte through a pointer via an if-chain; pure leaf","gapSize":{"decompiler":"m2c","score":14,"maxScore":23,"ratio":0.6086956521739131,"kinds":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BD74_1C974\n lb\t$v1, 0($a0)\n li\t$v0, 3\n bne\t$v1, $v0, .L1c\n li\t$v0, 8\n li\t$v0, 2\n j\t.L38\n sb\t$v0, 0($a0)\n.L1c:\n bne\t$v1, $v0, .L30\n li\t$v0, 4\n li\t$v0, 7\n j\t.L38\n sb\t$v0, 0($a0)\n.L30:\n beql\t$v1, $v0, .L38\n sb\t$zero, 0($a0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BD74_1C974 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc","sym":"func_8001E104_1ED04","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","union","loop","strength-reduce"],"loc":114,"refSource":"s32 func_8001E104_1ED04(EepromSaveData_type *arg0) {\n s32 temp_a1;\n s32 changed;\n s32 i;\n u8 temp;\n\n temp_a1 = *(s32 *)arg0->unknown_0C;\n changed = 0;\n if (temp_a1 > 0x98967F) {\n *(s32 *)arg0->unknown_0C = 0x98967F;\n changed = 1;\n i = 0;\n } else {\n i = 0;\n if (temp_a1 < 0) {\n *(s32 *)arg0->unknown_0C = 0;\n changed = 1;\n i = 0;\n }\n }\n\n for (i = 0; i < 0x10; i++) {\n temp = arg0->save_slot_status[i];\n if (temp >= 6) {\n arg0->save_slot_status[i] = 0;\n changed = 1;\n }\n temp = arg0->save_slot_data[i];\n if (temp >= 6) {\n arg0->save_slot_data[i] = 0;\n changed = 1;\n }\n }\n\n if (arg0->save_slot_status[0] == 0) {\n arg0->save_slot_status[0] = 5;\n changed = 1;\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->save_slot_data[i];\n if (temp == 0) {\n arg0->save_slot_data[i] = 5;\n changed = 1;\n }\n temp = arg0->save_slot_data[i + 4];\n if (temp == 0) {\n arg0->save_slot_data[i + 4] = 5;\n changed = 1;\n }\n }\n\n for (i = 0; i < 0x12; i++) {\n temp = arg0->character_or_settings[i];\n if (temp >= 0x1A) {\n arg0->character_or_settings[i] = 0;\n changed = 1;\n }\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->character_or_settings[i * 3];\n if (temp == 0) {\n arg0->character_or_settings[i * 3] = i + 1;\n changed = 1;\n }\n }\n\n for (i = 0; i < 0x12; i++) {\n temp = arg0->character_or_settings[i];\n if (temp >= 0x1A) {\n arg0->character_or_settings[i] = 1;\n changed = 1;\n }\n }\n\n for (i = 0; i < 9; i++) {\n temp = arg0->u.setting_42[i];\n if (temp >= 0x12) {\n arg0->u.setting_42[i] = 0x11;\n changed = 1;\n }\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->setting_4B[i];\n if (temp >= 0x10) {\n arg0->setting_4B[i] = 0xF;\n changed = 1;\n }\n }\n\n if (arg0->setting_4E >= 2) {\n arg0->setting_4E = 0;\n changed = 1;\n }\n\n if (arg0->setting_4F >= 2) {\n arg0->setting_4F = 0;\n changed = 1;\n }\n\n if (arg0->setting_50 >= 2) {\n arg0->setting_50 = 0;\n changed = 1;\n }\n\n if (arg0->unk51 >= 2) {\n arg0->unk51 = 0;\n changed = 1;\n }\n\n return changed;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1D520.c#L203-L316","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,12(a0)\n 4:\tlui\tv1,0x98\n 8:\tori\tv1,v1,0x967f\n c:\tslt\tv0,v1,a1\n 10:\tbeqz\tv0,20 \n 14:\tmove\ta2,zero\n 18:\tj\t2c \n 1c:\tsw\tv1,12(a0)\n 20:\tbgez\ta1,34 \n 24:\tmove\tv1,zero\n 28:\tsw\tzero,12(a0)\n 2c:\tli\ta2,1\n 30:\tmove\tv1,zero\n 34:\taddu\ta1,a0,v1\n 38:\tlbu\tv0,16(a1)\n 3c:\tsltiu\tv0,v0,6\n 40:\tbnez\tv0,50 \n 44:\tnop\n 48:\tsb\tzero,16(a1)\n 4c:\tli\ta2,1\n 50:\tlbu\tv0,32(a1)\n 54:\tsltiu\tv0,v0,6\n 58:\tbnez\tv0,68 \n 5c:\taddiu\tv1,v1,1\n 60:\tsb\tzero,32(a1)\n 64:\tli\ta2,1\n 68:\tslti\tv0,v1,16\n 6c:\tbnez\tv0,38 \n 70:\taddu\ta1,a0,v1\n 74:\tlbu\tv0,16(a0)\n 78:\tbnez\tv0,8c \n 7c:\tmove\tv1,zero\n 80:\tli\tv0,5\n 84:\tsb\tv0,16(a0)\n 88:\tli\ta2,1\n 8c:\tli\ta3,5\n 90:\taddu\ta1,a0,v1\n 94:\tlbu\tv0,32(a1)\n 98:\tbnez\tv0,a8 \n 9c:\tnop\n a0:\tsb\ta3,32(a1)\n a4:\tli\ta2,1\n a8:\tlbu\tv0,36(a1)\n ac:\tbnez\tv0,bc \n b0:\taddiu\tv1,v1,1\n b4:\tsb\ta3,36(a1)\n b8:\tli\ta2,1\n bc:\tslti\tv0,v1,3\n c0:\tbnez\tv0,94 \n c4:\taddu\ta1,a0,v1\n c8:\tmove\tv1,zero\n cc:\taddu\ta1,a0,v1\n d0:\tlbu\tv0,48(a1)\n d4:\tsltiu\tv0,v0,26\n d8:\tbnez\tv0,e8 \n dc:\taddiu\tv1,v1,1\n e0:\tsb\tzero,48(a1)\n e4:\tli\ta2,1\n e8:\tslti\tv0,v1,18\n ec:\tbnez\tv0,d0 \n f0:\taddu\ta1,a0,v1\n f4:\tmove\tv1,zero\n f8:\tmove\ta1,a0\n fc:\tlbu\tv0,48(a1)\n 100:\tbnezl\tv0,118 \n 104:\taddiu\tv1,v1,1\n 108:\taddiu\tv0,v1,1\n 10c:\tsb\tv0,48(a1)\n 110:\tli\ta2,1\n 114:\taddiu\tv1,v1,1\n 118:\tslti\tv0,v1,3\n 11c:\tbnez\tv0,fc \n 120:\taddiu\ta1,a1,3\n 124:\tmove\tv1,zero\n 128:\tli\ta3,1\n 12c:\taddu\ta1,a0,v1\n 130:\tlbu\tv0,48(a1)\n 134:\tsltiu\tv0,v0,26\n 138:\tbnez\tv0,148 \n 13c:\taddiu\tv1,v1,1\n 140:\tsb\ta3,48(a1)\n 144:\tli\ta2,1\n 148:\tslti\tv0,v1,18\n 14c:\tbnez\tv0,130 \n 150:\taddu\ta1,a0,v1\n 154:\tmove\tv1,zero\n 158:\tli\ta3,17\n 15c:\taddu\ta1,a0,v1\n 160:\tlbu\tv0,66(a1)\n 164:\tsltiu\tv0,v0,18\n 168:\tbnez\tv0,178 \n 16c:\taddiu\tv1,v1,1\n 170:\tsb\ta3,66(a1)\n 174:\tli\ta2,1\n 178:\tslti\tv0,v1,9\n 17c:\tbnez\tv0,160 \n 180:\taddu\ta1,a0,v1\n 184:\tmove\tv1,zero\n 188:\tli\ta3,15\n 18c:\taddu\ta1,a0,v1\n 190:\tlbu\tv0,75(a1)\n 194:\tsltiu\tv0,v0,16\n 198:\tbnez\tv0,1a8 \n 19c:\taddiu\tv1,v1,1\n 1a0:\tsb\ta3,75(a1)\n 1a4:\tli\ta2,1\n 1a8:\tslti\tv0,v1,3\n 1ac:\tbnez\tv0,190 \n 1b0:\taddu\ta1,a0,v1\n 1b4:\tlbu\tv0,78(a0)\n 1b8:\tsltiu\tv0,v0,2\n 1bc:\tbnez\tv0,1cc \n 1c0:\tnop\n 1c4:\tsb\tzero,78(a0)\n 1c8:\tli\ta2,1\n 1cc:\tlbu\tv0,79(a0)\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,1e4 \n 1d8:\tnop\n 1dc:\tsb\tzero,79(a0)\n 1e0:\tli\ta2,1\n 1e4:\tlbu\tv0,80(a0)\n 1e8:\tsltiu\tv0,v0,2\n 1ec:\tbnez\tv0,1fc \n 1f0:\tnop\n 1f4:\tsb\tzero,80(a0)\n 1f8:\tli\ta2,1\n 1fc:\tlbu\tv0,81(a0)\n 200:\tsltiu\tv0,v0,2\n 204:\tbnez\tv0,214 \n 208:\tnop\n 20c:\tsb\tzero,81(a0)\n 210:\tli\ta2,1\n 214:\tjr\tra\n 218:\tmove\tv0,a2\n 21c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4453acd6f88bb589/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000021c func_8001E104_1ED04\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c85000c 3c030098 3463967f 0065102a ....<...4c...e.*\n 0010 10400003 00003021 0800000b ac83000c .@....0!........\n 0020 04a10004 00001821 ac80000c 24060001 .......!....$...\n 0030 00001821 00832821 90a20010 2c420006 ...!..(!....,B..\n 0040 14400003 00000000 a0a00010 24060001 .@..........$...\n 0050 90a20020 2c420006 14400003 24630001 ... ,B...@..$c..\n 0060 a0a00020 24060001 28620010 1440fff2 ... $...(b...@..\n 0070 00832821 90820010 14400004 00001821 ..(!.....@.....!\n 0080 24020005 a0820010 24060001 24070005 $.......$...$...\n 0090 00832821 90a20020 14400003 00000000 ..(!... .@......\n 00a0 a0a70020 24060001 90a20024 14400003 ... $......$.@..\n 00b0 24630001 a0a70024 24060001 28620003 $c.....$$...(b..\n 00c0 1440fff4 00832821 00001821 00832821 .@....(!...!..(!\n 00d0 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 00e0 a0a00030 24060001 28620012 1440fff8 ...0$...(b...@..\n 00f0 00832821 00001821 00802821 90a20030 ..(!...!..(!...0\n 0100 54400005 24630001 24620001 a0a20030 T@..$c..$b.....0\n 0110 24060001 24630001 28620003 1440fff7 $...$c..(b...@..\n 0120 24a50003 00001821 24070001 00832821 $......!$.....(!\n 0130 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 0140 a0a70030 24060001 28620012 1440fff8 ...0$...(b...@..\n 0150 00832821 00001821 24070011 00832821 ..(!...!$.....(!\n 0160 90a20042 2c420012 14400003 24630001 ...B,B...@..$c..\n 0170 a0a70042 24060001 28620009 1440fff8 ...B$...(b...@..\n 0180 00832821 00001821 2407000f 00832821 ..(!...!$.....(!\n 0190 90a2004b 2c420010 14400003 24630001 ...K,B...@..$c..\n 01a0 a0a7004b 24060001 28620003 1440fff8 ...K$...(b...@..\n 01b0 00832821 9082004e 2c420002 14400003 ..(!...N,B...@..\n 01c0 00000000 a080004e 24060001 9082004f .......N$......O\n 01d0 2c420002 14400003 00000000 a080004f ,B...@.........O\n 01e0 24060001 90820050 2c420002 14400003 $......P,B...@..\n 01f0 00000000 a0800050 24060001 90820051 .......P$......Q\n 0200 2c420002 14400003 00000000 a0800051 ,B...@.........Q\n 0210 24060001 03e00008 00c01021 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,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001E104_1ED04' — lift: cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — 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\ta1,12(a0) */\n/* 4:\tlui\tv1,0x98 */\n/* 8:\tori\tv1,v1,0x967f */\n/* c:\tslt\tv0,v1,a1 */\n/* 10:\tbeqz\tv0,20 */\n/* 14:\tmove\ta2,zero */\n/* 18:\tj\t2c */\n/* 1c:\tsw\tv1,12(a0) */\n/* 20:\tbgez\ta1,34 */\n/* 24:\tmove\tv1,zero */\n/* 28:\tsw\tzero,12(a0) */\n/* 2c:\tli\ta2,1 */\n/* 30:\tmove\tv1,zero */\n/* 34:\taddu\ta1,a0,v1 */\n/* 38:\tlbu\tv0,16(a1) */\n/* 3c:\tsltiu\tv0,v0,6 */\n/* 40:\tbnez\tv0,50 */\n/* 44:\tnop */\n/* 48:\tsb\tzero,16(a1) */\n/* 4c:\tli\ta2,1 */\n/* 50:\tlbu\tv0,32(a1) */\n/* 54:\tsltiu\tv0,v0,6 */\n/* 58:\tbnez\tv0,68 */\n/* 5c:\taddiu\tv1,v1,1 */\n/* 60:\tsb\tzero,32(a1) */\n/* 64:\tli\ta2,1 */\n/* 68:\tslti\tv0,v1,16 */\n/* 6c:\tbnez\tv0,38 */\n/* 70:\taddu\ta1,a0,v1 */\n/* 74:\tlbu\tv0,16(a0) */\n/* 78:\tbnez\tv0,8c */\n/* 7c:\tmove\tv1,zero */\n/* 80:\tli\tv0,5 */\n/* 84:\tsb\tv0,16(a0) */\n/* 88:\tli\ta2,1 */\n/* 8c:\tli\ta3,5 */\n/* 90:\taddu\ta1,a0,v1 */\n/* 94:\tlbu\tv0,32(a1) */\n/* 98:\tbnez\tv0,a8 */\n/* 9c:\tnop */\n/* a0:\tsb\ta3,32(a1) */\n/* a4:\tli\ta2,1 */\n/* a8:\tlbu\tv0,36(a1) */\n/* ac:\tbnez\tv0,bc */\n/* b0:\taddiu\tv1,v1,1 */\n/* b4:\tsb\ta3,36(a1) */\n/* b8:\tli\ta2,1 */\n/* bc:\tslti\tv0,v1,3 */\n/* c0:\tbnez\tv0,94 */\n/* c4:\taddu\ta1,a0,v1 */\n/* c8:\tmove\tv1,zero */\n/* cc:\taddu\ta1,a0,v1 */\n/* d0:\tlbu\tv0,48(a1) */\n/* d4:\tsltiu\tv0,v0,26 */\n/* d8:\tbnez\tv0,e8 */\n/* dc:\taddiu\tv1,v1,1 */\n/* e0:\tsb\tzero,48(a1) */\n/* e4:\tli\ta2,1 */\n/* e8:\tslti\tv0,v1,18 */\n/* ec:\tbnez\tv0,d0 */\n/* f0:\taddu\ta1,a0,v1 */\n/* f4:\tmove\tv1,zero */\n/* f8:\tmove\ta1,a0 */\n/* fc:\tlbu\tv0,48(a1) */\n/* 100:\tbnezl\tv0,118 */\n/* 104:\taddiu\tv1,v1,1 */\n/* 108:\taddiu\tv0,v1,1 */\n/* 10c:\tsb\tv0,48(a1) */\n/* 110:\tli\ta2,1 */\n/* 114:\taddiu\tv1,v1,1 */\n/* 118:\tslti\tv0,v1,3 */\n/* 11c:\tbnez\tv0,fc */\n/* 120:\taddiu\ta1,a1,3 */\n/* 124:\tmove\tv1,zero */\n/* 128:\tli\ta3,1 */\n/* 12c:\taddu\ta1,a0,v1 */\n/* 130:\tlbu\tv0,48(a1) */\n/* 134:\tsltiu\tv0,v0,26 */\n/* 138:\tbnez\tv0,148 */\n/* 13c:\taddiu\tv1,v1,1 */\n/* 140:\tsb\ta3,48(a1) */\n/* 144:\tli\ta2,1 */\n/* 148:\tslti\tv0,v1,18 */\n/* 14c:\tbnez\tv0,130 */\n/* 150:\taddu\ta1,a0,v1 */\n/* 154:\tmove\tv1,zero */\n/* 158:\tli\ta3,17 */\n/* 15c:\taddu\ta1,a0,v1 */\n/* 160:\tlbu\tv0,66(a1) */\n/* 164:\tsltiu\tv0,v0,18 */\n/* 168:\tbnez\tv0,178 */\n/* 16c:\taddiu\tv1,v1,1 */\n/* 170:\tsb\ta3,66(a1) */\n/* 174:\tli\ta2,1 */\n/* 178:\tslti\tv0,v1,9 */\n/* 17c:\tbnez\tv0,160 */\n/* 180:\taddu\ta1,a0,v1 */\n/* 184:\tmove\tv1,zero */\n/* 188:\tli\ta3,15 */\n/* 18c:\taddu\ta1,a0,v1 */\n/* 190:\tlbu\tv0,75(a1) */\n/* 194:\tsltiu\tv0,v0,16 */\n/* 198:\tbnez\tv0,1a8 */\n/* 19c:\taddiu\tv1,v1,1 */\n/* 1a0:\tsb\ta3,75(a1) */\n/* 1a4:\tli\ta2,1 */\n/* 1a8:\tslti\tv0,v1,3 */\n/* 1ac:\tbnez\tv0,190 */\n/* 1b0:\taddu\ta1,a0,v1 */\n/* 1b4:\tlbu\tv0,78(a0) */\n/* 1b8:\tsltiu\tv0,v0,2 */\n/* 1bc:\tbnez\tv0,1cc */\n/* 1c0:\tnop */\n/* 1c4:\tsb\tzero,78(a0) */\n/* 1c8:\tli\ta2,1 */\n/* 1cc:\tlbu\tv0,79(a0) */\n/* 1d0:\tsltiu\tv0,v0,2 */\n/* 1d4:\tbnez\tv0,1e4 */\n/* 1d8:\tnop */\n/* 1dc:\tsb\tzero,79(a0) */\n/* 1e0:\tli\ta2,1 */\n/* 1e4:\tlbu\tv0,80(a0) */\n/* 1e8:\tsltiu\tv0,v0,2 */\n/* 1ec:\tbnez\tv0,1fc */\n/* 1f0:\tnop */\n/* 1f4:\tsb\tzero,80(a0) */\n/* 1f8:\tli\ta2,1 */\n/* 1fc:\tlbu\tv0,81(a0) */\n/* 200:\tsltiu\tv0,v0,2 */\n/* 204:\tbnez\tv0,214 */\n/* 208:\tnop */\n/* 20c:\tsb\tzero,81(a0) */\n/* 210:\tli\ta2,1 */\n/* 214:\tjr\tra */\n/* 218:\tmove\tv0,a2 */\n/* 21c:\tnop */\nvoid func_8001E104_1ED04(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":144,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_8001E104_1ED04(void *arg0) {\n s32 temp_a1;\n s32 var_a2;\n s32 var_v1;\n s32 var_v1_2;\n s32 var_v1_3;\n s32 var_v1_4;\n s32 var_v1_5;\n s32 var_v1_6;\n s32 var_v1_7;\n void *var_a1;\n void *var_a1_2;\n void *var_a1_3;\n void *var_a1_4;\n void *var_a1_5;\n void *var_a1_6;\n void *var_a1_7;\n\n temp_a1 = arg0->unkC;\n var_a2 = 0;\n if (temp_a1 > 0x98967F) {\n arg0->unkC = 0x98967F;\n goto block_4;\n }\n var_v1 = 0;\n if (temp_a1 < 0) {\n arg0->unkC = 0;\nblock_4:\n var_a2 = 1;\n var_v1 = 0;\n }\n var_a1 = arg0;\n do {\n if ((u8) var_a1->unk10 >= 6U) {\n var_a1->unk10 = 0U;\n var_a2 = 1;\n }\n var_v1 += 1;\n if ((u8) var_a1->unk20 >= 6U) {\n var_a1->unk20 = 0U;\n var_a2 = 1;\n }\n var_a1 = arg0 + var_v1;\n } while (var_v1 < 0x10);\n var_v1_2 = 0;\n if (arg0->unk10 == 0) {\n arg0->unk10 = 5U;\n var_a2 = 1;\n }\n var_a1_2 = arg0;\n do {\n if (var_a1_2->unk20 == 0) {\n var_a1_2->unk20 = 5U;\n var_a2 = 1;\n }\n var_v1_2 += 1;\n if (var_a1_2->unk24 == 0) {\n var_a1_2->unk24 = 5U;\n var_a2 = 1;\n }\n var_a1_2 = arg0 + var_v1_2;\n } while (var_v1_2 < 3);\n var_v1_3 = 0;\n var_a1_3 = arg0;\n do {\n var_v1_3 += 1;\n if ((u8) var_a1_3->unk30 >= 0x1AU) {\n var_a1_3->unk30 = 0U;\n var_a2 = 1;\n }\n var_a1_3 = arg0 + var_v1_3;\n } while (var_v1_3 < 0x12);\n var_v1_4 = 0;\n var_a1_4 = arg0;\n do {\n if (var_a1_4->unk30 == 0) {\n var_a1_4->unk30 = (u8) (var_v1_4 + 1);\n var_a2 = 1;\n }\n var_v1_4 += 1;\n var_a1_4 += 3;\n } while (var_v1_4 < 3);\n var_v1_5 = 0;\n var_a1_5 = arg0;\n do {\n var_v1_5 += 1;\n if ((u8) var_a1_5->unk30 >= 0x1AU) {\n var_a1_5->unk30 = 1U;\n var_a2 = 1;\n }\n var_a1_5 = arg0 + var_v1_5;\n } while (var_v1_5 < 0x12);\n var_v1_6 = 0;\n var_a1_6 = arg0;\n do {\n var_v1_6 += 1;\n if ((u8) var_a1_6->unk42 >= 0x12U) {\n var_a1_6->unk42 = 0x11U;\n var_a2 = 1;\n }\n var_a1_6 = arg0 + var_v1_6;\n } while (var_v1_6 < 9);\n var_v1_7 = 0;\n var_a1_7 = arg0;\n do {\n var_v1_7 += 1;\n if ((u8) var_a1_7->unk4B >= 0x10U) {\n var_a1_7->unk4B = 0xFU;\n var_a2 = 1;\n }\n var_a1_7 = arg0 + var_v1_7;\n } while (var_v1_7 < 3);\n if ((u8) arg0->unk4E >= 2U) {\n arg0->unk4E = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk4F >= 2U) {\n arg0->unk4F = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk50 >= 2U) {\n arg0->unk50 = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk51 >= 2U) {\n arg0->unk51 = 0U;\n var_a2 = 1;\n }\n return var_a2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":129,"gotos":1,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2718: request for member `unkC' in something not a structure or union","/c.i:2721: request for member `unkC' in something not a structure or union","/c.i:2726: request for member `unkC' in something not a structure or union","/c.i:2733: request for member `unk10' in something not a structure or union","/c.i:2734: request for member `unk10' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001E104_1ED04` — benchmark function snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001E104_1ED04\n lw\t$a1, 12($a0)\n lui\t$v1, 0x98\n ori\t$v1, $v1, 0x967f\n slt\t$v0, $v1, $a1\n beqz\t$v0, .L20\n move\t$a2, $zero\n j\t.L2c\n sw\t$v1, 12($a0)\n.L20:\n bgez\t$a1, .L34\n move\t$v1, $zero\n sw\t$zero, 12($a0)\n.L2c:\n li\t$a2, 1\n move\t$v1, $zero\n.L34:\n addu\t$a1, $a0, $v1\n.L38:\n lbu\t$v0, 16($a1)\n sltiu\t$v0, $v0, 6\n bnez\t$v0, .L50\n nop\n sb\t$zero, 16($a1)\n li\t$a2, 1\n.L50:\n lbu\t$v0, 32($a1)\n sltiu\t$v0, $v0, 6\n bnez\t$v0, .L68\n addiu\t$v1, $v1, 1\n sb\t$zero, 32($a1)\n li\t$a2, 1\n.L68:\n slti\t$v0, $v1, 16\n bnez\t$v0, .L38\n addu\t$a1, $a0, $v1\n lbu\t$v0, 16($a0)\n bnez\t$v0, .L8c\n move\t$v1, $zero\n li\t$v0, 5\n sb\t$v0, 16($a0)\n li\t$a2, 1\n.L8c:\n li\t$a3, 5\n addu\t$a1, $a0, $v1\n.L94:\n lbu\t$v0, 32($a1)\n bnez\t$v0, .La8\n nop\n sb\t$a3, 32($a1)\n li\t$a2, 1\n.La8:\n lbu\t$v0, 36($a1)\n bnez\t$v0, .Lbc\n addiu\t$v1, $v1, 1\n sb\t$a3, 36($a1)\n li\t$a2, 1\n.Lbc:\n slti\t$v0, $v1, 3\n bnez\t$v0, .L94\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n addu\t$a1, $a0, $v1\n.Ld0:\n lbu\t$v0, 48($a1)\n sltiu\t$v0, $v0, 26\n bnez\t$v0, .Le8\n addiu\t$v1, $v1, 1\n sb\t$zero, 48($a1)\n li\t$a2, 1\n.Le8:\n slti\t$v0, $v1, 18\n bnez\t$v0, .Ld0\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n move\t$a1, $a0\n.Lfc:\n lbu\t$v0, 48($a1)\n bnezl\t$v0, .L118\n addiu\t$v1, $v1, 1\n addiu\t$v0, $v1, 1\n sb\t$v0, 48($a1)\n li\t$a2, 1\n addiu\t$v1, $v1, 1\n.L118:\n slti\t$v0, $v1, 3\n bnez\t$v0, .Lfc\n addiu\t$a1, $a1, 3\n move\t$v1, $zero\n li\t$a3, 1\n addu\t$a1, $a0, $v1\n.L130:\n lbu\t$v0, 48($a1)\n sltiu\t$v0, $v0, 26\n bnez\t$v0, .L148\n addiu\t$v1, $v1, 1\n sb\t$a3, 48($a1)\n li\t$a2, 1\n.L148:\n slti\t$v0, $v1, 18\n bnez\t$v0, .L130\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n li\t$a3, 17\n addu\t$a1, $a0, $v1\n.L160:\n lbu\t$v0, 66($a1)\n sltiu\t$v0, $v0, 18\n bnez\t$v0, .L178\n addiu\t$v1, $v1, 1\n sb\t$a3, 66($a1)\n li\t$a2, 1\n.L178:\n slti\t$v0, $v1, 9\n bnez\t$v0, .L160\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n li\t$a3, 15\n addu\t$a1, $a0, $v1\n.L190:\n lbu\t$v0, 75($a1)\n sltiu\t$v0, $v0, 16\n bnez\t$v0, .L1a8\n addiu\t$v1, $v1, 1\n sb\t$a3, 75($a1)\n li\t$a2, 1\n.L1a8:\n slti\t$v0, $v1, 3\n bnez\t$v0, .L190\n addu\t$a1, $a0, $v1\n lbu\t$v0, 78($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1cc\n nop\n sb\t$zero, 78($a0)\n li\t$a2, 1\n.L1cc:\n lbu\t$v0, 79($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1e4\n nop\n sb\t$zero, 79($a0)\n li\t$a2, 1\n.L1e4:\n lbu\t$v0, 80($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1fc\n nop\n sb\t$zero, 80($a0)\n li\t$a2, 1\n.L1fc:\n lbu\t$v0, 81($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L214\n nop\n sb\t$zero, 81($a0)\n li\t$a2, 1\n.L214:\n jr\t$ra\n move\t$v0, $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 func_8001E104_1ED04 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001E104_1ED04` — benchmark function snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001E104_1ED04: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\ta1,12(a0)\n 4:\tlui\tv1,0x98\n 8:\tori\tv1,v1,0x967f\n c:\tslt\tv0,v1,a1\n 10:\tbeqz\tv0,20 \n 14:\tmove\ta2,zero\n 18:\tj\t2c \n 1c:\tsw\tv1,12(a0)\n 20:\tbgez\ta1,34 \n 24:\tmove\tv1,zero\n 28:\tsw\tzero,12(a0)\n 2c:\tli\ta2,1\n 30:\tmove\tv1,zero\n 34:\taddu\ta1,a0,v1\n 38:\tlbu\tv0,16(a1)\n 3c:\tsltiu\tv0,v0,6\n 40:\tbnez\tv0,50 \n 44:\tnop\n 48:\tsb\tzero,16(a1)\n 4c:\tli\ta2,1\n 50:\tlbu\tv0,32(a1)\n 54:\tsltiu\tv0,v0,6\n 58:\tbnez\tv0,68 \n 5c:\taddiu\tv1,v1,1\n 60:\tsb\tzero,32(a1)\n 64:\tli\ta2,1\n 68:\tslti\tv0,v1,16\n 6c:\tbnez\tv0,38 \n 70:\taddu\ta1,a0,v1\n 74:\tlbu\tv0,16(a0)\n 78:\tbnez\tv0,8c \n 7c:\tmove\tv1,zero\n 80:\tli\tv0,5\n 84:\tsb\tv0,16(a0)\n 88:\tli\ta2,1\n 8c:\tli\ta3,5\n 90:\taddu\ta1,a0,v1\n 94:\tlbu\tv0,32(a1)\n 98:\tbnez\tv0,a8 \n 9c:\tnop\n a0:\tsb\ta3,32(a1)\n a4:\tli\ta2,1\n a8:\tlbu\tv0,36(a1)\n ac:\tbnez\tv0,bc \n b0:\taddiu\tv1,v1,1\n b4:\tsb\ta3,36(a1)\n b8:\tli\ta2,1\n bc:\tslti\tv0,v1,3\n c0:\tbnez\tv0,94 \n c4:\taddu\ta1,a0,v1\n c8:\tmove\tv1,zero\n cc:\taddu\ta1,a0,v1\n d0:\tlbu\tv0,48(a1)\n d4:\tsltiu\tv0,v0,26\n d8:\tbnez\tv0,e8 \n dc:\taddiu\tv1,v1,1\n e0:\tsb\tzero,48(a1)\n e4:\tli\ta2,1\n e8:\tslti\tv0,v1,18\n ec:\tbnez\tv0,d0 \n f0:\taddu\ta1,a0,v1\n f4:\tmove\tv1,zero\n f8:\tmove\ta1,a0\n fc:\tlbu\tv0,48(a1)\n 100:\tbnezl\tv0,118 \n 104:\taddiu\tv1,v1,1\n 108:\taddiu\tv0,v1,1\n 10c:\tsb\tv0,48(a1)\n 110:\tli\ta2,1\n 114:\taddiu\tv1,v1,1\n 118:\tslti\tv0,v1,3\n 11c:\tbnez\tv0,fc \n 120:\taddiu\ta1,a1,3\n 124:\tmove\tv1,zero\n 128:\tli\ta3,1\n 12c:\taddu\ta1,a0,v1\n 130:\tlbu\tv0,48(a1)\n 134:\tsltiu\tv0,v0,26\n 138:\tbnez\tv0,148 \n 13c:\taddiu\tv1,v1,1\n 140:\tsb\ta3,48(a1)\n 144:\tli\ta2,1\n 148:\tslti\tv0,v1,18\n 14c:\tbnez\tv0,130 \n 150:\taddu\ta1,a0,v1\n 154:\tmove\tv1,zero\n 158:\tli\ta3,17\n 15c:\taddu\ta1,a0,v1\n 160:\tlbu\tv0,66(a1)\n 164:\tsltiu\tv0,v0,18\n 168:\tbnez\tv0,178 \n 16c:\taddiu\tv1,v1,1\n 170:\tsb\ta3,66(a1)\n 174:\tli\ta2,1\n 178:\tslti\tv0,v1,9\n 17c:\tbnez\tv0,160 \n 180:\taddu\ta1,a0,v1\n 184:\tmove\tv1,zero\n 188:\tli\ta3,15\n 18c:\taddu\ta1,a0,v1\n 190:\tlbu\tv0,75(a1)\n 194:\tsltiu\tv0,v0,16\n 198:\tbnez\tv0,1a8 \n 19c:\taddiu\tv1,v1,1\n 1a0:\tsb\ta3,75(a1)\n 1a4:\tli\ta2,1\n 1a8:\tslti\tv0,v1,3\n 1ac:\tbnez\tv0,190 \n 1b0:\taddu\ta1,a0,v1\n 1b4:\tlbu\tv0,78(a0)\n 1b8:\tsltiu\tv0,v0,2\n 1bc:\tbnez\tv0,1cc \n 1c0:\tnop\n 1c4:\tsb\tzero,78(a0)\n 1c8:\tli\ta2,1\n 1cc:\tlbu\tv0,79(a0)\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,1e4 \n 1d8:\tnop\n 1dc:\tsb\tzero,79(a0)\n 1e0:\tli\ta2,1\n 1e4:\tlbu\tv0,80(a0)\n 1e8:\tsltiu\tv0,v0,2\n 1ec:\tbnez\tv0,1fc \n 1f0:\tnop\n 1f4:\tsb\tzero,80(a0)\n 1f8:\tli\ta2,1\n 1fc:\tlbu\tv0,81(a0)\n 200:\tsltiu\tv0,v0,2\n 204:\tbnez\tv0,214 \n 208:\tnop\n 20c:\tsb\tzero,81(a0)\n 210:\tli\ta2,1\n 214:\tjr\tra\n 218:\tmove\tv0,a2\n 21c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-4453acd6f88bb589/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000021c func_8001E104_1ED04\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c85000c 3c030098 3463967f 0065102a ....<...4c...e.*\n 0010 10400003 00003021 0800000b ac83000c .@....0!........\n 0020 04a10004 00001821 ac80000c 24060001 .......!....$...\n 0030 00001821 00832821 90a20010 2c420006 ...!..(!....,B..\n 0040 14400003 00000000 a0a00010 24060001 .@..........$...\n 0050 90a20020 2c420006 14400003 24630001 ... ,B...@..$c..\n 0060 a0a00020 24060001 28620010 1440fff2 ... $...(b...@..\n 0070 00832821 90820010 14400004 00001821 ..(!.....@.....!\n 0080 24020005 a0820010 24060001 24070005 $.......$...$...\n 0090 00832821 90a20020 14400003 00000000 ..(!... .@......\n 00a0 a0a70020 24060001 90a20024 14400003 ... $......$.@..\n 00b0 24630001 a0a70024 24060001 28620003 $c.....$$...(b..\n 00c0 1440fff4 00832821 00001821 00832821 .@....(!...!..(!\n 00d0 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 00e0 a0a00030 24060001 28620012 1440fff8 ...0$...(b...@..\n 00f0 00832821 00001821 00802821 90a20030 ..(!...!..(!...0\n 0100 54400005 24630001 24620001 a0a20030 T@..$c..$b.....0\n 0110 24060001 24630001 28620003 1440fff7 $...$c..(b...@..\n 0120 24a50003 00001821 24070001 00832821 $......!$.....(!\n 0130 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 0140 a0a70030 24060001 28620012 1440fff8 ...0$...(b...@..\n 0150 00832821 00001821 24070011 00832821 ..(!...!$.....(!\n 0160 90a20042 2c420012 14400003 24630001 ...B,B...@..$c..\n 0170 a0a70042 24060001 28620009 1440fff8 ...B$...(b...@..\n 0180 00832821 00001821 2407000f 00832821 ..(!...!$.....(!\n 0190 90a2004b 2c420010 14400003 24630001 ...K,B...@..$c..\n 01a0 a0a7004b 24060001 28620003 1440fff8 ...K$...(b...@..\n 01b0 00832821 9082004e 2c420002 14400003 ..(!...N,B...@..\n 01c0 00000000 a080004e 24060001 9082004f .......N$......O\n 01d0 2c420002 14400003 00000000 a080004f ,B...@.........O\n 01e0 24060001 90820050 2c420002 14400003 $......P,B...@..\n 01f0 00000000 a0800050 24060001 90820051 .......P$......Q\n 0200 2c420002 14400003 00000000 a0800051 ,B...@.........Q\n 0210 24060001 03e00008 00c01021 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 ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8001E104_1ED04 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["branch","compare","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021C00_22800\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 255\n bne\t$v1, $v0, .L38\n li\t$v0, 1\n lui\t$a0, %hi(func_80021D00_22900)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80021D00_22900)\n j\t.L4c\n nop\n.L38:\n bne\t$v1, $v0, .L4c\n nop\n lui\t$a0, %hi(func_80021C58_22858)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021C58_22858)\n.L4c:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021C00_22800(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021C00_22800 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021D88_22988:gcc2.7.2kmc","sym":"func_80021D88_22988","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021D88_22988\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tgetCurrentAllocation\n nop\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 1\n bne\t$v1, $v0, .L40\n li\t$v0, 255\n lui\t$a0, %hi(func_80021DE8_229E8)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021DE8_229E8)\n j\t.L54\n nop\n.L40:\n bne\t$v1, $v0, .L54\n nop\n lui\t$a0, %hi(func_80022108_22D08)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80022108_22D08)\n.L54:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021D88_22988(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021D88_22988 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc","sym":"func_80028BB0_297B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028BB0_297B0' — lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\tlhu\ta1,44(s0) */\n/* 24:\taddiu\ta0,s0,4 */\n/* 28:\tandi\tv0,v0,0xf */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\tv0,90(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,20(sp) */\n/* 4c:\tlw\ts0,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80028BB0_297B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028BB0_297B0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n lhu\t$a1, 44($s0)\n addiu\t$a0, $s0, 4\n andi\t$v0, $v0, 0xf\n jal\tcreateYRotationMatrix\n sh\t$v0, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028C08_29808)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028C08_29808)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028BB0_297B0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028BB0_297B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028D90_29990:gcc2.7.2kmc","sym":"func_80028D90_29990","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028D90_29990' — lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\taddiu\ta0,s0,4 */\n/* 24:\tlhu\tv1,90(s0) */\n/* 28:\tlhu\ta1,44(s0) */\n/* 2c:\tandi\tv0,v0,0xf */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\tjal\t0 */\n/* 38:\tsh\tv1,90(s0) */\n/* 3c:\tjal\t0 */\n/* 40:\tmove\ta0,s0 */\n/* 44:\tlui\ta0,0x0 */\n/* 48:\tjal\t0 */\n/* 4c:\taddiu\ta0,a0,0 */\n/* 50:\tlw\tra,20(sp) */\n/* 54:\tlw\ts0,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80028D90_29990(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = (u16) arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028D90_29990\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n addiu\t$a0, $s0, 4\n lhu\t$v1, 90($s0)\n lhu\t$a1, 44($s0)\n andi\t$v0, $v0, 0xf\n addu\t$v1, $v1, $v0\n jal\tcreateYRotationMatrix\n sh\t$v1, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028DF0_299F0)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028DF0_299F0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028D90_29990(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028D90_29990 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc","sym":"func_8002A2D0_2AED0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","bitwise","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A2D0_2AED0\n addiu\t$sp, $sp, -32\n sw\t$s0, 24($sp)\n sw\t$ra, 28($sp)\n jal\tgetCurrentAllocation\n move\t$s0, $a0\n lw\t$a0, 0($s0)\n jal\tapplyTransformToModel\n addiu\t$a1, $s0, 4\n lh\t$v1, 80($s0)\n lh\t$v0, 82($s0)\n beq\t$v1, $v0, .L44\n move\t$a2, $v1\n lw\t$a0, 0($s0)\n lh\t$a1, 80($s0)\n jal\tsetModelAnimation\n sh\t$a2, 82($s0)\n sb\t$zero, 98($s0)\n.L44:\n lb\t$v1, 98($s0)\n li\t$v0, -1\n beq\t$v1, $v0, .L60\n move\t$v0, $zero\n lw\t$a0, 0($s0)\n jal\tclearModelRotation\n nop\n.L60:\n beqz\t$v0, .La0\n li\t$v1, 1\n lbu\t$v0, 98($s0)\n sb\t$v1, 55($s0)\n lh\t$v1, 80($s0)\n andi\t$v0, $v0, 0x7f\n addiu\t$v0, $v0, 1\n sb\t$v0, 98($s0)\n li\t$v0, 152\n bne\t$v1, $v0, .La0\n li\t$v0, 2\n lbu\t$v1, 94($s0)\n beq\t$v1, $v0, .L9c\n li\t$v0, 144\n lhu\t$v0, 88($s0)\n.L9c:\n sh\t$v0, 80($s0)\n.La0:\n jal\tupdateModelGeometry\n lw\t$a0, 0($s0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002A2D0_2AED0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A2D0_2AED0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc","sym":"func_8002A390_2AF90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","switch","call","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A390_2AF90\n addiu\t$sp, $sp, -32\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n lbu\t$v1, 94($s0)\n move\t$s1, $v0\n slti\t$v0, $v1, 5\n beqzl\t$v0, .L44\n li\t$v0, 68\n bnez\t$v1, .Lc0\n nop\n beqz\t$v1, .L54\n move\t$v0, $zero\n j\t.L108\n nop\n.L44:\n beq\t$v1, $v0, .Le0\n move\t$v0, $zero\n j\t.L108\n nop\n.L54:\n lbu\t$a1, 93($s0)\n jal\tfunc_8002A4AC_2B0AC\n addiu\t$a0, $s0, 4\n bnez\t$v0, .L108\n li\t$v0, 1\n lbu\t$v0, 1057($s1)\n bnez\t$v0, .L108\n move\t$v0, $zero\n lw\t$a0, 24($s0)\n lw\t$a1, 32($s0)\n jal\tfunc_8002ACFC_2B8FC\n lh\t$a2, 46($s0)\n beqz\t$v0, .L108\n move\t$v0, $zero\n lhu\t$v0, 80($s0)\n lbu\t$v1, 93($s0)\n sh\t$v0, 84($s0)\n li\t$v0, 5\n bnel\t$v1, $v0, .Lac\n sh\t$zero, 80($s0)\n li\t$v0, 33\n sh\t$v0, 80($s0)\n.Lac:\n lbu\t$v1, 94($s0)\n li\t$v0, 68\n sb\t$v0, 94($s0)\n j\t.L104\n sb\t$v1, 97($s0)\n.Lc0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n sb\t$zero, 94($s0)\n j\t.L104\n sb\t$v0, 97($s0)\n.Le0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n lhu\t$v1, 84($s0)\n sb\t$zero, 94($s0)\n sb\t$v0, 97($s0)\n sh\t$v1, 80($s0)\n.L104:\n move\t$v0, $zero\n.L108:\n lw\t$ra, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A390_2AF90 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc","sym":"func_8002ACFC_2B8FC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixed-point","branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ACFC_2B8FC\n addiu\t$sp, $sp, -40\n sw\t$s2, 24($sp)\n move\t$s2, $a0\n sw\t$s3, 28($sp)\n move\t$s3, $a1\n sw\t$s0, 16($sp)\n move\t$s0, $a2\n sw\t$ra, 32($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n move\t$s1, $v0\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n move\t$a2, $s2\n jal\tfunc_8006D21C_6DE1C\n move\t$a3, $s3\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n addiu\t$v1, $s0, -568\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n slt\t$v1, $v1, $a0\n beqz\t$v1, .L98\n addiu\t$v0, $s0, 568\n slt\t$v0, $a0, $v0\n beqz\t$v0, .L9c\n move\t$v0, $zero\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n subu\t$a0, $a0, $s2\n jal\tdistance_2d\n subu\t$a1, $a1, $s3\n lui\t$v1, 0x28\n slt\t$v1, $v1, $v0\n bnez\t$v1, .L9c\n move\t$v0, $zero\n j\t.L9c\n li\t$v0, 1\n.L98:\n move\t$v0, $zero\n.L9c:\n lw\t$ra, 32($sp)\n lw\t$s3, 28($sp)\n lw\t$s2, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ACFC_2B8FC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc","sym":"func_8002ADB4_2B9B4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixed-point","branch","compare","goto","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ADB4_2B9B4\n move\t$t0, $a0\n sll\t$v0, $a0, 0x10\n sra\t$a2, $v0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v1, $v0, 0x10\n beq\t$a2, $v1, .Lc0\n move\t$a3, $a1\n subu\t$v0, $a2, $v1\n bltzl\t$v0, .L28\n negu\t$v0, $v0\n.L28:\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 4097\n bnez\t$v0, .L50\n sll\t$v0, $t0, 0x10\n slt\t$v0, $v1, $a2\n beqzl\t$v0, .L4c\n addiu\t$t0, $a0, 8192\n addiu\t$a3, $a1, 8192\n.L4c:\n sll\t$v0, $t0, 0x10\n.L50:\n sra\t$a1, $v0, 0x10\n sll\t$v0, $a3, 0x10\n sra\t$v1, $v0, 0x10\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L6c\n move\t$a2, $v0\n negu\t$a2, $a2\n.L6c:\n sll\t$v0, $a2, 0x10\n sra\t$a0, $v0, 0x10\n slti\t$v0, $a0, 2731\n bnezl\t$v0, .L88\n slt\t$v0, $v1, $a1\n j\t.Lc0\n addiu\t$a3, $a3, 4096\n.L88:\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n ori\t$v1, $v0, 0x1\n slti\t$v0, $a0, 128\n bnez\t$v0, .Lac\n nop\n sll\t$v0, $v1, 0x7\n j\t.Lc0\n addu\t$a3, $a3, $v0\n.Lac:\n nop\n mult\t$a2, $v1\n mflo\t$v0\n addu\t$v0, $a3, $v0\n andi\t$a3, $v0, 0x1fff\n.Lc0:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ADB4_2B9B4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc","sym":"func_8002B4B8_2C0B8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","fixed-point","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002B4B8_2C0B8\n andi\t$a0, $a0, 0x1fff\n andi\t$a1, $a1, 0x1fff\n subu\t$a1, $a1, $a0\n andi\t$a1, $a1, 0x1fff\n slti\t$v0, $a1, 4097\n bnez\t$v0, .L20\n move\t$v1, $a1\n ori\t$v1, $a1, 0xe000\n.L20:\n sll\t$v0, $v1, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002B4B8_2C0B8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc","sym":"func_8002BE94_2CA94","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","loop","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002BE94_2CA94\n addiu\t$sp, $sp, -40\n sw\t$s2, 32($sp)\n move\t$s2, $a0\n sw\t$ra, 36($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v0, 213($s2)\n blez\t$v0, .L48\n move\t$s1, $zero\n move\t$s0, $s2\n.L28:\n lw\t$a0, 0($s0)\n jal\tdestroySceneModel\n addiu\t$s1, $s1, 1\n sw\t$v0, 0($s0)\n lbu\t$v0, 213($s2)\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L28\n addiu\t$s0, $s0, 100\n.L48:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002BE94_2CA94 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc","sym":"func_80035F80_36B80","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","cast","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80035F80_36B80\n addiu\t$sp, $sp, -24\n andi\t$a0, $a0, 0xff\n li\t$v0, 1\n bne\t$a0, $v0, .L2c\n sw\t$ra, 16($sp)\n lui\t$a0, %hi(_459E00_ROM_START)\n addiu\t$a0, $a0, %lo(_459E00_ROM_START)\n lui\t$a1, %hi(_459E00_ROM_END)\n addiu\t$a1, $a1, %lo(_459E00_ROM_END)\n j\t.L40\n li\t$a2, 8936\n.L2c:\n lui\t$a0, %hi(_3F6950_ROM_START)\n addiu\t$a0, $a0, %lo(_3F6950_ROM_START)\n lui\t$a1, %hi(_3F6950_ROM_END)\n addiu\t$a1, $a1, %lo(_3F6950_ROM_END)\n li\t$a2, 1288\n.L40:\n jal\tloadCompressedData\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80035F80_36B80(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80035F80_36B80 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc","sym":"func_80037FE0_38BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["array","global","compare","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80037FE0_38BE0\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n andi\t$a0, $a0, 0xff\n addu\t$v0, $v0, $a0\n lbu\t$v0, 16($v0)\n xori\t$v0, $v0, 0x1\n jr\t$ra\n sltiu\t$v0, $v0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80037FE0_38BE0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038000_38C00:gcc2.7.2kmc","sym":"func_80038000_38C00","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","struct","field","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80038000_38C00\n andi\t$a0, $a0, 0xff\n sltiu\t$v0, $a0, 6\n bnez\t$v0, .L50\n li\t$v0, 1\n li\t$v0, 6\n bne\t$a0, $v0, .L2c\n li\t$v0, 7\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 78($v0)\n.L2c:\n beq\t$a0, $v0, .L44\n nop\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 80($v0)\n.L44:\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n lbu\t$v0, 79($v0)\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038000_38C00 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038090_38C90:gcc2.7.2kmc","sym":"func_80038090_38C90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","bitwise","call"],"loc":79,"refSource":"void func_80038090_38C90(s16 arg0) {\n u8 temp;\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xB) {\n EepromSaveData->setting_4E = 1;\n func_800383D8_38FD8(0xF);\n }\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xE) {\n EepromSaveData->setting_4F = 1;\n func_800383D8_38FD8(0xD);\n }\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xD) {\n if (arg0 == 7) {\n EepromSaveData->setting_50 = 1;\n func_800383D8_38FD8(0xE);\n }\n }\n\n if (D_800AFE8C_A71FC->unk24 != 0) {\n if (D_800AFE8C_A71FC->saveSlotIndex == 1) {\n if (func_80038388_38F88(0xA) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 2;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 3) {\n if (func_80038388_38F88(0xB) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 3;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 9) {\n if (func_80038388_38F88(0xC) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 4;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 5) {\n if (func_80038388_38F88(0xE) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 6;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 8) {\n if (func_80038388_38F88(0xF) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 7;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xB) {\n if (func_80038388_38F88(0x10) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 8;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 0) {\n if (func_80038388_38F88(0xD) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 5;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 4) {\n if (func_80038388_38F88(9) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 1;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 7) {\n if (func_80038388_38F88(0x11) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 9;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38C90.c#L8-L86","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:\taddiu\tsp,sp,-24\n c:\tsw\tra,20(sp)\n 10:\tsw\ts0,16(sp)\n 14:\tlbu\tv1,7(v0)\n 18:\tli\tv0,11\n 1c:\tbne\tv1,v0,3c \n 20:\tmove\ts0,a0\n 24:\tlui\tv1,0x0\n 28:\tlw\tv1,0(v1)\n 2c:\tli\ta0,15\n 30:\tli\tv0,1\n 34:\tjal\t0 \n 38:\tsb\tv0,78(v1)\n 3c:\tlui\tv0,0x0\n 40:\tlw\tv0,0(v0)\n 44:\tlbu\tv1,7(v0)\n 48:\tli\tv0,14\n 4c:\tbne\tv1,v0,68 \n 50:\tli\ta0,13\n 54:\tlui\tv1,0x0\n 58:\tlw\tv1,0(v1)\n 5c:\tli\tv0,1\n 60:\tjal\t0 \n 64:\tsb\tv0,79(v1)\n 68:\tlui\tv0,0x0\n 6c:\tlw\tv0,0(v0)\n 70:\tlbu\tv1,7(v0)\n 74:\tli\tv0,13\n 78:\tbne\tv1,v0,a4 \n 7c:\tsll\tv0,s0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tli\tv1,7\n 88:\tbne\tv0,v1,a4 \n 8c:\tli\ta0,14\n 90:\tlui\tv1,0x0\n 94:\tlw\tv1,0(v1)\n 98:\tli\tv0,1\n 9c:\tjal\t0 \n a0:\tsb\tv0,80(v1)\n a4:\tlui\tv1,0x0\n a8:\tlw\tv1,0(v1)\n ac:\tlbu\tv0,36(v1)\n b0:\tbeqz\tv0,2a0 \n b4:\tli\tv0,1\n b8:\tlbu\tv1,7(v1)\n bc:\tbne\tv1,v0,e4 \n c0:\tnop\n c4:\tjal\t0 \n c8:\tli\ta0,10\n cc:\tandi\tv0,v0,0xff\n d0:\tbeqz\tv0,e4 \n d4:\tli\tv0,2\n d8:\tlui\tv1,0x0\n dc:\tlw\tv1,0(v1)\n e0:\tsb\tv0,35(v1)\n e4:\tlui\tv0,0x0\n e8:\tlw\tv0,0(v0)\n ec:\tlbu\tv1,7(v0)\n f0:\tli\tv0,3\n f4:\tbne\tv1,v0,11c \n f8:\tnop\n fc:\tjal\t0 \n 100:\tli\ta0,11\n 104:\tandi\tv0,v0,0xff\n 108:\tbeqz\tv0,11c \n 10c:\tli\tv0,3\n 110:\tlui\tv1,0x0\n 114:\tlw\tv1,0(v1)\n 118:\tsb\tv0,35(v1)\n 11c:\tlui\tv0,0x0\n 120:\tlw\tv0,0(v0)\n 124:\tlbu\tv1,7(v0)\n 128:\tli\tv0,9\n 12c:\tbne\tv1,v0,154 \n 130:\tnop\n 134:\tjal\t0 \n 138:\tli\ta0,12\n 13c:\tandi\tv0,v0,0xff\n 140:\tbeqz\tv0,154 \n 144:\tli\tv0,4\n 148:\tlui\tv1,0x0\n 14c:\tlw\tv1,0(v1)\n 150:\tsb\tv0,35(v1)\n 154:\tlui\tv0,0x0\n 158:\tlw\tv0,0(v0)\n 15c:\tlbu\tv1,7(v0)\n 160:\tli\tv0,5\n 164:\tbne\tv1,v0,18c \n 168:\tnop\n 16c:\tjal\t0 \n 170:\tli\ta0,14\n 174:\tandi\tv0,v0,0xff\n 178:\tbeqz\tv0,18c \n 17c:\tli\tv0,6\n 180:\tlui\tv1,0x0\n 184:\tlw\tv1,0(v1)\n 188:\tsb\tv0,35(v1)\n 18c:\tlui\tv0,0x0\n 190:\tlw\tv0,0(v0)\n 194:\tlbu\tv1,7(v0)\n 198:\tli\tv0,8\n 19c:\tbne\tv1,v0,1c4 \n 1a0:\tnop\n 1a4:\tjal\t0 \n 1a8:\tli\ta0,15\n 1ac:\tandi\tv0,v0,0xff\n 1b0:\tbeqz\tv0,1c4 \n 1b4:\tli\tv0,7\n 1b8:\tlui\tv1,0x0\n 1bc:\tlw\tv1,0(v1)\n 1c0:\tsb\tv0,35(v1)\n 1c4:\tlui\tv0,0x0\n 1c8:\tlw\tv0,0(v0)\n 1cc:\tlbu\tv1,7(v0)\n 1d0:\tli\tv0,11\n 1d4:\tbne\tv1,v0,1fc \n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tli\ta0,16\n 1e4:\tandi\tv0,v0,0xff\n 1e8:\tbeqz\tv0,1fc \n 1ec:\tli\tv0,8\n 1f0:\tlui\tv1,0x0\n 1f4:\tlw\tv1,0(v1)\n 1f8:\tsb\tv0,35(v1)\n 1fc:\tlui\tv0,0x0\n 200:\tlw\tv0,0(v0)\n 204:\tlbu\tv0,7(v0)\n 208:\tbnez\tv0,230 \n 20c:\tnop\n 210:\tjal\t0 \n 214:\tli\ta0,13\n 218:\tandi\tv0,v0,0xff\n 21c:\tbeqz\tv0,230 \n 220:\tli\tv0,5\n 224:\tlui\tv1,0x0\n 228:\tlw\tv1,0(v1)\n 22c:\tsb\tv0,35(v1)\n 230:\tlui\tv0,0x0\n 234:\tlw\tv0,0(v0)\n 238:\tlbu\tv1,7(v0)\n 23c:\tli\tv0,4\n 240:\tbne\tv1,v0,268 \n 244:\tnop\n 248:\tjal\t0 \n 24c:\tli\ta0,9\n 250:\tandi\tv0,v0,0xff\n 254:\tbeqz\tv0,268 \n 258:\tli\tv0,1\n 25c:\tlui\tv1,0x0\n 260:\tlw\tv1,0(v1)\n 264:\tsb\tv0,35(v1)\n 268:\tlui\tv0,0x0\n 26c:\tlw\tv0,0(v0)\n 270:\tlbu\tv1,7(v0)\n 274:\tli\tv0,7\n 278:\tbne\tv1,v0,2a0 \n 27c:\tnop\n 280:\tjal\t0 \n 284:\tli\ta0,17\n 288:\tandi\tv0,v0,0xff\n 28c:\tbeqz\tv0,2a0 \n 290:\tli\tv0,9\n 294:\tlui\tv1,0x0\n 298:\tlw\tv1,0(v1)\n 29c:\tsb\tv0,35(v1)\n 2a0:\tlw\tra,20(sp)\n 2a4:\tlw\ts0,16(sp)\n 2a8:\tjr\tra\n 2ac:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-61ff2cd29f43.i.gz","proto":{"func_80038090_38C90":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-df837f696b53489d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000002b0 func_80038090_38C90\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n00000000 *UND*\t00000000 EepromSaveData\n00000000 *UND*\t00000000 func_800383D8_38FD8\n00000000 *UND*\t00000000 func_80038388_38F88\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800AFE8C_A71FC\n00000004 R_MIPS_LO16 D_800AFE8C_A71FC\n00000024 R_MIPS_HI16 EepromSaveData\n00000028 R_MIPS_LO16 EepromSaveData\n00000034 R_MIPS_26 func_800383D8_38FD8\n0000003c R_MIPS_HI16 D_800AFE8C_A71FC\n00000040 R_MIPS_LO16 D_800AFE8C_A71FC\n00000054 R_MIPS_HI16 EepromSaveData\n00000058 R_MIPS_LO16 EepromSaveData\n00000060 R_MIPS_26 func_800383D8_38FD8\n00000068 R_MIPS_HI16 D_800AFE8C_A71FC\n0000006c R_MIPS_LO16 D_800AFE8C_A71FC\n00000090 R_MIPS_HI16 EepromSaveData\n00000094 R_MIPS_LO16 EepromSaveData\n0000009c R_MIPS_26 func_800383D8_38FD8\n000000a4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000a8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000c4 R_MIPS_26 func_80038388_38F88\n000000d8 R_MIPS_HI16 D_800AFE8C_A71FC\n000000dc R_MIPS_LO16 D_800AFE8C_A71FC\n000000e4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000e8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000fc R_MIPS_26 func_80038388_38F88\n00000110 R_MIPS_HI16 D_800AFE8C_A71FC\n00000114 R_MIPS_LO16 D_800AFE8C_A71FC\n0000011c R_MIPS_HI16 D_800AFE8C_A71FC\n00000120 R_MIPS_LO16 D_800AFE8C_A71FC\n00000134 R_MIPS_26 func_80038388_38F88\n00000148 R_MIPS_HI16 D_800AFE8C_A71FC\n0000014c R_MIPS_LO16 D_800AFE8C_A71FC\n00000154 R_MIPS_HI16 D_800AFE8C_A71FC\n00000158 R_MIPS_LO16 D_800AFE8C_A71FC\n0000016c R_MIPS_26 func_80038388_38F88\n00000180 R_MIPS_HI16 D_800AFE8C_A71FC\n00000184 R_MIPS_LO16 D_800AFE8C_A71FC\n0000018c R_MIPS_HI16 D_800AFE8C_A71FC\n00000190 R_MIPS_LO16 D_800AFE8C_A71FC\n000001a4 R_MIPS_26 func_80038388_38F88\n000001b8 R_MIPS_HI16 D_800AFE8C_A71FC\n000001bc R_MIPS_LO16 D_800AFE8C_A71FC\n000001c4 R_MIPS_HI16 D_800AFE8C_A71FC\n000001c8 R_MIPS_LO16 D_800AFE8C_A71FC\n000001dc R_MIPS_26 func_80038388_38F88\n000001f0 R_MIPS_HI16 D_800AFE8C_A71FC\n000001f4 R_MIPS_LO16 D_800AFE8C_A71FC\n000001fc R_MIPS_HI16 D_800AFE8C_A71FC\n00000200 R_MIPS_LO16 D_800AFE8C_A71FC\n00000210 R_MIPS_26 func_80038388_38F88\n00000224 R_MIPS_HI16 D_800AFE8C_A71FC\n00000228 R_MIPS_LO16 D_800AFE8C_A71FC\n00000230 R_MIPS_HI16 D_800AFE8C_A71FC\n00000234 R_MIPS_LO16 D_800AFE8C_A71FC\n00000248 R_MIPS_26 func_80038388_38F88\n0000025c R_MIPS_HI16 D_800AFE8C_A71FC\n00000260 R_MIPS_LO16 D_800AFE8C_A71FC\n00000268 R_MIPS_HI16 D_800AFE8C_A71FC\n0000026c R_MIPS_LO16 D_800AFE8C_A71FC\n00000280 R_MIPS_26 func_80038388_38F88\n00000294 R_MIPS_HI16 D_800AFE8C_A71FC\n00000298 R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 3c020000 8c420000 27bdffe8 afbf0014 <....B..'.......\n 0010 afb00010 90430007 2402000b 14620007 .....C..$....b..\n 0020 00808021 3c030000 8c630000 2404000f ...!<....c..$...\n 0030 24020001 0c000000 a062004e 3c020000 $........b.N<...\n 0040 8c420000 90430007 2402000e 14620006 .B...C..$....b..\n 0050 2404000d 3c030000 8c630000 24020001 $...<....c..$...\n 0060 0c000000 a062004f 3c020000 8c420000 .....b.O<....B..\n 0070 90430007 2402000d 1462000a 00101400 .C..$....b......\n 0080 00021403 24030007 14430006 2404000e ....$....C..$...\n 0090 3c030000 8c630000 24020001 0c000000 <....c..$.......\n 00a0 a0620050 3c030000 8c630000 90620024 .b.P<....c...b.$\n 00b0 1040007b 24020001 90630007 14620009 .@.{$....c...b..\n 00c0 00000000 0c000000 2404000a 304200ff ........$...0B..\n 00d0 10400004 24020002 3c030000 8c630000 .@..$...<....c..\n 00e0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 00f0 24020003 14620009 00000000 0c000000 $....b..........\n 0100 2404000b 304200ff 10400004 24020003 $...0B...@..$...\n 0110 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0120 8c420000 90430007 24020009 14620009 .B...C..$....b..\n 0130 00000000 0c000000 2404000c 304200ff ........$...0B..\n 0140 10400004 24020004 3c030000 8c630000 .@..$...<....c..\n 0150 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 0160 24020005 14620009 00000000 0c000000 $....b..........\n 0170 2404000e 304200ff 10400004 24020006 $...0B...@..$...\n 0180 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0190 8c420000 90430007 24020008 14620009 .B...C..$....b..\n 01a0 00000000 0c000000 2404000f 304200ff ........$...0B..\n 01b0 10400004 24020007 3c030000 8c630000 .@..$...<....c..\n 01c0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 01d0 2402000b 14620009 00000000 0c000000 $....b..........\n 01e0 24040010 304200ff 10400004 24020008 $...0B...@..$...\n 01f0 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0200 8c420000 90420007 14400009 00000000 .B...B...@......\n 0210 0c000000 2404000d 304200ff 10400004 ....$...0B...@..\n 0220 24020005 3c030000 8c630000 a0620023 $...<....c...b.#\n 0230 3c020000 8c420000 90430007 24020004 <....B...C..$...\n 0240 14620009 00000000 0c000000 24040009 .b..........$...\n 0250 304200ff 10400004 24020001 3c030000 0B...@..$...<...\n 0260 8c630000 a0620023 3c020000 8c420000 .c...b.#<....B..\n 0270 90430007 24020007 14620009 00000000 .C..$....b......\n 0280 0c000000 24040011 304200ff 10400004 ....$...0B...@..\n 0290 24020009 3c030000 8c630000 a0620023 $...<....c...b.#\n 02a0 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_80038090_38C90' — lift: cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tv0,0x0 */\n/* 4:\tlw\tv0,0(v0) */\n/* 8:\taddiu\tsp,sp,-24 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsw\ts0,16(sp) */\n/* 14:\tlbu\tv1,7(v0) */\n/* 18:\tli\tv0,11 */\n/* 1c:\tbne\tv1,v0,3c */\n/* 20:\tmove\ts0,a0 */\n/* 24:\tlui\tv1,0x0 */\n/* 28:\tlw\tv1,0(v1) */\n/* 2c:\tli\ta0,15 */\n/* 30:\tli\tv0,1 */\n/* 34:\tjal\t0 */\n/* 38:\tsb\tv0,78(v1) */\n/* 3c:\tlui\tv0,0x0 */\n/* 40:\tlw\tv0,0(v0) */\n/* 44:\tlbu\tv1,7(v0) */\n/* 48:\tli\tv0,14 */\n/* 4c:\tbne\tv1,v0,68 */\n/* 50:\tli\ta0,13 */\n/* 54:\tlui\tv1,0x0 */\n/* 58:\tlw\tv1,0(v1) */\n/* 5c:\tli\tv0,1 */\n/* 60:\tjal\t0 */\n/* 64:\tsb\tv0,79(v1) */\n/* 68:\tlui\tv0,0x0 */\n/* 6c:\tlw\tv0,0(v0) */\n/* 70:\tlbu\tv1,7(v0) */\n/* 74:\tli\tv0,13 */\n/* 78:\tbne\tv1,v0,a4 */\n/* 7c:\tsll\tv0,s0,0x10 */\n/* 80:\tsra\tv0,v0,0x10 */\n/* 84:\tli\tv1,7 */\n/* 88:\tbne\tv0,v1,a4 */\n/* 8c:\tli\ta0,14 */\n/* 90:\tlui\tv1,0x0 */\n/* 94:\tlw\tv1,0(v1) */\n/* 98:\tli\tv0,1 */\n/* 9c:\tjal\t0 */\n/* a0:\tsb\tv0,80(v1) */\n/* a4:\tlui\tv1,0x0 */\n/* a8:\tlw\tv1,0(v1) */\n/* ac:\tlbu\tv0,36(v1) */\n/* b0:\tbeqz\tv0,2a0 */\n/* b4:\tli\tv0,1 */\n/* b8:\tlbu\tv1,7(v1) */\n/* bc:\tbne\tv1,v0,e4 */\n/* c0:\tnop */\n/* c4:\tjal\t0 */\n/* c8:\tli\ta0,10 */\n/* cc:\tandi\tv0,v0,0xff */\n/* d0:\tbeqz\tv0,e4 */\n/* d4:\tli\tv0,2 */\n/* d8:\tlui\tv1,0x0 */\n/* dc:\tlw\tv1,0(v1) */\n/* e0:\tsb\tv0,35(v1) */\n/* e4:\tlui\tv0,0x0 */\n/* e8:\tlw\tv0,0(v0) */\n/* ec:\tlbu\tv1,7(v0) */\n/* f0:\tli\tv0,3 */\n/* f4:\tbne\tv1,v0,11c */\n/* f8:\tnop */\n/* fc:\tjal\t0 */\n/* 100:\tli\ta0,11 */\n/* 104:\tandi\tv0,v0,0xff */\n/* 108:\tbeqz\tv0,11c */\n/* 10c:\tli\tv0,3 */\n/* 110:\tlui\tv1,0x0 */\n/* 114:\tlw\tv1,0(v1) */\n/* 118:\tsb\tv0,35(v1) */\n/* 11c:\tlui\tv0,0x0 */\n/* 120:\tlw\tv0,0(v0) */\n/* 124:\tlbu\tv1,7(v0) */\n/* 128:\tli\tv0,9 */\n/* 12c:\tbne\tv1,v0,154 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tli\ta0,12 */\n/* 13c:\tandi\tv0,v0,0xff */\n/* 140:\tbeqz\tv0,154 */\n/* 144:\tli\tv0,4 */\n/* 148:\tlui\tv1,0x0 */\n/* 14c:\tlw\tv1,0(v1) */\n/* 150:\tsb\tv0,35(v1) */\n/* 154:\tlui\tv0,0x0 */\n/* 158:\tlw\tv0,0(v0) */\n/* 15c:\tlbu\tv1,7(v0) */\n/* 160:\tli\tv0,5 */\n/* 164:\tbne\tv1,v0,18c */\n/* 168:\tnop */\n/* 16c:\tjal\t0 */\n/* 170:\tli\ta0,14 */\n/* 174:\tandi\tv0,v0,0xff */\n/* 178:\tbeqz\tv0,18c */\n/* 17c:\tli\tv0,6 */\n/* 180:\tlui\tv1,0x0 */\n/* 184:\tlw\tv1,0(v1) */\n/* 188:\tsb\tv0,35(v1) */\n/* 18c:\tlui\tv0,0x0 */\n/* 190:\tlw\tv0,0(v0) */\n/* 194:\tlbu\tv1,7(v0) */\n/* 198:\tli\tv0,8 */\n/* 19c:\tbne\tv1,v0,1c4 */\n/* 1a0:\tnop */\n/* 1a4:\tjal\t0 */\n/* 1a8:\tli\ta0,15 */\n/* 1ac:\tandi\tv0,v0,0xff */\n/* 1b0:\tbeqz\tv0,1c4 */\n/* 1b4:\tli\tv0,7 */\n/* 1b8:\tlui\tv1,0x0 */\n/* 1bc:\tlw\tv1,0(v1) */\n/* 1c0:\tsb\tv0,35(v1) */\n/* 1c4:\tlui\tv0,0x0 */\n/* 1c8:\tlw\tv0,0(v0) */\n/* 1cc:\tlbu\tv1,7(v0) */\n/* 1d0:\tli\tv0,11 */\n/* 1d4:\tbne\tv1,v0,1fc */\n/* 1d8:\tnop */\n/* 1dc:\tjal\t0 */\n/* 1e0:\tli\ta0,16 */\n/* 1e4:\tandi\tv0,v0,0xff */\n/* 1e8:\tbeqz\tv0,1fc */\n/* 1ec:\tli\tv0,8 */\n/* 1f0:\tlui\tv1,0x0 */\n/* 1f4:\tlw\tv1,0(v1) */\n/* 1f8:\tsb\tv0,35(v1) */\n/* 1fc:\tlui\tv0,0x0 */\n/* 200:\tlw\tv0,0(v0) */\n/* 204:\tlbu\tv0,7(v0) */\n/* 208:\tbnez\tv0,230 */\n/* 20c:\tnop */\n/* 210:\tjal\t0 */\n/* 214:\tli\ta0,13 */\n/* 218:\tandi\tv0,v0,0xff */\n/* 21c:\tbeqz\tv0,230 */\n/* 220:\tli\tv0,5 */\n/* 224:\tlui\tv1,0x0 */\n/* 228:\tlw\tv1,0(v1) */\n/* 22c:\tsb\tv0,35(v1) */\n/* 230:\tlui\tv0,0x0 */\n/* 234:\tlw\tv0,0(v0) */\n/* 238:\tlbu\tv1,7(v0) */\n/* 23c:\tli\tv0,4 */\n/* 240:\tbne\tv1,v0,268 */\n/* 244:\tnop */\n/* 248:\tjal\t0 */\n/* 24c:\tli\ta0,9 */\n/* 250:\tandi\tv0,v0,0xff */\n/* 254:\tbeqz\tv0,268 */\n/* 258:\tli\tv0,1 */\n/* 25c:\tlui\tv1,0x0 */\n/* 260:\tlw\tv1,0(v1) */\n/* 264:\tsb\tv0,35(v1) */\n/* 268:\tlui\tv0,0x0 */\n/* 26c:\tlw\tv0,0(v0) */\n/* 270:\tlbu\tv1,7(v0) */\n/* 274:\tli\tv0,7 */\n/* 278:\tbne\tv1,v0,2a0 */\n/* 27c:\tnop */\n/* 280:\tjal\t0 */\n/* 284:\tli\ta0,17 */\n/* 288:\tandi\tv0,v0,0xff */\n/* 28c:\tbeqz\tv0,2a0 */\n/* 290:\tli\tv0,9 */\n/* 294:\tlui\tv1,0x0 */\n/* 298:\tlw\tv1,0(v1) */\n/* 29c:\tsb\tv0,35(v1) */\n/* 2a0:\tlw\tra,20(sp) */\n/* 2a4:\tlw\ts0,16(sp) */\n/* 2a8:\tjr\tra */\n/* 2ac:\taddiu\tsp,sp,24 */\nvoid func_80038090_38C90(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":180,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 func_80038388_38F88(?); /* extern */\n? func_800383D8_38FD8(?); /* extern */\n\nvoid func_80038090_38C90(s16 arg0) {\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xB) {\n EepromSaveData->setting_4E = 1;\n func_800383D8_38FD8(0xF);\n }\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xE) {\n EepromSaveData->setting_4F = 1;\n func_800383D8_38FD8(0xD);\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0xD) && (arg0 == 7)) {\n EepromSaveData->setting_50 = 1;\n func_800383D8_38FD8(0xE);\n }\n if (D_800AFE8C_A71FC->unk24 != 0) {\n if ((D_800AFE8C_A71FC->saveSlotIndex == 1) && (func_80038388_38F88(0xA) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 2;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 3) && (func_80038388_38F88(0xB) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 3;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 9) && (func_80038388_38F88(0xC) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 4;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 5) && (func_80038388_38F88(0xE) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 6;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 8) && (func_80038388_38F88(0xF) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 7;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0xB) && (func_80038388_38F88(0x10) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 8;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0) && (func_80038388_38F88(0xD) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 5;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 4) && (func_80038388_38F88(9) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 1;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 7) && (func_80038388_38F88(0x11) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 9;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":45,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80038090_38C90` — benchmark function snowboardkids2:func_80038090_38C90:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_80038090_38C90\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$s0, 16($sp)\n lbu\t$v1, 7($v0)\n li\t$v0, 11\n bne\t$v1, $v0, .L3c\n move\t$s0, $a0\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$a0, 15\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 78($v1)\n.L3c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 14\n bne\t$v1, $v0, .L68\n li\t$a0, 13\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 79($v1)\n.L68:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 13\n bne\t$v1, $v0, .La4\n sll\t$v0, $s0, 0x10\n sra\t$v0, $v0, 0x10\n li\t$v1, 7\n bne\t$v0, $v1, .La4\n li\t$a0, 14\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 80($v1)\n.La4:\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n lbu\t$v0, 36($v1)\n beqz\t$v0, .L2a0\n li\t$v0, 1\n lbu\t$v1, 7($v1)\n bne\t$v1, $v0, .Le4\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 10\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .Le4\n li\t$v0, 2\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.Le4:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 3\n bne\t$v1, $v0, .L11c\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 11\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L11c\n li\t$v0, 3\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L11c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 9\n bne\t$v1, $v0, .L154\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 12\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L154\n li\t$v0, 4\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L154:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 5\n bne\t$v1, $v0, .L18c\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 14\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L18c\n li\t$v0, 6\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L18c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 8\n bne\t$v1, $v0, .L1c4\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 15\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L1c4\n li\t$v0, 7\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L1c4:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 11\n bne\t$v1, $v0, .L1fc\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 16\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L1fc\n li\t$v0, 8\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L1fc:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 7($v0)\n bnez\t$v0, .L230\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 13\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L230\n li\t$v0, 5\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L230:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 4\n bne\t$v1, $v0, .L268\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 9\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L268\n li\t$v0, 1\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L268:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 7\n bne\t$v1, $v0, .L2a0\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 17\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L2a0\n li\t$v0, 9\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L2a0:\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-61ff2cd29f43.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80038090_38C90(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038090_38C90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038090_38C90` — benchmark function snowboardkids2:func_80038090_38C90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038090_38C90: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:\taddiu\tsp,sp,-24\n c:\tsw\tra,20(sp)\n 10:\tsw\ts0,16(sp)\n 14:\tlbu\tv1,7(v0)\n 18:\tli\tv0,11\n 1c:\tbne\tv1,v0,3c \n 20:\tmove\ts0,a0\n 24:\tlui\tv1,0x0\n 28:\tlw\tv1,0(v1)\n 2c:\tli\ta0,15\n 30:\tli\tv0,1\n 34:\tjal\t0 \n 38:\tsb\tv0,78(v1)\n 3c:\tlui\tv0,0x0\n 40:\tlw\tv0,0(v0)\n 44:\tlbu\tv1,7(v0)\n 48:\tli\tv0,14\n 4c:\tbne\tv1,v0,68 \n 50:\tli\ta0,13\n 54:\tlui\tv1,0x0\n 58:\tlw\tv1,0(v1)\n 5c:\tli\tv0,1\n 60:\tjal\t0 \n 64:\tsb\tv0,79(v1)\n 68:\tlui\tv0,0x0\n 6c:\tlw\tv0,0(v0)\n 70:\tlbu\tv1,7(v0)\n 74:\tli\tv0,13\n 78:\tbne\tv1,v0,a4 \n 7c:\tsll\tv0,s0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tli\tv1,7\n 88:\tbne\tv0,v1,a4 \n 8c:\tli\ta0,14\n 90:\tlui\tv1,0x0\n 94:\tlw\tv1,0(v1)\n 98:\tli\tv0,1\n 9c:\tjal\t0 \n a0:\tsb\tv0,80(v1)\n a4:\tlui\tv1,0x0\n a8:\tlw\tv1,0(v1)\n ac:\tlbu\tv0,36(v1)\n b0:\tbeqz\tv0,2a0 \n b4:\tli\tv0,1\n b8:\tlbu\tv1,7(v1)\n bc:\tbne\tv1,v0,e4 \n c0:\tnop\n c4:\tjal\t0 \n c8:\tli\ta0,10\n cc:\tandi\tv0,v0,0xff\n d0:\tbeqz\tv0,e4 \n d4:\tli\tv0,2\n d8:\tlui\tv1,0x0\n dc:\tlw\tv1,0(v1)\n e0:\tsb\tv0,35(v1)\n e4:\tlui\tv0,0x0\n e8:\tlw\tv0,0(v0)\n ec:\tlbu\tv1,7(v0)\n f0:\tli\tv0,3\n f4:\tbne\tv1,v0,11c \n f8:\tnop\n fc:\tjal\t0 \n 100:\tli\ta0,11\n 104:\tandi\tv0,v0,0xff\n 108:\tbeqz\tv0,11c \n 10c:\tli\tv0,3\n 110:\tlui\tv1,0x0\n 114:\tlw\tv1,0(v1)\n 118:\tsb\tv0,35(v1)\n 11c:\tlui\tv0,0x0\n 120:\tlw\tv0,0(v0)\n 124:\tlbu\tv1,7(v0)\n 128:\tli\tv0,9\n 12c:\tbne\tv1,v0,154 \n 130:\tnop\n 134:\tjal\t0 \n 138:\tli\ta0,12\n 13c:\tandi\tv0,v0,0xff\n 140:\tbeqz\tv0,154 \n 144:\tli\tv0,4\n 148:\tlui\tv1,0x0\n 14c:\tlw\tv1,0(v1)\n 150:\tsb\tv0,35(v1)\n 154:\tlui\tv0,0x0\n 158:\tlw\tv0,0(v0)\n 15c:\tlbu\tv1,7(v0)\n 160:\tli\tv0,5\n 164:\tbne\tv1,v0,18c \n 168:\tnop\n 16c:\tjal\t0 \n 170:\tli\ta0,14\n 174:\tandi\tv0,v0,0xff\n 178:\tbeqz\tv0,18c \n 17c:\tli\tv0,6\n 180:\tlui\tv1,0x0\n 184:\tlw\tv1,0(v1)\n 188:\tsb\tv0,35(v1)\n 18c:\tlui\tv0,0x0\n 190:\tlw\tv0,0(v0)\n 194:\tlbu\tv1,7(v0)\n 198:\tli\tv0,8\n 19c:\tbne\tv1,v0,1c4 \n 1a0:\tnop\n 1a4:\tjal\t0 \n 1a8:\tli\ta0,15\n 1ac:\tandi\tv0,v0,0xff\n 1b0:\tbeqz\tv0,1c4 \n 1b4:\tli\tv0,7\n 1b8:\tlui\tv1,0x0\n 1bc:\tlw\tv1,0(v1)\n 1c0:\tsb\tv0,35(v1)\n 1c4:\tlui\tv0,0x0\n 1c8:\tlw\tv0,0(v0)\n 1cc:\tlbu\tv1,7(v0)\n 1d0:\tli\tv0,11\n 1d4:\tbne\tv1,v0,1fc \n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tli\ta0,16\n 1e4:\tandi\tv0,v0,0xff\n 1e8:\tbeqz\tv0,1fc \n 1ec:\tli\tv0,8\n 1f0:\tlui\tv1,0x0\n 1f4:\tlw\tv1,0(v1)\n 1f8:\tsb\tv0,35(v1)\n 1fc:\tlui\tv0,0x0\n 200:\tlw\tv0,0(v0)\n 204:\tlbu\tv0,7(v0)\n 208:\tbnez\tv0,230 \n 20c:\tnop\n 210:\tjal\t0 \n 214:\tli\ta0,13\n 218:\tandi\tv0,v0,0xff\n 21c:\tbeqz\tv0,230 \n 220:\tli\tv0,5\n 224:\tlui\tv1,0x0\n 228:\tlw\tv1,0(v1)\n 22c:\tsb\tv0,35(v1)\n 230:\tlui\tv0,0x0\n 234:\tlw\tv0,0(v0)\n 238:\tlbu\tv1,7(v0)\n 23c:\tli\tv0,4\n 240:\tbne\tv1,v0,268 \n 244:\tnop\n 248:\tjal\t0 \n 24c:\tli\ta0,9\n 250:\tandi\tv0,v0,0xff\n 254:\tbeqz\tv0,268 \n 258:\tli\tv0,1\n 25c:\tlui\tv1,0x0\n 260:\tlw\tv1,0(v1)\n 264:\tsb\tv0,35(v1)\n 268:\tlui\tv0,0x0\n 26c:\tlw\tv0,0(v0)\n 270:\tlbu\tv1,7(v0)\n 274:\tli\tv0,7\n 278:\tbne\tv1,v0,2a0 \n 27c:\tnop\n 280:\tjal\t0 \n 284:\tli\ta0,17\n 288:\tandi\tv0,v0,0xff\n 28c:\tbeqz\tv0,2a0 \n 290:\tli\tv0,9\n 294:\tlui\tv1,0x0\n 298:\tlw\tv1,0(v1)\n 29c:\tsb\tv0,35(v1)\n 2a0:\tlw\tra,20(sp)\n 2a4:\tlw\ts0,16(sp)\n 2a8:\tjr\tra\n 2ac:\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-df837f696b53489d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000002b0 func_80038090_38C90\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n00000000 *UND*\t00000000 EepromSaveData\n00000000 *UND*\t00000000 func_800383D8_38FD8\n00000000 *UND*\t00000000 func_80038388_38F88\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800AFE8C_A71FC\n00000004 R_MIPS_LO16 D_800AFE8C_A71FC\n00000024 R_MIPS_HI16 EepromSaveData\n00000028 R_MIPS_LO16 EepromSaveData\n00000034 R_MIPS_26 func_800383D8_38FD8\n0000003c R_MIPS_HI16 D_800AFE8C_A71FC\n00000040 R_MIPS_LO16 D_800AFE8C_A71FC\n00000054 R_MIPS_HI16 EepromSaveData\n00000058 R_MIPS_LO16 EepromSaveData\n00000060 R_MIPS_26 func_800383D8_38FD8\n00000068 R_MIPS_HI16 D_800AFE8C_A71FC\n0000006c R_MIPS_LO16 D_800AFE8C_A71FC\n00000090 R_MIPS_HI16 EepromSaveData\n00000094 R_MIPS_LO16 EepromSaveData\n0000009c R_MIPS_26 func_800383D8_38FD8\n000000a4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000a8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000c4 R_MIPS_26 func_80038388_38F88\n000000d8 R_MIPS_HI16 D_800AFE8C_A71FC\n000000dc R_MIPS_LO16 D_800AFE8C_A71FC\n000000e4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000e8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000fc R_MIPS_26 func_80038388_38F88\n00000110 R_MIPS_HI16 D_800AFE8C_A71FC\n00000114 R_MIPS_LO16 D_800AFE8C_A71FC\n0000011c R_MIPS_HI16 D_800AFE8C_A71FC\n00000120 R_MIPS_LO16 D_800AFE8C_A71FC\n00000134 R_MIPS_26 func_80038388_38F88\n00000148 R_MIPS_HI16 D_800AFE8C_A71FC\n0000014c R_MIPS_LO16 D_800AFE8C_A71FC\n00000154 R_MIPS_HI16 D_800AFE8C_A71FC\n00000158 R_MIPS_LO16 D_800AFE8C_A71FC\n0000016c R_MIPS_26 func_80038388_38F88\n00000180 R_MIPS_HI16 D_800AFE8C_A71FC\n00000184 R_MIPS_LO16 D_800AFE8C_A71FC\n0000018c R_MIPS_HI16 D_800AFE8C_A71FC\n00000190 R_MIPS_LO16 D_800AFE8C_A71FC\n000001a4 R_MIPS_26 func_80038388_38F88\n000001b8 R_MIPS_HI16 D_800AFE8C_A71FC\n000001bc R_MIPS_LO16 D_800AFE8C_A71FC\n000001c4 R_MIPS_HI16 D_800AFE8C_A71FC\n000001c8 R_MIPS_LO16 D_800AFE8C_A71FC\n000001dc R_MIPS_26 func_80038388_38F88\n000001f0 R_MIPS_HI16 D_800AFE8C_A71FC\n000001f4 R_MIPS_LO16 D_800AFE8C_A71FC\n000001fc R_MIPS_HI16 D_800AFE8C_A71FC\n00000200 R_MIPS_LO16 D_800AFE8C_A71FC\n00000210 R_MIPS_26 func_80038388_38F88\n00000224 R_MIPS_HI16 D_800AFE8C_A71FC\n00000228 R_MIPS_LO16 D_800AFE8C_A71FC\n00000230 R_MIPS_HI16 D_800AFE8C_A71FC\n00000234 R_MIPS_LO16 D_800AFE8C_A71FC\n00000248 R_MIPS_26 func_80038388_38F88\n0000025c R_MIPS_HI16 D_800AFE8C_A71FC\n00000260 R_MIPS_LO16 D_800AFE8C_A71FC\n00000268 R_MIPS_HI16 D_800AFE8C_A71FC\n0000026c R_MIPS_LO16 D_800AFE8C_A71FC\n00000280 R_MIPS_26 func_80038388_38F88\n00000294 R_MIPS_HI16 D_800AFE8C_A71FC\n00000298 R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 3c020000 8c420000 27bdffe8 afbf0014 <....B..'.......\n 0010 afb00010 90430007 2402000b 14620007 .....C..$....b..\n 0020 00808021 3c030000 8c630000 2404000f ...!<....c..$...\n 0030 24020001 0c000000 a062004e 3c020000 $........b.N<...\n 0040 8c420000 90430007 2402000e 14620006 .B...C..$....b..\n 0050 2404000d 3c030000 8c630000 24020001 $...<....c..$...\n 0060 0c000000 a062004f 3c020000 8c420000 .....b.O<....B..\n 0070 90430007 2402000d 1462000a 00101400 .C..$....b......\n 0080 00021403 24030007 14430006 2404000e ....$....C..$...\n 0090 3c030000 8c630000 24020001 0c000000 <....c..$.......\n 00a0 a0620050 3c030000 8c630000 90620024 .b.P<....c...b.$\n 00b0 1040007b 24020001 90630007 14620009 .@.{$....c...b..\n 00c0 00000000 0c000000 2404000a 304200ff ........$...0B..\n 00d0 10400004 24020002 3c030000 8c630000 .@..$...<....c..\n 00e0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 00f0 24020003 14620009 00000000 0c000000 $....b..........\n 0100 2404000b 304200ff 10400004 24020003 $...0B...@..$...\n 0110 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0120 8c420000 90430007 24020009 14620009 .B...C..$....b..\n 0130 00000000 0c000000 2404000c 304200ff ........$...0B..\n 0140 10400004 24020004 3c030000 8c630000 .@..$...<....c..\n 0150 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 0160 24020005 14620009 00000000 0c000000 $....b..........\n 0170 2404000e 304200ff 10400004 24020006 $...0B...@..$...\n 0180 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0190 8c420000 90430007 24020008 14620009 .B...C..$....b..\n 01a0 00000000 0c000000 2404000f 304200ff ........$...0B..\n 01b0 10400004 24020007 3c030000 8c630000 .@..$...<....c..\n 01c0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 01d0 2402000b 14620009 00000000 0c000000 $....b..........\n 01e0 24040010 304200ff 10400004 24020008 $...0B...@..$...\n 01f0 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0200 8c420000 90420007 14400009 00000000 .B...B...@......\n 0210 0c000000 2404000d 304200ff 10400004 ....$...0B...@..\n 0220 24020005 3c030000 8c630000 a0620023 $...<....c...b.#\n 0230 3c020000 8c420000 90430007 24020004 <....B...C..$...\n 0240 14620009 00000000 0c000000 24040009 .b..........$...\n 0250 304200ff 10400004 24020001 3c030000 0B...@..$...<...\n 0260 8c630000 a0620023 3c020000 8c420000 .c...b.#<....B..\n 0270 90430007 24020007 14620009 00000000 .C..$....b......\n 0280 0c000000 24040011 304200ff 10400004 ....$...0B...@..\n 0290 24020009 3c030000 8c630000 a0620023 $...<....c...b.#\n 02a0 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_80038090_38C90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_80038090_38C90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","array","call","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80051C80_52880\n addiu\t$sp, $sp, -64\n sw\t$s3, 52($sp)\n move\t$s3, $a0\n sw\t$s4, 56($sp)\n move\t$s4, $a1\n sw\t$ra, 60($sp)\n sw\t$s2, 48($sp)\n sw\t$s1, 44($sp)\n sw\t$s0, 40($sp)\n lw\t$a0, 0($s3)\n jal\tdistance_2d\n lw\t$a1, 8($s3)\n move\t$v1, $v0\n lui\t$v0, 0x1\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .Lb4\n nop\n beqz\t$v1, .Lac\n lui\t$s2, 0x2\n lw\t$v0, 0($s3)\n mult\t$v0, $s2\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 8($s3)\n mult\t$a0, $s2\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n j\t.Lb4\n sw\t$v1, 8($s3)\n.Lac:\n lui\t$v0, 0x2\n sw\t$v0, 8($s3)\n.Lb4:\n lw\t$a0, 0($s3)\n lw\t$a1, 4($s3)\n jal\tdistance_3d\n lw\t$a2, 8($s3)\n move\t$v1, $v0\n beqz\t$v1, .L14c\n move\t$s1, $v1\n lw\t$v0, 0($s3)\n mult\t$v0, $s4\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 4($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n lw\t$a0, 8($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 4($s3)\n sw\t$v1, 8($s3)\n.L14c:\n lw\t$ra, 60($sp)\n lw\t$s4, 56($sp)\n lw\t$s3, 52($sp)\n lw\t$s2, 48($sp)\n lw\t$s1, 44($sp)\n lw\t$s0, 40($sp)\n jr\t$ra\n addiu\t$sp, $sp, 64\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80051C80_52880 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc","sym":"func_8005AB58_5B758","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["int64","memory","struct","arithmetic","loop","bitwise","call","magic-div"],"loc":82,"refSource":"void func_8005AB58_5B758(Player *player) {\n Vec3i deltaPos;\n GameState *allocation;\n s32 unused1;\n s32 combinedRadius;\n s32 playerIndex;\n Player *targetPlayer;\n s32 numPlayers;\n\n allocation = (GameState *)getCurrentAllocation();\n numPlayers = allocation->numPlayers;\n\n for (playerIndex = 0; playerIndex < allocation->numPlayers; playerIndex++) {\n targetPlayer = &allocation->players[playerIndex];\n\n /* Skip collision if players are on the same team */\n if (player->unkBB8 == targetPlayer->unkBB8) {\n continue;\n }\n\n /* Skip if either player has collision disabled (flag 0x10) */\n if (player->unkB88 & 0x10) {\n continue;\n }\n if (targetPlayer->unkB88 & 0x10) {\n continue;\n }\n\n /* Copy target's collision box local position */\n memcpy(&deltaPos, &targetPlayer->unkAD4, 0xC);\n\n /* Convert to world space */\n deltaPos.x += targetPlayer->worldPos.x;\n deltaPos.y += targetPlayer->worldPos.y;\n deltaPos.z += targetPlayer->worldPos.z;\n\n /* Calculate relative position to player's collision box */\n deltaPos.x -= player->worldPos.x + player->unkAD4[0];\n deltaPos.y -= player->worldPos.y + player->unkAD4[1];\n deltaPos.z -= player->worldPos.z + player->unkAD4[2];\n\n /* Sum of both collision box radii */\n combinedRadius = targetPlayer->unkAE0 + player->unkAE0;\n\n /* Quick AABB check before expensive distance calculation */\n if (-combinedRadius < deltaPos.x && deltaPos.x < combinedRadius && -combinedRadius < deltaPos.y &&\n deltaPos.y < combinedRadius && -combinedRadius < deltaPos.z && deltaPos.z < combinedRadius) {\n s32 dist;\n\n dist = isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.y * deltaPos.y + (s64)deltaPos.z * deltaPos.z);\n\n if (dist < combinedRadius) {\n /* Avoid divide by zero */\n if (dist == 0) {\n dist = 1;\n }\n\n /* Calculate push vector to separate the players */\n deltaPos.x = ((s64)deltaPos.x * combinedRadius / dist) - deltaPos.x;\n deltaPos.y = ((s64)deltaPos.y * combinedRadius / dist) - deltaPos.y;\n deltaPos.z = ((s64)deltaPos.z * combinedRadius / dist) - deltaPos.z;\n\n /* Skip push if player has flag 0x80 */\n if (player->unkB84 & 0x80) {\n continue;\n }\n\n /* If target has flag 0x80, do full push */\n if (targetPlayer->unkB84 & 0x80) {\n player->worldPos.x -= deltaPos.x;\n player->worldPos.y -= deltaPos.y;\n player->worldPos.z -= deltaPos.z;\n } else {\n /* Half push */\n player->worldPos.x -= deltaPos.x / 2;\n player->worldPos.y -= deltaPos.y / 2;\n player->worldPos.z -= deltaPos.z / 2;\n }\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5AA90.c#L128-L209","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-104\n 4:\tsw\ts6,88(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,100(sp)\n 10:\tsw\ts8,96(sp)\n 14:\tsw\ts7,92(sp)\n 18:\tsw\ts5,84(sp)\n 1c:\tsw\ts4,80(sp)\n 20:\tsw\ts3,76(sp)\n 24:\tsw\ts2,72(sp)\n 28:\tsw\ts1,68(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,64(sp)\n 34:\tsw\tv0,36(sp)\n 38:\tlbu\tv0,94(v0)\n 3c:\tblez\tv0,304 \n 40:\tmove\ts8,zero\n 44:\tsw\tzero,52(sp)\n 48:\tlw\tt0,36(sp)\n 4c:\tlw\tt1,52(sp)\n 50:\tlw\tv0,16(t0)\n 54:\tlbu\tv1,3000(s6)\n 58:\taddu\ts7,v0,t1\n 5c:\tlbu\tv0,3000(s7)\n 60:\tbeq\tv1,v0,2ec \n 64:\tnop\n 68:\tlw\tv0,2952(s6)\n 6c:\tandi\tv0,v0,0x10\n 70:\tbnez\tv0,2ec \n 74:\tnop\n 78:\tlw\tv0,2952(s7)\n 7c:\tandi\tv0,v0,0x10\n 80:\tbnez\tv0,2ec \n 84:\taddiu\ta0,sp,16\n 88:\taddiu\ta1,s7,2772\n 8c:\tjal\t0 \n 90:\tli\ta2,12\n 94:\tlw\ta0,16(sp)\n 98:\tlw\tv0,1076(s7)\n 9c:\tlw\ta1,20(sp)\n a0:\taddu\ta0,a0,v0\n a4:\tsw\ta0,16(sp)\n a8:\tlw\tv0,1080(s7)\n ac:\tlw\ta2,24(sp)\n b0:\taddu\ta1,a1,v0\n b4:\tsw\ta1,20(sp)\n b8:\tlw\tv0,1084(s7)\n bc:\taddu\ta2,a2,v0\n c0:\tsw\ta2,24(sp)\n c4:\tlw\tv0,1076(s6)\n c8:\tlw\tv1,2772(s6)\n cc:\taddu\tv0,v0,v1\n d0:\tsubu\ta0,a0,v0\n d4:\tsw\ta0,16(sp)\n d8:\tlw\tv0,1080(s6)\n dc:\tlw\tv1,2776(s6)\n e0:\taddu\tv0,v0,v1\n e4:\tsubu\ta3,a1,v0\n e8:\tsw\ta3,20(sp)\n ec:\tlw\tv0,1084(s6)\n f0:\tlw\tv1,2780(s6)\n f4:\taddu\tv0,v0,v1\n f8:\tsubu\ta2,a2,v0\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2784(s7)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,2e4 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,2e4 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,2e4 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,2e4 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,2e4 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,2e4 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,56(sp)\n 170:\tsw\tt1,60(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\tv1,v0\n 1a4:\tslt\tv0,v1,s5\n 1a8:\tbeqz\tv0,2e4 \n 1ac:\tnop\n 1b0:\tbeqzl\tv1,1b8 \n 1b4:\tli\tv1,1\n 1b8:\tlw\ts4,16(sp)\n 1bc:\tmult\ts4,s5\n 1c0:\tmove\ts1,v1\n 1c4:\tsra\ts0,v1,0x1f\n 1c8:\tlw\ts3,20(sp)\n 1cc:\tmfhi\ta0\n 1d0:\tmflo\ta1\n 1d4:\tmove\ta2,s0\n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tmove\ta3,s1\n 1e4:\tnop\n 1e8:\tmult\ts3,s5\n 1ec:\tmove\ta2,s0\n 1f0:\tmove\ta3,s1\n 1f4:\tlw\ts2,24(sp)\n 1f8:\tmfhi\ta0\n 1fc:\tmflo\ta1\n\t...\n 208:\tjal\t0 \n 20c:\tsubu\ts4,v1,s4\n 210:\tnop\n 214:\tmult\ts2,s5\n 218:\tmove\ta2,s0\n 21c:\tmove\ta3,s1\n 220:\tsubu\ts3,v1,s3\n 224:\tsw\ts4,16(sp)\n 228:\tmfhi\ta0\n 22c:\tmflo\ta1\n\t...\n 238:\tjal\t0 \n 23c:\tsw\ts3,20(sp)\n 240:\tsubu\ts2,v1,s2\n 244:\tsw\ts2,24(sp)\n 248:\tlw\tv0,2948(s6)\n 24c:\tandi\tv0,v0,0x80\n 250:\tbnez\tv0,2e4 \n 254:\tnop\n 258:\tlw\tv0,2948(s7)\n 25c:\tandi\tv0,v0,0x80\n 260:\tbeqz\tv0,298 \n 264:\tsrl\tv0,s4,0x1f\n 268:\tlw\tv0,1076(s6)\n 26c:\tsubu\tv0,v0,s4\n 270:\tsw\tv0,1076(s6)\n 274:\tlw\tv0,1080(s6)\n 278:\tlw\tv1,20(sp)\n 27c:\tsubu\tv0,v0,v1\n 280:\tsw\tv0,1080(s6)\n 284:\tlw\tv0,1084(s6)\n 288:\tlw\tv1,24(sp)\n 28c:\tsubu\tv0,v0,v1\n 290:\tj\t2e4 \n 294:\tsw\tv0,1084(s6)\n 298:\tlw\tv1,1076(s6)\n 29c:\taddu\tv0,s4,v0\n 2a0:\tsra\tv0,v0,0x1\n 2a4:\tsubu\tv1,v1,v0\n 2a8:\tsw\tv1,1076(s6)\n 2ac:\tlw\tv0,20(sp)\n 2b0:\tlw\tv1,1080(s6)\n 2b4:\tsrl\ta0,v0,0x1f\n 2b8:\taddu\tv0,v0,a0\n 2bc:\tsra\tv0,v0,0x1\n 2c0:\tsubu\tv1,v1,v0\n 2c4:\tsw\tv1,1080(s6)\n 2c8:\tlw\tv0,24(sp)\n 2cc:\tlw\tv1,1084(s6)\n 2d0:\tsrl\ta0,v0,0x1f\n 2d4:\taddu\tv0,v0,a0\n 2d8:\tsra\tv0,v0,0x1\n 2dc:\tsubu\tv1,v1,v0\n 2e0:\tsw\tv1,1084(s6)\n 2e4:\tlw\tt0,36(sp)\n 2e8:\tlw\tt1,52(sp)\n 2ec:\tlbu\tv0,94(t0)\n 2f0:\taddiu\ts8,s8,1\n 2f4:\taddiu\tt1,t1,3048\n 2f8:\tslt\tv0,s8,v0\n 2fc:\tbnez\tv0,48 \n 300:\tsw\tt1,52(sp)\n 304:\tlw\tra,100(sp)\n 308:\tlw\ts8,96(sp)\n 30c:\tlw\ts7,92(sp)\n 310:\tlw\ts6,88(sp)\n 314:\tlw\ts5,84(sp)\n 318:\tlw\ts4,80(sp)\n 31c:\tlw\ts3,76(sp)\n 320:\tlw\ts2,72(sp)\n 324:\tlw\ts1,68(sp)\n 328:\tlw\ts0,64(sp)\n 32c:\tjr\tra\n 330:\taddiu\tsp,sp,104\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-3c0ef0b3e2c0.i.gz","proto":{"func_8005AB58_5B758":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-9c00ae27ec8e5d7c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t00000334 func_8005AB58_5B758\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n0000008c R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n000001dc R_MIPS_26 __divdi3\n00000208 R_MIPS_26 __divdi3\n00000238 R_MIPS_26 __divdi3\n00000290 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdff98 afb60058 0080b021 afbf0064 '......X...!...d\n 0010 afbe0060 afb7005c afb50054 afb40050 ...`...\\...T...P\n 0020 afb3004c afb20048 afb10044 0c000000 ...L...H...D....\n 0030 afb00040 afa20024 9042005e 184000b1 ...@...$.B.^.@..\n 0040 0000f021 afa00034 8fa80024 8fa90034 ...!...4...$...4\n 0050 8d020010 92c30bb8 0049b821 92e20bb8 .........I.!....\n 0060 106200a2 00000000 8ec20b88 30420010 .b..........0B..\n 0070 1440009e 00000000 8ee20b88 30420010 .@..........0B..\n 0080 1440009a 27a40010 26e50ad4 0c000000 .@..'...&.......\n 0090 2406000c 8fa40010 8ee20434 8fa50014 $..........4....\n 00a0 00822021 afa40010 8ee20438 8fa60018 .. !.......8....\n 00b0 00a22821 afa50014 8ee2043c 00c23021 ..(!.......<..0!\n 00c0 afa60018 8ec20434 8ec30ad4 00431021 .......4.....C.!\n 00d0 00822023 afa40010 8ec20438 8ec30ad8 .. #.......8....\n 00e0 00431021 00a23823 afa70014 8ec2043c .C.!..8#.......<\n 00f0 8ec30adc 00431021 00c23023 afa60018 .....C.!..0#....\n 0100 8ee30ae0 8ec20ae0 0062a821 00151823 .........b.!...#\n 0110 0064102a 10400073 0095102a 10400071 .d.*.@.s...*.@.q\n 0120 0067102a 1040006f 00f5102a 1040006d .g.*.@.o...*.@.m\n 0130 0066102a 1040006b 00d5102a 10400069 .f.*.@.k...*.@.i\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80038 ...............8\n 0170 afa9003c 00a92821 00a9302b 00882021 ...<..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00401821 0075102a 1040004e 00000000 .@.!.u.*.@.N....\n 01b0 50600001 24030001 8fb40010 02950018 P`..$...........\n 01c0 00608821 000387c3 8fb30014 00002010 .`.!.......... .\n 01d0 00002812 02003021 00000000 0c000000 ..(...0!........\n 01e0 02203821 00000000 02750018 02003021 . 8!.....u....0!\n 01f0 02203821 8fb20018 00002010 00002812 . 8!...... ...(.\n 0200 00000000 00000000 0c000000 0074a023 .............t.#\n 0210 00000000 02550018 02003021 02203821 .....U....0!. 8!\n 0220 00739823 afb40010 00002010 00002812 .s.#...... ...(.\n 0230 00000000 00000000 0c000000 afb30014 ................\n 0240 00729023 afb20018 8ec20b84 30420080 .r.#........0B..\n 0250 14400024 00000000 8ee20b84 30420080 .@.$........0B..\n 0260 1040000d 001417c2 8ec20434 00541023 .@.........4.T.#\n 0270 aec20434 8ec20438 8fa30014 00431023 ...4...8.....C.#\n 0280 aec20438 8ec2043c 8fa30018 00431023 ...8...<.....C.#\n 0290 080000b9 aec2043c 8ec30434 02821021 .......<...4...!\n 02a0 00021043 00621823 aec30434 8fa20014 ...C.b.#...4....\n 02b0 8ec30438 000227c2 00441021 00021043 ...8..'..D.!...C\n 02c0 00621823 aec30438 8fa20018 8ec3043c .b.#...8.......<\n 02d0 000227c2 00441021 00021043 00621823 ..'..D.!...C.b.#\n 02e0 aec3043c 8fa80024 8fa90034 9102005e ...<...$...4...^\n 02f0 27de0001 25290be8 03c2102a 1440ff52 '...%).....*.@.R\n 0300 afa90034 8fbf0064 8fbe0060 8fb7005c ...4...d...`...\\\n 0310 8fb60058 8fb50054 8fb40050 8fb3004c ...X...T...P...L\n 0320 8fb20048 8fb10044 8fb00040 03e00008 ...H...D...@....\n 0330 27bd0068 00000000 00000000 00000000 '..h............\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005AB58_5B758' — lift: cannot lift 'func_8005AB58_5B758': 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,-104 */\n/* 4:\tsw\ts6,88(sp) */\n/* 8:\tmove\ts6,a0 */\n/* c:\tsw\tra,100(sp) */\n/* 10:\tsw\ts8,96(sp) */\n/* 14:\tsw\ts7,92(sp) */\n/* 18:\tsw\ts5,84(sp) */\n/* 1c:\tsw\ts4,80(sp) */\n/* 20:\tsw\ts3,76(sp) */\n/* 24:\tsw\ts2,72(sp) */\n/* 28:\tsw\ts1,68(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\ts0,64(sp) */\n/* 34:\tsw\tv0,36(sp) */\n/* 38:\tlbu\tv0,94(v0) */\n/* 3c:\tblez\tv0,304 */\n/* 40:\tmove\ts8,zero */\n/* 44:\tsw\tzero,52(sp) */\n/* 48:\tlw\tt0,36(sp) */\n/* 4c:\tlw\tt1,52(sp) */\n/* 50:\tlw\tv0,16(t0) */\n/* 54:\tlbu\tv1,3000(s6) */\n/* 58:\taddu\ts7,v0,t1 */\n/* 5c:\tlbu\tv0,3000(s7) */\n/* 60:\tbeq\tv1,v0,2ec */\n/* 64:\tnop */\n/* 68:\tlw\tv0,2952(s6) */\n/* 6c:\tandi\tv0,v0,0x10 */\n/* 70:\tbnez\tv0,2ec */\n/* 74:\tnop */\n/* 78:\tlw\tv0,2952(s7) */\n/* 7c:\tandi\tv0,v0,0x10 */\n/* 80:\tbnez\tv0,2ec */\n/* 84:\taddiu\ta0,sp,16 */\n/* 88:\taddiu\ta1,s7,2772 */\n/* 8c:\tjal\t0 */\n/* 90:\tli\ta2,12 */\n/* 94:\tlw\ta0,16(sp) */\n/* 98:\tlw\tv0,1076(s7) */\n/* 9c:\tlw\ta1,20(sp) */\n/* a0:\taddu\ta0,a0,v0 */\n/* a4:\tsw\ta0,16(sp) */\n/* a8:\tlw\tv0,1080(s7) */\n/* ac:\tlw\ta2,24(sp) */\n/* b0:\taddu\ta1,a1,v0 */\n/* b4:\tsw\ta1,20(sp) */\n/* b8:\tlw\tv0,1084(s7) */\n/* bc:\taddu\ta2,a2,v0 */\n/* c0:\tsw\ta2,24(sp) */\n/* c4:\tlw\tv0,1076(s6) */\n/* c8:\tlw\tv1,2772(s6) */\n/* cc:\taddu\tv0,v0,v1 */\n/* d0:\tsubu\ta0,a0,v0 */\n/* d4:\tsw\ta0,16(sp) */\n/* d8:\tlw\tv0,1080(s6) */\n/* dc:\tlw\tv1,2776(s6) */\n/* e0:\taddu\tv0,v0,v1 */\n/* e4:\tsubu\ta3,a1,v0 */\n/* e8:\tsw\ta3,20(sp) */\n/* ec:\tlw\tv0,1084(s6) */\n/* f0:\tlw\tv1,2780(s6) */\n/* f4:\taddu\tv0,v0,v1 */\n/* f8:\tsubu\ta2,a2,v0 */\n/* fc:\tsw\ta2,24(sp) */\n/* 100:\tlw\tv1,2784(s7) */\n/* 104:\tlw\tv0,2784(s6) */\n/* 108:\taddu\ts5,v1,v0 */\n/* 10c:\tnegu\tv1,s5 */\n/* 110:\tslt\tv0,v1,a0 */\n/* 114:\tbeqz\tv0,2e4 */\n/* 118:\tslt\tv0,a0,s5 */\n/* 11c:\tbeqz\tv0,2e4 */\n/* 120:\tslt\tv0,v1,a3 */\n/* 124:\tbeqz\tv0,2e4 */\n/* 128:\tslt\tv0,a3,s5 */\n/* 12c:\tbeqz\tv0,2e4 */\n/* 130:\tslt\tv0,v1,a2 */\n/* 134:\tbeqz\tv0,2e4 */\n/* 138:\tslt\tv0,a2,s5 */\n/* 13c:\tbeqz\tv0,2e4 */\n/* 140:\tmult\ta0,a0 */\n/* 144:\tmfhi\ta0 */\n/* 148:\tmflo\ta1 */\n/* \t... */\n/* 154:\tmult\ta3,a3 */\n/* 158:\tmfhi\tt0 */\n/* 15c:\tmflo\tt1 */\n/* \t... */\n/* 168:\tmult\ta2,a2 */\n/* 16c:\tsw\tt0,56(sp) */\n/* 170:\tsw\tt1,60(sp) */\n/* 174:\taddu\ta1,a1,t1 */\n/* 178:\tsltu\ta2,a1,t1 */\n/* 17c:\taddu\ta0,a0,t0 */\n/* 180:\taddu\ta0,a0,a2 */\n/* 184:\tmfhi\tv0 */\n/* 188:\tmflo\tv1 */\n/* 18c:\taddu\ta1,a1,v1 */\n/* 190:\tsltu\ta2,a1,v1 */\n/* 194:\taddu\ta0,a0,v0 */\n/* 198:\tjal\t0 */\n/* 19c:\taddu\ta0,a0,a2 */\n/* 1a0:\tmove\tv1,v0 */\n/* 1a4:\tslt\tv0,v1,s5 */\n/* 1a8:\tbeqz\tv0,2e4 */\n/* 1ac:\tnop */\n/* 1b0:\tbeqzl\tv1,1b8 */\n/* 1b4:\tli\tv1,1 */\n/* 1b8:\tlw\ts4,16(sp) */\n/* 1bc:\tmult\ts4,s5 */\n/* 1c0:\tmove\ts1,v1 */\n/* 1c4:\tsra\ts0,v1,0x1f */\n/* 1c8:\tlw\ts3,20(sp) */\n/* 1cc:\tmfhi\ta0 */\n/* 1d0:\tmflo\ta1 */\n/* 1d4:\tmove\ta2,s0 */\n/* 1d8:\tnop */\n/* 1dc:\tjal\t0 */\n/* 1e0:\tmove\ta3,s1 */\n/* 1e4:\tnop */\n/* 1e8:\tmult\ts3,s5 */\n/* 1ec:\tmove\ta2,s0 */\n/* 1f0:\tmove\ta3,s1 */\n/* 1f4:\tlw\ts2,24(sp) */\n/* 1f8:\tmfhi\ta0 */\n/* 1fc:\tmflo\ta1 */\n/* \t... */\n/* 208:\tjal\t0 */\n/* 20c:\tsubu\ts4,v1,s4 */\n/* 210:\tnop */\n/* 214:\tmult\ts2,s5 */\n/* 218:\tmove\ta2,s0 */\n/* 21c:\tmove\ta3,s1 */\n/* 220:\tsubu\ts3,v1,s3 */\n/* 224:\tsw\ts4,16(sp) */\n/* 228:\tmfhi\ta0 */\n/* 22c:\tmflo\ta1 */\n/* \t... */\n/* 238:\tjal\t0 */\n/* 23c:\tsw\ts3,20(sp) */\n/* 240:\tsubu\ts2,v1,s2 */\n/* 244:\tsw\ts2,24(sp) */\n/* 248:\tlw\tv0,2948(s6) */\n/* 24c:\tandi\tv0,v0,0x80 */\n/* 250:\tbnez\tv0,2e4 */\n/* 254:\tnop */\n/* 258:\tlw\tv0,2948(s7) */\n/* 25c:\tandi\tv0,v0,0x80 */\n/* 260:\tbeqz\tv0,298 */\n/* 264:\tsrl\tv0,s4,0x1f */\n/* 268:\tlw\tv0,1076(s6) */\n/* 26c:\tsubu\tv0,v0,s4 */\n/* 270:\tsw\tv0,1076(s6) */\n/* 274:\tlw\tv0,1080(s6) */\n/* 278:\tlw\tv1,20(sp) */\n/* 27c:\tsubu\tv0,v0,v1 */\n/* 280:\tsw\tv0,1080(s6) */\n/* 284:\tlw\tv0,1084(s6) */\n/* 288:\tlw\tv1,24(sp) */\n/* 28c:\tsubu\tv0,v0,v1 */\n/* 290:\tj\t2e4 */\n/* 294:\tsw\tv0,1084(s6) */\n/* 298:\tlw\tv1,1076(s6) */\n/* 29c:\taddu\tv0,s4,v0 */\n/* 2a0:\tsra\tv0,v0,0x1 */\n/* 2a4:\tsubu\tv1,v1,v0 */\n/* 2a8:\tsw\tv1,1076(s6) */\n/* 2ac:\tlw\tv0,20(sp) */\n/* 2b0:\tlw\tv1,1080(s6) */\n/* 2b4:\tsrl\ta0,v0,0x1f */\n/* 2b8:\taddu\tv0,v0,a0 */\n/* 2bc:\tsra\tv0,v0,0x1 */\n/* 2c0:\tsubu\tv1,v1,v0 */\n/* 2c4:\tsw\tv1,1080(s6) */\n/* 2c8:\tlw\tv0,24(sp) */\n/* 2cc:\tlw\tv1,1084(s6) */\n/* 2d0:\tsrl\ta0,v0,0x1f */\n/* 2d4:\taddu\tv0,v0,a0 */\n/* 2d8:\tsra\tv0,v0,0x1 */\n/* 2dc:\tsubu\tv1,v1,v0 */\n/* 2e0:\tsw\tv1,1084(s6) */\n/* 2e4:\tlw\tt0,36(sp) */\n/* 2e8:\tlw\tt1,52(sp) */\n/* 2ec:\tlbu\tv0,94(t0) */\n/* 2f0:\taddiu\ts8,s8,1 */\n/* 2f4:\taddiu\tt1,t1,3048 */\n/* 2f8:\tslt\tv0,s8,v0 */\n/* 2fc:\tbnez\tv0,48 */\n/* 300:\tsw\tt1,52(sp) */\n/* 304:\tlw\tra,100(sp) */\n/* 308:\tlw\ts8,96(sp) */\n/* 30c:\tlw\ts7,92(sp) */\n/* 310:\tlw\ts6,88(sp) */\n/* 314:\tlw\ts5,84(sp) */\n/* 318:\tlw\ts4,80(sp) */\n/* 31c:\tlw\ts3,76(sp) */\n/* 320:\tlw\ts2,72(sp) */\n/* 324:\tlw\ts1,68(sp) */\n/* 328:\tlw\ts0,64(sp) */\n/* 32c:\tjr\tra */\n/* 330:\taddiu\tsp,sp,104 */\n/* \t... */\nvoid func_8005AB58_5B758(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005AB58_5B758': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":210,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005AB58_5B758': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\n\nvoid func_8005AB58_5B758(Player *player) {\n s32 sp10; /* compiler-managed */\n s32 sp14;\n s32 sp18;\n void *sp24;\n s32 sp34;\n s32 sp38;\n u32 sp3C;\n s32 temp_a0;\n s32 temp_a0_2;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a3;\n s32 temp_hi;\n s32 temp_s0;\n s32 temp_s3;\n s32 temp_s5;\n s32 temp_v1;\n s32 var_s8;\n s32 var_v1;\n u32 temp_a1_2;\n u32 temp_a1_3;\n u32 temp_lo;\n u32 temp_lo_2;\n u32 temp_s4;\n void *temp_s7;\n void *temp_v0;\n\n temp_v0 = getCurrentAllocation();\n sp24 = temp_v0;\n var_s8 = 0;\n if ((s32) temp_v0->unk5E > 0) {\n sp34 = 0;\n do {\n temp_s7 = sp24->unk10 + sp34;\n if ((player->unkBB8 != temp_s7->unkBB8) && !(player->unkB88 & 0x10) && !(temp_s7->unkB88 & 0x10)) {\n memcpy(&sp10, temp_s7 + 0xAD4, 0xCU);\n temp_a0 = sp10 + temp_s7->unk434;\n sp10 = temp_a0;\n temp_a1 = sp14 + temp_s7->unk438;\n sp14 = temp_a1;\n temp_a2 = sp18 + temp_s7->unk43C;\n sp18 = temp_a2;\n temp_a0_2 = temp_a0 - (player->worldPos.x + player->unkAD4[0]);\n sp10 = temp_a0_2;\n temp_a3 = temp_a1 - (player->worldPos.y + player->unkAD4[1]);\n sp14 = temp_a3;\n temp_a2_2 = temp_a2 - (player->worldPos.z + player->unkAD4[2]);\n sp18 = temp_a2_2;\n temp_s5 = temp_s7->unkAE0 + player->unkAE0;\n temp_v1 = -temp_s5;\n if ((temp_v1 < temp_a0_2) && (temp_a0_2 < temp_s5) && (temp_v1 < temp_a3) && (temp_a3 < temp_s5) && (temp_v1 < temp_a2_2) && (temp_a2_2 < temp_s5)) {\n temp_hi = MULT_HI(temp_a3, temp_a3);\n temp_lo = temp_a3 * temp_a3;\n temp_lo_2 = temp_a2_2 * temp_a2_2;\n sp38 = temp_hi;\n sp3C = temp_lo;\n temp_a1_2 = (temp_a0_2 * temp_a0_2) + temp_lo;\n temp_a1_3 = temp_a1_2 + temp_lo_2;\n var_v1 = isqrt64(/* s64+0x0 */ (MULT_HI(temp_a0_2, temp_a0_2) + temp_hi + (temp_a1_2 < temp_lo) + MULT_HI(temp_a2_2, temp_a2_2) + (temp_a1_3 < temp_lo_2)), /* s64+0x4 */ temp_a1_3);\n if (var_v1 < temp_s5) {\n if (var_v1 == 0) {\n var_v1 = 1;\n }\n temp_s0 = var_v1 >> 0x1F;\n temp_s4 = (u32) __divdi3(MULT_HI(sp10, temp_s5), sp10 * temp_s5, temp_s0, var_v1) - sp10;\n temp_s3 = (u32) __divdi3(MULT_HI(sp14, temp_s5), sp14 * temp_s5, temp_s0, var_v1) - sp14;\n sp10 = temp_s4;\n sp14 = temp_s3;\n sp18 = (u32) __divdi3(MULT_HI(sp18, temp_s5), sp18 * temp_s5, temp_s0, var_v1) - sp18;\n if (!(player->unkB84 & 0x80)) {\n if (temp_s7->unkB84 & 0x80) {\n player->worldPos.x -= temp_s4;\n player->worldPos.y -= sp14;\n player->worldPos.z -= sp18;\n } else {\n player->worldPos.x -= (s32) (temp_s4 + (temp_s4 >> 0x1F)) >> 1;\n player->worldPos.y -= sp14 / 2;\n player->worldPos.z -= sp18 / 2;\n }\n }\n }\n }\n }\n var_s8 += 1;\n sp34 += 0xBE8;\n } while (var_s8 < (s32) sp24->unk5E);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":90,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2780: request for member `unk5E' in something not a structure or union","/c.i:2783: request for member `unk10' in something not a structure or union","/c.i:2784: request for member `unkBB8' in something not a structure or union","/c.i:2784: request for member `unkB88' in something not a structure or union","/c.i:2786: request for member `unk434' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005AB58_5B758` — benchmark function snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_8005AB58_5B758\n addiu\t$sp, $sp, -104\n sw\t$s6, 88($sp)\n move\t$s6, $a0\n sw\t$ra, 100($sp)\n sw\t$s8, 96($sp)\n sw\t$s7, 92($sp)\n sw\t$s5, 84($sp)\n sw\t$s4, 80($sp)\n sw\t$s3, 76($sp)\n sw\t$s2, 72($sp)\n sw\t$s1, 68($sp)\n jal\tgetCurrentAllocation\n sw\t$s0, 64($sp)\n sw\t$v0, 36($sp)\n lbu\t$v0, 94($v0)\n blez\t$v0, .L304\n move\t$s8, $zero\n sw\t$zero, 52($sp)\n.L48:\n lw\t$t0, 36($sp)\n lw\t$t1, 52($sp)\n lw\t$v0, 16($t0)\n lbu\t$v1, 3000($s6)\n addu\t$s7, $v0, $t1\n lbu\t$v0, 3000($s7)\n beq\t$v1, $v0, .L2ec\n nop\n lw\t$v0, 2952($s6)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L2ec\n nop\n lw\t$v0, 2952($s7)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L2ec\n addiu\t$a0, $sp, 16\n addiu\t$a1, $s7, 2772\n jal\tmemcpy\n li\t$a2, 12\n lw\t$a0, 16($sp)\n lw\t$v0, 1076($s7)\n lw\t$a1, 20($sp)\n addu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s7)\n lw\t$a2, 24($sp)\n addu\t$a1, $a1, $v0\n sw\t$a1, 20($sp)\n lw\t$v0, 1084($s7)\n addu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v0, 1076($s6)\n lw\t$v1, 2772($s6)\n addu\t$v0, $v0, $v1\n subu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s6)\n lw\t$v1, 2776($s6)\n addu\t$v0, $v0, $v1\n subu\t$a3, $a1, $v0\n sw\t$a3, 20($sp)\n lw\t$v0, 1084($s6)\n lw\t$v1, 2780($s6)\n addu\t$v0, $v0, $v1\n subu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v1, 2784($s7)\n lw\t$v0, 2784($s6)\n addu\t$s5, $v1, $v0\n negu\t$v1, $s5\n slt\t$v0, $v1, $a0\n beqz\t$v0, .L2e4\n slt\t$v0, $a0, $s5\n beqz\t$v0, .L2e4\n slt\t$v0, $v1, $a3\n beqz\t$v0, .L2e4\n slt\t$v0, $a3, $s5\n beqz\t$v0, .L2e4\n slt\t$v0, $v1, $a2\n beqz\t$v0, .L2e4\n slt\t$v0, $a2, $s5\n beqz\t$v0, .L2e4\n mult\t$a0, $a0\n mfhi\t$a0\n mflo\t$a1\n mult\t$a3, $a3\n mfhi\t$t0\n mflo\t$t1\n mult\t$a2, $a2\n sw\t$t0, 56($sp)\n sw\t$t1, 60($sp)\n addu\t$a1, $a1, $t1\n sltu\t$a2, $a1, $t1\n addu\t$a0, $a0, $t0\n addu\t$a0, $a0, $a2\n mfhi\t$v0\n mflo\t$v1\n addu\t$a1, $a1, $v1\n sltu\t$a2, $a1, $v1\n addu\t$a0, $a0, $v0\n jal\tisqrt64\n addu\t$a0, $a0, $a2\n move\t$v1, $v0\n slt\t$v0, $v1, $s5\n beqz\t$v0, .L2e4\n nop\n beqzl\t$v1, .L1b8\n li\t$v1, 1\n.L1b8:\n lw\t$s4, 16($sp)\n mult\t$s4, $s5\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n lw\t$s3, 20($sp)\n mfhi\t$a0\n mflo\t$a1\n move\t$a2, $s0\n nop\n jal\t__divdi3\n move\t$a3, $s1\n nop\n mult\t$s3, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n lw\t$s2, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n subu\t$s4, $v1, $s4\n nop\n mult\t$s2, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n subu\t$s3, $v1, $s3\n sw\t$s4, 16($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$s3, 20($sp)\n subu\t$s2, $v1, $s2\n sw\t$s2, 24($sp)\n lw\t$v0, 2948($s6)\n andi\t$v0, $v0, 0x80\n bnez\t$v0, .L2e4\n nop\n lw\t$v0, 2948($s7)\n andi\t$v0, $v0, 0x80\n beqz\t$v0, .L298\n srl\t$v0, $s4, 0x1f\n lw\t$v0, 1076($s6)\n subu\t$v0, $v0, $s4\n sw\t$v0, 1076($s6)\n lw\t$v0, 1080($s6)\n lw\t$v1, 20($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1080($s6)\n lw\t$v0, 1084($s6)\n lw\t$v1, 24($sp)\n subu\t$v0, $v0, $v1\n j\t.L2e4\n sw\t$v0, 1084($s6)\n.L298:\n lw\t$v1, 1076($s6)\n addu\t$v0, $s4, $v0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1076($s6)\n lw\t$v0, 20($sp)\n lw\t$v1, 1080($s6)\n srl\t$a0, $v0, 0x1f\n addu\t$v0, $v0, $a0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1080($s6)\n lw\t$v0, 24($sp)\n lw\t$v1, 1084($s6)\n srl\t$a0, $v0, 0x1f\n addu\t$v0, $v0, $a0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1084($s6)\n.L2e4:\n lw\t$t0, 36($sp)\n lw\t$t1, 52($sp)\n.L2ec:\n lbu\t$v0, 94($t0)\n addiu\t$s8, $s8, 1\n addiu\t$t1, $t1, 3048\n slt\t$v0, $s8, $v0\n bnez\t$v0, .L48\n sw\t$t1, 52($sp)\n.L304:\n lw\t$ra, 100($sp)\n lw\t$s8, 96($sp)\n lw\t$s7, 92($sp)\n lw\t$s6, 88($sp)\n lw\t$s5, 84($sp)\n lw\t$s4, 80($sp)\n lw\t$s3, 76($sp)\n lw\t$s2, 72($sp)\n lw\t$s1, 68($sp)\n lw\t$s0, 64($sp)\n jr\t$ra\n addiu\t$sp, $sp, 104\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-3c0ef0b3e2c0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8005AB58_5B758(Player *player);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005AB58_5B758 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005AB58_5B758` — benchmark function snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005AB58_5B758: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,-104\n 4:\tsw\ts6,88(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,100(sp)\n 10:\tsw\ts8,96(sp)\n 14:\tsw\ts7,92(sp)\n 18:\tsw\ts5,84(sp)\n 1c:\tsw\ts4,80(sp)\n 20:\tsw\ts3,76(sp)\n 24:\tsw\ts2,72(sp)\n 28:\tsw\ts1,68(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,64(sp)\n 34:\tsw\tv0,36(sp)\n 38:\tlbu\tv0,94(v0)\n 3c:\tblez\tv0,304 \n 40:\tmove\ts8,zero\n 44:\tsw\tzero,52(sp)\n 48:\tlw\tt0,36(sp)\n 4c:\tlw\tt1,52(sp)\n 50:\tlw\tv0,16(t0)\n 54:\tlbu\tv1,3000(s6)\n 58:\taddu\ts7,v0,t1\n 5c:\tlbu\tv0,3000(s7)\n 60:\tbeq\tv1,v0,2ec \n 64:\tnop\n 68:\tlw\tv0,2952(s6)\n 6c:\tandi\tv0,v0,0x10\n 70:\tbnez\tv0,2ec \n 74:\tnop\n 78:\tlw\tv0,2952(s7)\n 7c:\tandi\tv0,v0,0x10\n 80:\tbnez\tv0,2ec \n 84:\taddiu\ta0,sp,16\n 88:\taddiu\ta1,s7,2772\n 8c:\tjal\t0 \n 90:\tli\ta2,12\n 94:\tlw\ta0,16(sp)\n 98:\tlw\tv0,1076(s7)\n 9c:\tlw\ta1,20(sp)\n a0:\taddu\ta0,a0,v0\n a4:\tsw\ta0,16(sp)\n a8:\tlw\tv0,1080(s7)\n ac:\tlw\ta2,24(sp)\n b0:\taddu\ta1,a1,v0\n b4:\tsw\ta1,20(sp)\n b8:\tlw\tv0,1084(s7)\n bc:\taddu\ta2,a2,v0\n c0:\tsw\ta2,24(sp)\n c4:\tlw\tv0,1076(s6)\n c8:\tlw\tv1,2772(s6)\n cc:\taddu\tv0,v0,v1\n d0:\tsubu\ta0,a0,v0\n d4:\tsw\ta0,16(sp)\n d8:\tlw\tv0,1080(s6)\n dc:\tlw\tv1,2776(s6)\n e0:\taddu\tv0,v0,v1\n e4:\tsubu\ta3,a1,v0\n e8:\tsw\ta3,20(sp)\n ec:\tlw\tv0,1084(s6)\n f0:\tlw\tv1,2780(s6)\n f4:\taddu\tv0,v0,v1\n f8:\tsubu\ta2,a2,v0\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2784(s7)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,2e4 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,2e4 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,2e4 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,2e4 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,2e4 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,2e4 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,56(sp)\n 170:\tsw\tt1,60(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\tv1,v0\n 1a4:\tslt\tv0,v1,s5\n 1a8:\tbeqz\tv0,2e4 \n 1ac:\tnop\n 1b0:\tbeqzl\tv1,1b8 \n 1b4:\tli\tv1,1\n 1b8:\tlw\ts4,16(sp)\n 1bc:\tmult\ts4,s5\n 1c0:\tmove\ts1,v1\n 1c4:\tsra\ts0,v1,0x1f\n 1c8:\tlw\ts3,20(sp)\n 1cc:\tmfhi\ta0\n 1d0:\tmflo\ta1\n 1d4:\tmove\ta2,s0\n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tmove\ta3,s1\n 1e4:\tnop\n 1e8:\tmult\ts3,s5\n 1ec:\tmove\ta2,s0\n 1f0:\tmove\ta3,s1\n 1f4:\tlw\ts2,24(sp)\n 1f8:\tmfhi\ta0\n 1fc:\tmflo\ta1\n\t...\n 208:\tjal\t0 \n 20c:\tsubu\ts4,v1,s4\n 210:\tnop\n 214:\tmult\ts2,s5\n 218:\tmove\ta2,s0\n 21c:\tmove\ta3,s1\n 220:\tsubu\ts3,v1,s3\n 224:\tsw\ts4,16(sp)\n 228:\tmfhi\ta0\n 22c:\tmflo\ta1\n\t...\n 238:\tjal\t0 \n 23c:\tsw\ts3,20(sp)\n 240:\tsubu\ts2,v1,s2\n 244:\tsw\ts2,24(sp)\n 248:\tlw\tv0,2948(s6)\n 24c:\tandi\tv0,v0,0x80\n 250:\tbnez\tv0,2e4 \n 254:\tnop\n 258:\tlw\tv0,2948(s7)\n 25c:\tandi\tv0,v0,0x80\n 260:\tbeqz\tv0,298 \n 264:\tsrl\tv0,s4,0x1f\n 268:\tlw\tv0,1076(s6)\n 26c:\tsubu\tv0,v0,s4\n 270:\tsw\tv0,1076(s6)\n 274:\tlw\tv0,1080(s6)\n 278:\tlw\tv1,20(sp)\n 27c:\tsubu\tv0,v0,v1\n 280:\tsw\tv0,1080(s6)\n 284:\tlw\tv0,1084(s6)\n 288:\tlw\tv1,24(sp)\n 28c:\tsubu\tv0,v0,v1\n 290:\tj\t2e4 \n 294:\tsw\tv0,1084(s6)\n 298:\tlw\tv1,1076(s6)\n 29c:\taddu\tv0,s4,v0\n 2a0:\tsra\tv0,v0,0x1\n 2a4:\tsubu\tv1,v1,v0\n 2a8:\tsw\tv1,1076(s6)\n 2ac:\tlw\tv0,20(sp)\n 2b0:\tlw\tv1,1080(s6)\n 2b4:\tsrl\ta0,v0,0x1f\n 2b8:\taddu\tv0,v0,a0\n 2bc:\tsra\tv0,v0,0x1\n 2c0:\tsubu\tv1,v1,v0\n 2c4:\tsw\tv1,1080(s6)\n 2c8:\tlw\tv0,24(sp)\n 2cc:\tlw\tv1,1084(s6)\n 2d0:\tsrl\ta0,v0,0x1f\n 2d4:\taddu\tv0,v0,a0\n 2d8:\tsra\tv0,v0,0x1\n 2dc:\tsubu\tv1,v1,v0\n 2e0:\tsw\tv1,1084(s6)\n 2e4:\tlw\tt0,36(sp)\n 2e8:\tlw\tt1,52(sp)\n 2ec:\tlbu\tv0,94(t0)\n 2f0:\taddiu\ts8,s8,1\n 2f4:\taddiu\tt1,t1,3048\n 2f8:\tslt\tv0,s8,v0\n 2fc:\tbnez\tv0,48 \n 300:\tsw\tt1,52(sp)\n 304:\tlw\tra,100(sp)\n 308:\tlw\ts8,96(sp)\n 30c:\tlw\ts7,92(sp)\n 310:\tlw\ts6,88(sp)\n 314:\tlw\ts5,84(sp)\n 318:\tlw\ts4,80(sp)\n 31c:\tlw\ts3,76(sp)\n 320:\tlw\ts2,72(sp)\n 324:\tlw\ts1,68(sp)\n 328:\tlw\ts0,64(sp)\n 32c:\tjr\tra\n 330:\taddiu\tsp,sp,104\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-9c00ae27ec8e5d7c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t00000334 func_8005AB58_5B758\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n0000008c R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n000001dc R_MIPS_26 __divdi3\n00000208 R_MIPS_26 __divdi3\n00000238 R_MIPS_26 __divdi3\n00000290 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdff98 afb60058 0080b021 afbf0064 '......X...!...d\n 0010 afbe0060 afb7005c afb50054 afb40050 ...`...\\...T...P\n 0020 afb3004c afb20048 afb10044 0c000000 ...L...H...D....\n 0030 afb00040 afa20024 9042005e 184000b1 ...@...$.B.^.@..\n 0040 0000f021 afa00034 8fa80024 8fa90034 ...!...4...$...4\n 0050 8d020010 92c30bb8 0049b821 92e20bb8 .........I.!....\n 0060 106200a2 00000000 8ec20b88 30420010 .b..........0B..\n 0070 1440009e 00000000 8ee20b88 30420010 .@..........0B..\n 0080 1440009a 27a40010 26e50ad4 0c000000 .@..'...&.......\n 0090 2406000c 8fa40010 8ee20434 8fa50014 $..........4....\n 00a0 00822021 afa40010 8ee20438 8fa60018 .. !.......8....\n 00b0 00a22821 afa50014 8ee2043c 00c23021 ..(!.......<..0!\n 00c0 afa60018 8ec20434 8ec30ad4 00431021 .......4.....C.!\n 00d0 00822023 afa40010 8ec20438 8ec30ad8 .. #.......8....\n 00e0 00431021 00a23823 afa70014 8ec2043c .C.!..8#.......<\n 00f0 8ec30adc 00431021 00c23023 afa60018 .....C.!..0#....\n 0100 8ee30ae0 8ec20ae0 0062a821 00151823 .........b.!...#\n 0110 0064102a 10400073 0095102a 10400071 .d.*.@.s...*.@.q\n 0120 0067102a 1040006f 00f5102a 1040006d .g.*.@.o...*.@.m\n 0130 0066102a 1040006b 00d5102a 10400069 .f.*.@.k...*.@.i\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80038 ...............8\n 0170 afa9003c 00a92821 00a9302b 00882021 ...<..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00401821 0075102a 1040004e 00000000 .@.!.u.*.@.N....\n 01b0 50600001 24030001 8fb40010 02950018 P`..$...........\n 01c0 00608821 000387c3 8fb30014 00002010 .`.!.......... .\n 01d0 00002812 02003021 00000000 0c000000 ..(...0!........\n 01e0 02203821 00000000 02750018 02003021 . 8!.....u....0!\n 01f0 02203821 8fb20018 00002010 00002812 . 8!...... ...(.\n 0200 00000000 00000000 0c000000 0074a023 .............t.#\n 0210 00000000 02550018 02003021 02203821 .....U....0!. 8!\n 0220 00739823 afb40010 00002010 00002812 .s.#...... ...(.\n 0230 00000000 00000000 0c000000 afb30014 ................\n 0240 00729023 afb20018 8ec20b84 30420080 .r.#........0B..\n 0250 14400024 00000000 8ee20b84 30420080 .@.$........0B..\n 0260 1040000d 001417c2 8ec20434 00541023 .@.........4.T.#\n 0270 aec20434 8ec20438 8fa30014 00431023 ...4...8.....C.#\n 0280 aec20438 8ec2043c 8fa30018 00431023 ...8...<.....C.#\n 0290 080000b9 aec2043c 8ec30434 02821021 .......<...4...!\n 02a0 00021043 00621823 aec30434 8fa20014 ...C.b.#...4....\n 02b0 8ec30438 000227c2 00441021 00021043 ...8..'..D.!...C\n 02c0 00621823 aec30438 8fa20018 8ec3043c .b.#...8.......<\n 02d0 000227c2 00441021 00021043 00621823 ..'..D.!...C.b.#\n 02e0 aec3043c 8fa80024 8fa90034 9102005e ...<...$...4...^\n 02f0 27de0001 25290be8 03c2102a 1440ff52 '...%).....*.@.R\n 0300 afa90034 8fbf0064 8fbe0060 8fb7005c ...4...d...`...\\\n 0310 8fb60058 8fb50054 8fb40050 8fb3004c ...X...T...P...L\n 0320 8fb20048 8fb10044 8fb00040 03e00008 ...H...D...@....\n 0330 27bd0068 00000000 00000000 00000000 '..h............\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005AB58_5B758\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005AB58_5B758 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_8005AE8C_5BA8C:gcc2.7.2kmc","sym":"func_8005AE8C_5BA8C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["int64","memory","struct","goto","do-while","loop","bitwise","call","magic-div"],"loc":109,"refSource":"void func_8005AE8C_5BA8C(Player *player) {\n Vec3i deltaPos;\n u8 pad[0x8];\n void *collisionBoxPtr;\n s32 unused1;\n s32 unused2;\n s32 combinedRadius;\n s32 negRadius;\n s32 dist;\n s32 boxIndex;\n Player *targetPlayer;\n Player *players;\n\n players = ((GameState *)getCurrentAllocation())->players;\n targetPlayer = players + 1;\n\n /* Skip collision if players are on the same team */\n if (player->unkBB8 == targetPlayer->unkBB8) {\n return;\n }\n /* Skip if either player has collision disabled (flag 0x10) */\n if (player->unkB88 & 0x10) {\n return;\n }\n if (targetPlayer->unkB88 & 0x10) {\n return;\n }\n\n if ((s8)targetPlayer->unkBB4 > 0) {\n boxIndex = 0;\n collisionBoxPtr = targetPlayer;\n do {\n /* Copy target's collision box local position (offset 0xAE4 is unkAE4 array) */\n memcpy(&deltaPos, (u8 *)collisionBoxPtr + 0xAE4, 0xC);\n\n /* Convert to world space */\n deltaPos.x += targetPlayer->worldPos.x;\n deltaPos.y += targetPlayer->worldPos.y;\n deltaPos.z += targetPlayer->worldPos.z;\n\n /* Calculate relative position to player's collision box */\n deltaPos.x -= player->worldPos.x + player->unkAD4[0];\n deltaPos.y -= player->worldPos.y + player->unkAD4[1];\n deltaPos.z -= player->worldPos.z + player->unkAD4[2];\n\n /* Sum of both collision box radii */\n combinedRadius = (&targetPlayer->unkB2C)[boxIndex] + player->unkAE0;\n negRadius = -combinedRadius;\n\n /* Quick AABB check before expensive distance calculation */\n if (negRadius < deltaPos.x && deltaPos.x < combinedRadius && negRadius < deltaPos.y &&\n deltaPos.y < combinedRadius && negRadius < deltaPos.z && deltaPos.z < combinedRadius) {\n\n dist =\n isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.y * deltaPos.y + (s64)deltaPos.z * deltaPos.z);\n\n if (dist < combinedRadius) {\n /* Check for special knockback on collision boxes 4-5 when target is in state 1 */\n if (targetPlayer->unkBD9 == 1) {\n if ((targetPlayer->unkB84 & 0x40000) && (u32)(boxIndex - 4) < 2U) {\n func_80058B30_59730(player);\n goto next;\n }\n }\n /* Check for special knockback on collision boxes 1-2 when target is in state 3 */\n if (targetPlayer->unkBD9 == 3 && (targetPlayer->unkB84 & 0x40000) && (u32)(boxIndex - 1) < 2U) {\n func_80058B30_59730(player);\n goto next;\n }\n\n /* Avoid divide by zero */\n if (dist == 0) {\n dist = 1;\n }\n\n /* Calculate push vector to separate the players */\n deltaPos.x = ((s64)deltaPos.x * combinedRadius / dist) - deltaPos.x;\n deltaPos.y = ((s64)deltaPos.y * combinedRadius / dist) - deltaPos.y;\n deltaPos.z = ((s64)deltaPos.z * combinedRadius / dist) - deltaPos.z;\n\n /* Push player out of collision */\n player->worldPos.x -= deltaPos.x;\n player->worldPos.y -= deltaPos.y;\n player->worldPos.z -= deltaPos.z;\n\n /* Apply knockback if target is in state 2 and colliding with main collision box */\n if ((targetPlayer->unkBD9 == 2) & (boxIndex == 0)) {\n dist = isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.z * deltaPos.z);\n if (dist > 0x30000) {\n func_80058950_59550(\n player,\n func_8006D21C_6DE1C(\n targetPlayer->worldPos.x,\n targetPlayer->worldPos.z,\n player->worldPos.x,\n player->worldPos.z\n ),\n dist\n );\n }\n }\n }\n }\n next:\n boxIndex++;\n collisionBoxPtr = (u8 *)collisionBoxPtr + 0xC;\n } while (boxIndex < (s8)targetPlayer->unkBB4);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5AA90.c#L215-L323","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-96\n 4:\tsw\ts6,80(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,92(sp)\n 10:\tsw\ts8,88(sp)\n 14:\tsw\ts7,84(sp)\n 18:\tsw\ts5,76(sp)\n 1c:\tsw\ts4,72(sp)\n 20:\tsw\ts3,68(sp)\n 24:\tsw\ts2,64(sp)\n 28:\tsw\ts1,60(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,56(sp)\n 34:\tlw\ta0,16(v0)\n 38:\tlbu\tv1,3000(s6)\n 3c:\tlbu\tv0,6048(a0)\n 40:\tbeq\tv1,v0,390 \n 44:\taddiu\ts7,a0,3048\n 48:\tlw\tv0,2952(s6)\n 4c:\tandi\tv0,v0,0x10\n 50:\tbnez\tv0,390 \n 54:\tnop\n 58:\tlw\tv0,6000(a0)\n 5c:\tandi\tv0,v0,0x10\n 60:\tbnez\tv0,390 \n 64:\tnop\n 68:\tlb\tv0,6044(a0)\n 6c:\tblez\tv0,390 \n 70:\tmove\ts8,zero\n 74:\tsw\ts7,44(sp)\n 78:\tlw\tt0,44(sp)\n 7c:\taddiu\ta0,sp,16\n 80:\tli\ta2,12\n 84:\tjal\t0 \n 88:\taddiu\ta1,t0,2788\n 8c:\tlw\ta0,16(sp)\n 90:\tlw\tv0,1076(s7)\n 94:\tlw\ta1,20(sp)\n 98:\taddu\ta0,a0,v0\n 9c:\tsw\ta0,16(sp)\n a0:\tlw\tv0,1080(s7)\n a4:\tlw\ta2,24(sp)\n a8:\taddu\ta1,a1,v0\n ac:\tsw\ta1,20(sp)\n b0:\tlw\tv0,1084(s7)\n b4:\taddu\ta2,a2,v0\n b8:\tsw\ta2,24(sp)\n bc:\tlw\tv0,1076(s6)\n c0:\tlw\tv1,2772(s6)\n c4:\taddu\tv0,v0,v1\n c8:\tsubu\ta0,a0,v0\n cc:\tsw\ta0,16(sp)\n d0:\tlw\tv0,1080(s6)\n d4:\tlw\tv1,2776(s6)\n d8:\taddu\tv0,v0,v1\n dc:\tsubu\ta3,a1,v0\n e0:\tsw\ta3,20(sp)\n e4:\tlw\tv0,1084(s6)\n e8:\tlw\tv1,2780(s6)\n ec:\taddu\tv0,v0,v1\n f0:\tsubu\ta2,a2,v0\n f4:\tsll\tv0,s8,0x2\n f8:\taddu\tv0,v0,s7\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2860(v0)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,374 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,374 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,374 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,374 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,374 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,374 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,48(sp)\n 170:\tsw\tt1,52(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\ts2,v0\n 1a4:\tslt\tv0,s2,s5\n 1a8:\tbeqz\tv0,374 \n 1ac:\tli\tv0,1\n 1b0:\tlbu\tv1,3033(s7)\n 1b4:\tbne\tv1,v0,1e0 \n 1b8:\tli\tv0,3\n 1bc:\tlw\tv0,2948(s7)\n 1c0:\tlui\tt0,0x4\n 1c4:\tand\tv0,v0,t0\n 1c8:\tbeqz\tv0,1dc \n 1cc:\taddiu\tv0,s8,-4\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,204 \n 1d8:\tnop\n 1dc:\tli\tv0,3\n 1e0:\tbne\tv1,v0,214 \n 1e4:\tlui\tt1,0x4\n 1e8:\tlw\tv0,2948(s7)\n 1ec:\tand\tv0,v0,t1\n 1f0:\tbeqz\tv0,214 \n 1f4:\taddiu\tv0,s8,-1\n 1f8:\tsltiu\tv0,v0,2\n 1fc:\tbeqz\tv0,214 \n 200:\tnop\n 204:\tjal\t0 \n 208:\tmove\ta0,s6\n 20c:\tj\t374 \n 210:\tnop\n 214:\tbeqzl\ts2,21c \n 218:\tli\ts2,1\n 21c:\tlw\ts4,16(sp)\n 220:\tmult\ts4,s5\n 224:\tmove\ts1,s2\n 228:\tsra\ts0,s2,0x1f\n 22c:\tlw\ts3,20(sp)\n 230:\tmfhi\ta0\n 234:\tmflo\ta1\n 238:\tmove\ta2,s0\n 23c:\tnop\n 240:\tjal\t0 \n 244:\tmove\ta3,s1\n 248:\tnop\n 24c:\tmult\ts3,s5\n 250:\tmove\ta2,s0\n 254:\tmove\ta3,s1\n 258:\tlw\ts2,24(sp)\n 25c:\tmfhi\ta0\n 260:\tmflo\ta1\n\t...\n 26c:\tjal\t0 \n 270:\tsubu\ts4,v1,s4\n 274:\tnop\n 278:\tmult\ts2,s5\n 27c:\tmove\ta2,s0\n 280:\tmove\ta3,s1\n 284:\tsubu\ts3,v1,s3\n 288:\tsw\ts4,16(sp)\n 28c:\tmfhi\ta0\n 290:\tmflo\ta1\n\t...\n 29c:\tjal\t0 \n 2a0:\tsw\ts3,20(sp)\n 2a4:\tsubu\ts2,v1,s2\n 2a8:\tsw\ts2,24(sp)\n 2ac:\tlw\tv0,1076(s6)\n 2b0:\tsubu\tv0,v0,s4\n 2b4:\tsw\tv0,1076(s6)\n 2b8:\tlw\tv0,1080(s6)\n 2bc:\tlw\tv1,20(sp)\n 2c0:\tsubu\tv0,v0,v1\n 2c4:\tsw\tv0,1080(s6)\n 2c8:\tlw\tv0,1084(s6)\n 2cc:\tlw\tv1,24(sp)\n 2d0:\tsubu\tv0,v0,v1\n 2d4:\tsw\tv0,1084(s6)\n 2d8:\tlbu\tv0,3033(s7)\n 2dc:\tsltiu\tv1,s8,1\n 2e0:\txori\tv0,v0,0x2\n 2e4:\tsltiu\tv0,v0,1\n 2e8:\tand\tv0,v0,v1\n 2ec:\tbeqz\tv0,374 \n 2f0:\tnop\n 2f4:\tlw\tv0,16(sp)\n 2f8:\tmult\tv0,v0\n 2fc:\tlw\tv0,24(sp)\n 300:\tmfhi\ta0\n 304:\tmflo\ta1\n\t...\n 310:\tmult\tv0,v0\n 314:\tmfhi\tt0\n 318:\tmflo\tt1\n 31c:\tsw\tt0,48(sp)\n 320:\tsw\tt1,52(sp)\n 324:\taddu\ta1,a1,t1\n 328:\tsltu\tv0,a1,t1\n 32c:\taddu\ta0,a0,t0\n 330:\tjal\t0 \n 334:\taddu\ta0,a0,v0\n 338:\tmove\ts2,v0\n 33c:\tlui\tv0,0x3\n 340:\tslt\tv0,v0,s2\n 344:\tbeqz\tv0,374 \n 348:\tnop\n 34c:\tlw\ta0,1076(s7)\n 350:\tlw\ta1,1084(s7)\n 354:\tlw\ta2,1076(s6)\n 358:\tjal\t0 \n 35c:\tlw\ta3,1084(s6)\n 360:\tmove\ta0,s6\n 364:\tsll\tv0,v0,0x10\n 368:\tsra\ta1,v0,0x10\n 36c:\tjal\t0 \n 370:\tmove\ta2,s2\n 374:\tlw\tt0,44(sp)\n 378:\tlb\tv0,2996(s7)\n 37c:\taddiu\ts8,s8,1\n 380:\taddiu\tt0,t0,12\n 384:\tslt\tv0,s8,v0\n 388:\tbnez\tv0,78 \n 38c:\tsw\tt0,44(sp)\n 390:\tlw\tra,92(sp)\n 394:\tlw\ts8,88(sp)\n 398:\tlw\ts7,84(sp)\n 39c:\tlw\ts6,80(sp)\n 3a0:\tlw\ts5,76(sp)\n 3a4:\tlw\ts4,72(sp)\n 3a8:\tlw\ts3,68(sp)\n 3ac:\tlw\ts2,64(sp)\n 3b0:\tlw\ts1,60(sp)\n 3b4:\tlw\ts0,56(sp)\n 3b8:\tjr\tra\n 3bc:\taddiu\tsp,sp,96\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-3c0ef0b3e2c0.i.gz","proto":{"func_8005AE8C_5BA8C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-84d07a69b637e7e0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t000003c0 func_8005AE8C_5BA8C\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n00000000 *UND*\t00000000 func_80058B30_59730\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 func_80058950_59550\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n00000084 R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n00000204 R_MIPS_26 func_80058B30_59730\n0000020c R_MIPS_26 .text\n00000240 R_MIPS_26 __divdi3\n0000026c R_MIPS_26 __divdi3\n0000029c R_MIPS_26 __divdi3\n00000330 R_MIPS_26 isqrt64\n00000358 R_MIPS_26 func_8006D21C_6DE1C\n0000036c R_MIPS_26 func_80058950_59550\n\n\nContents of section .text:\n 0000 27bdffa0 afb60050 0080b021 afbf005c '......P...!...\\\n 0010 afbe0058 afb70054 afb5004c afb40048 ...X...T...L...H\n 0020 afb30044 afb20040 afb1003c 0c000000 ...D...@...<....\n 0030 afb00038 8c440010 92c30bb8 908217a0 ...8.D..........\n 0040 106200d3 24970be8 8ec20b88 30420010 .b..$.......0B..\n 0050 144000cf 00000000 8c821770 30420010 .@.........p0B..\n 0060 144000cb 00000000 8082179c 184000c8 .@...........@..\n 0070 0000f021 afb7002c 8fa8002c 27a40010 ...!...,...,'...\n 0080 2406000c 0c000000 25050ae4 8fa40010 $.......%.......\n 0090 8ee20434 8fa50014 00822021 afa40010 ...4...... !....\n 00a0 8ee20438 8fa60018 00a22821 afa50014 ...8......(!....\n 00b0 8ee2043c 00c23021 afa60018 8ec20434 ...<..0!.......4\n 00c0 8ec30ad4 00431021 00822023 afa40010 .....C.!.. #....\n 00d0 8ec20438 8ec30ad8 00431021 00a23823 ...8.....C.!..8#\n 00e0 afa70014 8ec2043c 8ec30adc 00431021 .......<.....C.!\n 00f0 00c23023 001e1080 00571021 afa60018 ..0#.....W.!....\n 0100 8c430b2c 8ec20ae0 0062a821 00151823 .C.,.....b.!...#\n 0110 0064102a 10400097 0095102a 10400095 .d.*.@.....*.@..\n 0120 0067102a 10400093 00f5102a 10400091 .g.*.@.....*.@..\n 0130 0066102a 1040008f 00d5102a 1040008d .f.*.@.....*.@..\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80030 ...............0\n 0170 afa90034 00a92821 00a9302b 00882021 ...4..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00409021 0255102a 10400072 24020001 .@.!.U.*.@.r$...\n 01b0 92e30bd9 1462000a 24020003 8ee20b84 .....b..$.......\n 01c0 3c080004 00481024 10400004 27c2fffc <....H.$.@..'...\n 01d0 2c420002 1440000b 00000000 24020003 ,B...@......$...\n 01e0 1462000c 3c090004 8ee20b84 00491024 .b..<........I.$\n 01f0 10400008 27c2ffff 2c420002 10400005 .@..'...,B...@..\n 0200 00000000 0c000000 02c02021 080000dd .......... !....\n 0210 00000000 52400001 24120001 8fb40010 ....R@..$.......\n 0220 02950018 02408821 001287c3 8fb30014 .....@.!........\n 0230 00002010 00002812 02003021 00000000 .. ...(...0!....\n 0240 0c000000 02203821 00000000 02750018 ..... 8!.....u..\n 0250 02003021 02203821 8fb20018 00002010 ..0!. 8!...... .\n 0260 00002812 00000000 00000000 0c000000 ..(.............\n 0270 0074a023 00000000 02550018 02003021 .t.#.....U....0!\n 0280 02203821 00739823 afb40010 00002010 . 8!.s.#...... .\n 0290 00002812 00000000 00000000 0c000000 ..(.............\n 02a0 afb30014 00729023 afb20018 8ec20434 .....r.#.......4\n 02b0 00541023 aec20434 8ec20438 8fa30014 .T.#...4...8....\n 02c0 00431023 aec20438 8ec2043c 8fa30018 .C.#...8...<....\n 02d0 00431023 aec2043c 92e20bd9 2fc30001 .C.#...<..../...\n 02e0 38420002 2c420001 00431024 10400021 8B..,B...C.$.@.!\n 02f0 00000000 8fa20010 00420018 8fa20018 .........B......\n 0300 00002010 00002812 00000000 00000000 .. ...(.........\n 0310 00420018 00004010 00004812 afa80030 .B....@...H....0\n 0320 afa90034 00a92821 00a9102b 00882021 ...4..(!...+.. !\n 0330 0c000000 00822021 00409021 3c020003 ...... !.@.!<...\n 0340 0052102a 1040000b 00000000 8ee40434 .R.*.@.........4\n 0350 8ee5043c 8ec60434 0c000000 8ec7043c ...<...4.......<\n 0360 02c02021 00021400 00022c03 0c000000 .. !......,.....\n 0370 02403021 8fa8002c 82e20bb4 27de0001 .@0!...,....'...\n 0380 2508000c 03c2102a 1440ff3b afa8002c %......*.@.;...,\n 0390 8fbf005c 8fbe0058 8fb70054 8fb60050 ...\\...X...T...P\n 03a0 8fb5004c 8fb40048 8fb30044 8fb20040 ...L...H...D...@\n 03b0 8fb1003c 8fb00038 03e00008 27bd0060 ...<...8....'..`\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005AE8C_5BA8C' — lift: cannot lift 'func_8005AE8C_5BA8C': 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,-96 */\n/* 4:\tsw\ts6,80(sp) */\n/* 8:\tmove\ts6,a0 */\n/* c:\tsw\tra,92(sp) */\n/* 10:\tsw\ts8,88(sp) */\n/* 14:\tsw\ts7,84(sp) */\n/* 18:\tsw\ts5,76(sp) */\n/* 1c:\tsw\ts4,72(sp) */\n/* 20:\tsw\ts3,68(sp) */\n/* 24:\tsw\ts2,64(sp) */\n/* 28:\tsw\ts1,60(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\ts0,56(sp) */\n/* 34:\tlw\ta0,16(v0) */\n/* 38:\tlbu\tv1,3000(s6) */\n/* 3c:\tlbu\tv0,6048(a0) */\n/* 40:\tbeq\tv1,v0,390 */\n/* 44:\taddiu\ts7,a0,3048 */\n/* 48:\tlw\tv0,2952(s6) */\n/* 4c:\tandi\tv0,v0,0x10 */\n/* 50:\tbnez\tv0,390 */\n/* 54:\tnop */\n/* 58:\tlw\tv0,6000(a0) */\n/* 5c:\tandi\tv0,v0,0x10 */\n/* 60:\tbnez\tv0,390 */\n/* 64:\tnop */\n/* 68:\tlb\tv0,6044(a0) */\n/* 6c:\tblez\tv0,390 */\n/* 70:\tmove\ts8,zero */\n/* 74:\tsw\ts7,44(sp) */\n/* 78:\tlw\tt0,44(sp) */\n/* 7c:\taddiu\ta0,sp,16 */\n/* 80:\tli\ta2,12 */\n/* 84:\tjal\t0 */\n/* 88:\taddiu\ta1,t0,2788 */\n/* 8c:\tlw\ta0,16(sp) */\n/* 90:\tlw\tv0,1076(s7) */\n/* 94:\tlw\ta1,20(sp) */\n/* 98:\taddu\ta0,a0,v0 */\n/* 9c:\tsw\ta0,16(sp) */\n/* a0:\tlw\tv0,1080(s7) */\n/* a4:\tlw\ta2,24(sp) */\n/* a8:\taddu\ta1,a1,v0 */\n/* ac:\tsw\ta1,20(sp) */\n/* b0:\tlw\tv0,1084(s7) */\n/* b4:\taddu\ta2,a2,v0 */\n/* b8:\tsw\ta2,24(sp) */\n/* bc:\tlw\tv0,1076(s6) */\n/* c0:\tlw\tv1,2772(s6) */\n/* c4:\taddu\tv0,v0,v1 */\n/* c8:\tsubu\ta0,a0,v0 */\n/* cc:\tsw\ta0,16(sp) */\n/* d0:\tlw\tv0,1080(s6) */\n/* d4:\tlw\tv1,2776(s6) */\n/* d8:\taddu\tv0,v0,v1 */\n/* dc:\tsubu\ta3,a1,v0 */\n/* e0:\tsw\ta3,20(sp) */\n/* e4:\tlw\tv0,1084(s6) */\n/* e8:\tlw\tv1,2780(s6) */\n/* ec:\taddu\tv0,v0,v1 */\n/* f0:\tsubu\ta2,a2,v0 */\n/* f4:\tsll\tv0,s8,0x2 */\n/* f8:\taddu\tv0,v0,s7 */\n/* fc:\tsw\ta2,24(sp) */\n/* 100:\tlw\tv1,2860(v0) */\n/* 104:\tlw\tv0,2784(s6) */\n/* 108:\taddu\ts5,v1,v0 */\n/* 10c:\tnegu\tv1,s5 */\n/* 110:\tslt\tv0,v1,a0 */\n/* 114:\tbeqz\tv0,374 */\n/* 118:\tslt\tv0,a0,s5 */\n/* 11c:\tbeqz\tv0,374 */\n/* 120:\tslt\tv0,v1,a3 */\n/* 124:\tbeqz\tv0,374 */\n/* 128:\tslt\tv0,a3,s5 */\n/* 12c:\tbeqz\tv0,374 */\n/* 130:\tslt\tv0,v1,a2 */\n/* 134:\tbeqz\tv0,374 */\n/* 138:\tslt\tv0,a2,s5 */\n/* 13c:\tbeqz\tv0,374 */\n/* 140:\tmult\ta0,a0 */\n/* 144:\tmfhi\ta0 */\n/* 148:\tmflo\ta1 */\n/* \t... */\n/* 154:\tmult\ta3,a3 */\n/* 158:\tmfhi\tt0 */\n/* 15c:\tmflo\tt1 */\n/* \t... */\n/* 168:\tmult\ta2,a2 */\n/* 16c:\tsw\tt0,48(sp) */\n/* 170:\tsw\tt1,52(sp) */\n/* 174:\taddu\ta1,a1,t1 */\n/* 178:\tsltu\ta2,a1,t1 */\n/* 17c:\taddu\ta0,a0,t0 */\n/* 180:\taddu\ta0,a0,a2 */\n/* 184:\tmfhi\tv0 */\n/* 188:\tmflo\tv1 */\n/* 18c:\taddu\ta1,a1,v1 */\n/* 190:\tsltu\ta2,a1,v1 */\n/* 194:\taddu\ta0,a0,v0 */\n/* 198:\tjal\t0 */\n/* 19c:\taddu\ta0,a0,a2 */\n/* 1a0:\tmove\ts2,v0 */\n/* 1a4:\tslt\tv0,s2,s5 */\n/* 1a8:\tbeqz\tv0,374 */\n/* 1ac:\tli\tv0,1 */\n/* 1b0:\tlbu\tv1,3033(s7) */\n/* 1b4:\tbne\tv1,v0,1e0 */\n/* 1b8:\tli\tv0,3 */\n/* 1bc:\tlw\tv0,2948(s7) */\n/* 1c0:\tlui\tt0,0x4 */\n/* 1c4:\tand\tv0,v0,t0 */\n/* 1c8:\tbeqz\tv0,1dc */\n/* 1cc:\taddiu\tv0,s8,-4 */\n/* 1d0:\tsltiu\tv0,v0,2 */\n/* 1d4:\tbnez\tv0,204 */\n/* 1d8:\tnop */\n/* 1dc:\tli\tv0,3 */\n/* 1e0:\tbne\tv1,v0,214 */\n/* 1e4:\tlui\tt1,0x4 */\n/* 1e8:\tlw\tv0,2948(s7) */\n/* 1ec:\tand\tv0,v0,t1 */\n/* 1f0:\tbeqz\tv0,214 */\n/* 1f4:\taddiu\tv0,s8,-1 */\n/* 1f8:\tsltiu\tv0,v0,2 */\n/* 1fc:\tbeqz\tv0,214 */\n/* 200:\tnop */\n/* 204:\tjal\t0 */\n/* 208:\tmove\ta0,s6 */\n/* 20c:\tj\t374 */\n/* 210:\tnop */\n/* 214:\tbeqzl\ts2,21c */\n/* 218:\tli\ts2,1 */\n/* 21c:\tlw\ts4,16(sp) */\n/* 220:\tmult\ts4,s5 */\n/* 224:\tmove\ts1,s2 */\n/* 228:\tsra\ts0,s2,0x1f */\n/* 22c:\tlw\ts3,20(sp) */\n/* 230:\tmfhi\ta0 */\n/* 234:\tmflo\ta1 */\n/* 238:\tmove\ta2,s0 */\n/* 23c:\tnop */\n/* 240:\tjal\t0 */\n/* 244:\tmove\ta3,s1 */\n/* 248:\tnop */\n/* 24c:\tmult\ts3,s5 */\n/* 250:\tmove\ta2,s0 */\n/* 254:\tmove\ta3,s1 */\n/* 258:\tlw\ts2,24(sp) */\n/* 25c:\tmfhi\ta0 */\n/* 260:\tmflo\ta1 */\n/* \t... */\n/* 26c:\tjal\t0 */\n/* 270:\tsubu\ts4,v1,s4 */\n/* 274:\tnop */\n/* 278:\tmult\ts2,s5 */\n/* 27c:\tmove\ta2,s0 */\n/* 280:\tmove\ta3,s1 */\n/* 284:\tsubu\ts3,v1,s3 */\n/* 288:\tsw\ts4,16(sp) */\n/* 28c:\tmfhi\ta0 */\n/* 290:\tmflo\ta1 */\n/* \t... */\n/* 29c:\tjal\t0 */\n/* 2a0:\tsw\ts3,20(sp) */\n/* 2a4:\tsubu\ts2,v1,s2 */\n/* 2a8:\tsw\ts2,24(sp) */\n/* 2ac:\tlw\tv0,1076(s6) */\n/* 2b0:\tsubu\tv0,v0,s4 */\n/* 2b4:\tsw\tv0,1076(s6) */\n/* 2b8:\tlw\tv0,1080(s6) */\n/* 2bc:\tlw\tv1,20(sp) */\n/* 2c0:\tsubu\tv0,v0,v1 */\n/* 2c4:\tsw\tv0,1080(s6) */\n/* 2c8:\tlw\tv0,1084(s6) */\n/* 2cc:\tlw\tv1,24(sp) */\n/* 2d0:\tsubu\tv0,v0,v1 */\n/* 2d4:\tsw\tv0,1084(s6) */\n/* 2d8:\tlbu\tv0,3033(s7) */\n/* 2dc:\tsltiu\tv1,s8,1 */\n/* 2e0:\txori\tv0,v0,0x2 */\n/* 2e4:\tsltiu\tv0,v0,1 */\n/* 2e8:\tand\tv0,v0,v1 */\n/* 2ec:\tbeqz\tv0,374 */\n/* 2f0:\tnop */\n/* 2f4:\tlw\tv0,16(sp) */\n/* 2f8:\tmult\tv0,v0 */\n/* 2fc:\tlw\tv0,24(sp) */\n/* 300:\tmfhi\ta0 */\n/* 304:\tmflo\ta1 */\n/* \t... */\n/* 310:\tmult\tv0,v0 */\n/* 314:\tmfhi\tt0 */\n/* 318:\tmflo\tt1 */\n/* 31c:\tsw\tt0,48(sp) */\n/* 320:\tsw\tt1,52(sp) */\n/* 324:\taddu\ta1,a1,t1 */\n/* 328:\tsltu\tv0,a1,t1 */\n/* 32c:\taddu\ta0,a0,t0 */\n/* 330:\tjal\t0 */\n/* 334:\taddu\ta0,a0,v0 */\n/* 338:\tmove\ts2,v0 */\n/* 33c:\tlui\tv0,0x3 */\n/* 340:\tslt\tv0,v0,s2 */\n/* 344:\tbeqz\tv0,374 */\n/* 348:\tnop */\n/* 34c:\tlw\ta0,1076(s7) */\n/* 350:\tlw\ta1,1084(s7) */\n/* 354:\tlw\ta2,1076(s6) */\n/* 358:\tjal\t0 */\n/* 35c:\tlw\ta3,1084(s6) */\n/* 360:\tmove\ta0,s6 */\n/* 364:\tsll\tv0,v0,0x10 */\n/* 368:\tsra\ta1,v0,0x10 */\n/* 36c:\tjal\t0 */\n/* 370:\tmove\ta2,s2 */\n/* 374:\tlw\tt0,44(sp) */\n/* 378:\tlb\tv0,2996(s7) */\n/* 37c:\taddiu\ts8,s8,1 */\n/* 380:\taddiu\tt0,t0,12 */\n/* 384:\tslt\tv0,s8,v0 */\n/* 388:\tbnez\tv0,78 */\n/* 38c:\tsw\tt0,44(sp) */\n/* 390:\tlw\tra,92(sp) */\n/* 394:\tlw\ts8,88(sp) */\n/* 398:\tlw\ts7,84(sp) */\n/* 39c:\tlw\ts6,80(sp) */\n/* 3a0:\tlw\ts5,76(sp) */\n/* 3a4:\tlw\ts4,72(sp) */\n/* 3a8:\tlw\ts3,68(sp) */\n/* 3ac:\tlw\ts2,64(sp) */\n/* 3b0:\tlw\ts1,60(sp) */\n/* 3b4:\tlw\ts0,56(sp) */\n/* 3b8:\tjr\tra */\n/* 3bc:\taddiu\tsp,sp,96 */\nvoid func_8005AE8C_5BA8C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005AE8C_5BA8C': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":243,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005AE8C_5BA8C': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\n? func_80058B30_59730(Player *); /* extern */\n\nvoid func_8005AE8C_5BA8C(Player *player) {\n s32 sp10;\n s32 sp14;\n s32 sp18;\n void *sp2C;\n s32 sp30;\n u32 sp34;\n s32 temp_a0_2;\n s32 temp_a0_3;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a3;\n s32 temp_hi;\n s32 temp_hi_2;\n s32 temp_s0;\n s32 temp_s3;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_s2;\n s32 var_s8;\n u32 temp_a1_2;\n u32 temp_a1_3;\n u32 temp_a1_4;\n u32 temp_lo;\n u32 temp_lo_2;\n u32 temp_lo_3;\n u8 temp_v1_2;\n void *temp_a0;\n void *temp_s7;\n\n temp_a0 = getCurrentAllocation()->unk10;\n temp_s7 = temp_a0 + 0xBE8;\n if ((player->unkBB8 != temp_a0->unk17A0) && !(player->unkB88 & 0x10) && !(temp_a0->unk1770 & 0x10)) {\n var_s8 = 0;\n if (temp_a0->unk179C > 0) {\n sp2C = temp_s7;\n do {\n memcpy(&sp10, sp2C + 0xAE4, 0xCU);\n temp_a0_2 = sp10 + temp_s7->unk434;\n sp10 = temp_a0_2;\n temp_a1 = sp14 + temp_s7->unk438;\n sp14 = temp_a1;\n temp_a2 = sp18 + temp_s7->unk43C;\n sp18 = temp_a2;\n temp_a0_3 = temp_a0_2 - (player->worldPos.x + player->unkAD4[0]);\n sp10 = temp_a0_3;\n temp_a3 = temp_a1 - (player->worldPos.y + player->unkAD4[1]);\n sp14 = temp_a3;\n temp_a2_2 = temp_a2 - (player->worldPos.z + player->unkAD4[2]);\n sp18 = temp_a2_2;\n temp_s5 = ((var_s8 * 4) + temp_s7)->unkB2C + player->unkAE0;\n temp_v1 = -temp_s5;\n if ((temp_v1 < temp_a0_3) && (temp_a0_3 < temp_s5) && (temp_v1 < temp_a3) && (temp_a3 < temp_s5) && (temp_v1 < temp_a2_2) && (temp_a2_2 < temp_s5)) {\n temp_hi = MULT_HI(temp_a3, temp_a3);\n temp_lo = temp_a3 * temp_a3;\n temp_lo_2 = temp_a2_2 * temp_a2_2;\n sp30 = temp_hi;\n sp34 = temp_lo;\n temp_a1_2 = (temp_a0_3 * temp_a0_3) + temp_lo;\n temp_a1_3 = temp_a1_2 + temp_lo_2;\n var_s2 = isqrt64(/* s64+0x0 */ (MULT_HI(temp_a0_3, temp_a0_3) + temp_hi + (temp_a1_2 < temp_lo) + MULT_HI(temp_a2_2, temp_a2_2) + (temp_a1_3 < temp_lo_2)), /* s64+0x4 */ temp_a1_3);\n if (var_s2 < temp_s5) {\n temp_v1_2 = temp_s7->unkBD9;\n if (temp_v1_2 == 1) {\n if (!(temp_s7->unkB84 & 0x40000) || ((u32) (var_s8 - 4) >= 2U)) {\n goto block_16;\n }\n goto block_19;\n }\nblock_16:\n if ((temp_v1_2 == 3) && (temp_s7->unkB84 & 0x40000) && ((u32) (var_s8 - 1) < 2U)) {\nblock_19:\n func_80058B30_59730(player);\n } else {\n if (var_s2 == 0) {\n var_s2 = 1;\n }\n temp_s0 = var_s2 >> 0x1F;\n temp_s4 = (u32) __divdi3(MULT_HI(sp10, temp_s5), sp10 * temp_s5, temp_s0, var_s2) - sp10;\n temp_s3 = (u32) __divdi3(MULT_HI(sp14, temp_s5), sp14 * temp_s5, temp_s0, var_s2) - sp14;\n sp10 = temp_s4;\n sp14 = temp_s3;\n sp18 = (u32) __divdi3(MULT_HI(sp18, temp_s5), sp18 * temp_s5, temp_s0, var_s2) - sp18;\n player->worldPos.x -= temp_s4;\n player->worldPos.y -= sp14;\n player->worldPos.z -= sp18;\n if ((temp_s7->unkBD9 == 2) & (var_s8 == 0)) {\n temp_hi_2 = MULT_HI(sp18, sp18);\n temp_lo_3 = sp18 * sp18;\n sp30 = temp_hi_2;\n sp34 = temp_lo_3;\n temp_a1_4 = (sp10 * sp10) + temp_lo_3;\n temp_v0 = isqrt64(/* s64+0x0 */ (MULT_HI(sp10, sp10) + temp_hi_2 + (temp_a1_4 < temp_lo_3)), /* s64+0x4 */ temp_a1_4);\n if (temp_v0 > 0x30000) {\n func_80058950_59550(player, func_8006D21C_6DE1C(temp_s7->unk434, temp_s7->unk43C, player->worldPos.x, player->worldPos.z), temp_v0);\n }\n }\n }\n }\n }\n var_s8 += 1;\n sp2C += 0xC;\n } while (var_s8 < temp_s7->unkBB4);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":70,"lines":110,"gotos":2,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005AE8C_5BA8C` — benchmark function snowboardkids2:func_8005AE8C_5BA8C:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_8005AE8C_5BA8C\n addiu\t$sp, $sp, -96\n sw\t$s6, 80($sp)\n move\t$s6, $a0\n sw\t$ra, 92($sp)\n sw\t$s8, 88($sp)\n sw\t$s7, 84($sp)\n sw\t$s5, 76($sp)\n sw\t$s4, 72($sp)\n sw\t$s3, 68($sp)\n sw\t$s2, 64($sp)\n sw\t$s1, 60($sp)\n jal\tgetCurrentAllocation\n sw\t$s0, 56($sp)\n lw\t$a0, 16($v0)\n lbu\t$v1, 3000($s6)\n lbu\t$v0, 6048($a0)\n beq\t$v1, $v0, .L390\n addiu\t$s7, $a0, 3048\n lw\t$v0, 2952($s6)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L390\n nop\n lw\t$v0, 6000($a0)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L390\n nop\n lb\t$v0, 6044($a0)\n blez\t$v0, .L390\n move\t$s8, $zero\n sw\t$s7, 44($sp)\n.L78:\n lw\t$t0, 44($sp)\n addiu\t$a0, $sp, 16\n li\t$a2, 12\n jal\tmemcpy\n addiu\t$a1, $t0, 2788\n lw\t$a0, 16($sp)\n lw\t$v0, 1076($s7)\n lw\t$a1, 20($sp)\n addu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s7)\n lw\t$a2, 24($sp)\n addu\t$a1, $a1, $v0\n sw\t$a1, 20($sp)\n lw\t$v0, 1084($s7)\n addu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v0, 1076($s6)\n lw\t$v1, 2772($s6)\n addu\t$v0, $v0, $v1\n subu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s6)\n lw\t$v1, 2776($s6)\n addu\t$v0, $v0, $v1\n subu\t$a3, $a1, $v0\n sw\t$a3, 20($sp)\n lw\t$v0, 1084($s6)\n lw\t$v1, 2780($s6)\n addu\t$v0, $v0, $v1\n subu\t$a2, $a2, $v0\n sll\t$v0, $s8, 0x2\n addu\t$v0, $v0, $s7\n sw\t$a2, 24($sp)\n lw\t$v1, 2860($v0)\n lw\t$v0, 2784($s6)\n addu\t$s5, $v1, $v0\n negu\t$v1, $s5\n slt\t$v0, $v1, $a0\n beqz\t$v0, .L374\n slt\t$v0, $a0, $s5\n beqz\t$v0, .L374\n slt\t$v0, $v1, $a3\n beqz\t$v0, .L374\n slt\t$v0, $a3, $s5\n beqz\t$v0, .L374\n slt\t$v0, $v1, $a2\n beqz\t$v0, .L374\n slt\t$v0, $a2, $s5\n beqz\t$v0, .L374\n mult\t$a0, $a0\n mfhi\t$a0\n mflo\t$a1\n mult\t$a3, $a3\n mfhi\t$t0\n mflo\t$t1\n mult\t$a2, $a2\n sw\t$t0, 48($sp)\n sw\t$t1, 52($sp)\n addu\t$a1, $a1, $t1\n sltu\t$a2, $a1, $t1\n addu\t$a0, $a0, $t0\n addu\t$a0, $a0, $a2\n mfhi\t$v0\n mflo\t$v1\n addu\t$a1, $a1, $v1\n sltu\t$a2, $a1, $v1\n addu\t$a0, $a0, $v0\n jal\tisqrt64\n addu\t$a0, $a0, $a2\n move\t$s2, $v0\n slt\t$v0, $s2, $s5\n beqz\t$v0, .L374\n li\t$v0, 1\n lbu\t$v1, 3033($s7)\n bne\t$v1, $v0, .L1e0\n li\t$v0, 3\n lw\t$v0, 2948($s7)\n lui\t$t0, 0x4\n and\t$v0, $v0, $t0\n beqz\t$v0, .L1dc\n addiu\t$v0, $s8, -4\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L204\n nop\n.L1dc:\n li\t$v0, 3\n.L1e0:\n bne\t$v1, $v0, .L214\n lui\t$t1, 0x4\n lw\t$v0, 2948($s7)\n and\t$v0, $v0, $t1\n beqz\t$v0, .L214\n addiu\t$v0, $s8, -1\n sltiu\t$v0, $v0, 2\n beqz\t$v0, .L214\n nop\n.L204:\n jal\tfunc_80058B30_59730\n move\t$a0, $s6\n j\t.L374\n nop\n.L214:\n beqzl\t$s2, .L21c\n li\t$s2, 1\n.L21c:\n lw\t$s4, 16($sp)\n mult\t$s4, $s5\n move\t$s1, $s2\n sra\t$s0, $s2, 0x1f\n lw\t$s3, 20($sp)\n mfhi\t$a0\n mflo\t$a1\n move\t$a2, $s0\n nop\n jal\t__divdi3\n move\t$a3, $s1\n nop\n mult\t$s3, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n lw\t$s2, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n subu\t$s4, $v1, $s4\n nop\n mult\t$s2, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n subu\t$s3, $v1, $s3\n sw\t$s4, 16($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$s3, 20($sp)\n subu\t$s2, $v1, $s2\n sw\t$s2, 24($sp)\n lw\t$v0, 1076($s6)\n subu\t$v0, $v0, $s4\n sw\t$v0, 1076($s6)\n lw\t$v0, 1080($s6)\n lw\t$v1, 20($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1080($s6)\n lw\t$v0, 1084($s6)\n lw\t$v1, 24($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1084($s6)\n lbu\t$v0, 3033($s7)\n sltiu\t$v1, $s8, 1\n xori\t$v0, $v0, 0x2\n sltiu\t$v0, $v0, 1\n and\t$v0, $v0, $v1\n beqz\t$v0, .L374\n nop\n lw\t$v0, 16($sp)\n mult\t$v0, $v0\n lw\t$v0, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n mult\t$v0, $v0\n mfhi\t$t0\n mflo\t$t1\n sw\t$t0, 48($sp)\n sw\t$t1, 52($sp)\n addu\t$a1, $a1, $t1\n sltu\t$v0, $a1, $t1\n addu\t$a0, $a0, $t0\n jal\tisqrt64\n addu\t$a0, $a0, $v0\n move\t$s2, $v0\n lui\t$v0, 0x3\n slt\t$v0, $v0, $s2\n beqz\t$v0, .L374\n nop\n lw\t$a0, 1076($s7)\n lw\t$a1, 1084($s7)\n lw\t$a2, 1076($s6)\n jal\tfunc_8006D21C_6DE1C\n lw\t$a3, 1084($s6)\n move\t$a0, $s6\n sll\t$v0, $v0, 0x10\n sra\t$a1, $v0, 0x10\n jal\tfunc_80058950_59550\n move\t$a2, $s2\n.L374:\n lw\t$t0, 44($sp)\n lb\t$v0, 2996($s7)\n addiu\t$s8, $s8, 1\n addiu\t$t0, $t0, 12\n slt\t$v0, $s8, $v0\n bnez\t$v0, .L78\n sw\t$t0, 44($sp)\n.L390:\n lw\t$ra, 92($sp)\n lw\t$s8, 88($sp)\n lw\t$s7, 84($sp)\n lw\t$s6, 80($sp)\n lw\t$s5, 76($sp)\n lw\t$s4, 72($sp)\n lw\t$s3, 68($sp)\n lw\t$s2, 64($sp)\n lw\t$s1, 60($sp)\n lw\t$s0, 56($sp)\n jr\t$ra\n addiu\t$sp, $sp, 96\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-3c0ef0b3e2c0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8005AE8C_5BA8C(Player *player);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005AE8C_5BA8C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005AE8C_5BA8C` — benchmark function snowboardkids2:func_8005AE8C_5BA8C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005AE8C_5BA8C: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,-96\n 4:\tsw\ts6,80(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,92(sp)\n 10:\tsw\ts8,88(sp)\n 14:\tsw\ts7,84(sp)\n 18:\tsw\ts5,76(sp)\n 1c:\tsw\ts4,72(sp)\n 20:\tsw\ts3,68(sp)\n 24:\tsw\ts2,64(sp)\n 28:\tsw\ts1,60(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,56(sp)\n 34:\tlw\ta0,16(v0)\n 38:\tlbu\tv1,3000(s6)\n 3c:\tlbu\tv0,6048(a0)\n 40:\tbeq\tv1,v0,390 \n 44:\taddiu\ts7,a0,3048\n 48:\tlw\tv0,2952(s6)\n 4c:\tandi\tv0,v0,0x10\n 50:\tbnez\tv0,390 \n 54:\tnop\n 58:\tlw\tv0,6000(a0)\n 5c:\tandi\tv0,v0,0x10\n 60:\tbnez\tv0,390 \n 64:\tnop\n 68:\tlb\tv0,6044(a0)\n 6c:\tblez\tv0,390 \n 70:\tmove\ts8,zero\n 74:\tsw\ts7,44(sp)\n 78:\tlw\tt0,44(sp)\n 7c:\taddiu\ta0,sp,16\n 80:\tli\ta2,12\n 84:\tjal\t0 \n 88:\taddiu\ta1,t0,2788\n 8c:\tlw\ta0,16(sp)\n 90:\tlw\tv0,1076(s7)\n 94:\tlw\ta1,20(sp)\n 98:\taddu\ta0,a0,v0\n 9c:\tsw\ta0,16(sp)\n a0:\tlw\tv0,1080(s7)\n a4:\tlw\ta2,24(sp)\n a8:\taddu\ta1,a1,v0\n ac:\tsw\ta1,20(sp)\n b0:\tlw\tv0,1084(s7)\n b4:\taddu\ta2,a2,v0\n b8:\tsw\ta2,24(sp)\n bc:\tlw\tv0,1076(s6)\n c0:\tlw\tv1,2772(s6)\n c4:\taddu\tv0,v0,v1\n c8:\tsubu\ta0,a0,v0\n cc:\tsw\ta0,16(sp)\n d0:\tlw\tv0,1080(s6)\n d4:\tlw\tv1,2776(s6)\n d8:\taddu\tv0,v0,v1\n dc:\tsubu\ta3,a1,v0\n e0:\tsw\ta3,20(sp)\n e4:\tlw\tv0,1084(s6)\n e8:\tlw\tv1,2780(s6)\n ec:\taddu\tv0,v0,v1\n f0:\tsubu\ta2,a2,v0\n f4:\tsll\tv0,s8,0x2\n f8:\taddu\tv0,v0,s7\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2860(v0)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,374 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,374 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,374 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,374 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,374 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,374 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,48(sp)\n 170:\tsw\tt1,52(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\ts2,v0\n 1a4:\tslt\tv0,s2,s5\n 1a8:\tbeqz\tv0,374 \n 1ac:\tli\tv0,1\n 1b0:\tlbu\tv1,3033(s7)\n 1b4:\tbne\tv1,v0,1e0 \n 1b8:\tli\tv0,3\n 1bc:\tlw\tv0,2948(s7)\n 1c0:\tlui\tt0,0x4\n 1c4:\tand\tv0,v0,t0\n 1c8:\tbeqz\tv0,1dc \n 1cc:\taddiu\tv0,s8,-4\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,204 \n 1d8:\tnop\n 1dc:\tli\tv0,3\n 1e0:\tbne\tv1,v0,214 \n 1e4:\tlui\tt1,0x4\n 1e8:\tlw\tv0,2948(s7)\n 1ec:\tand\tv0,v0,t1\n 1f0:\tbeqz\tv0,214 \n 1f4:\taddiu\tv0,s8,-1\n 1f8:\tsltiu\tv0,v0,2\n 1fc:\tbeqz\tv0,214 \n 200:\tnop\n 204:\tjal\t0 \n 208:\tmove\ta0,s6\n 20c:\tj\t374 \n 210:\tnop\n 214:\tbeqzl\ts2,21c \n 218:\tli\ts2,1\n 21c:\tlw\ts4,16(sp)\n 220:\tmult\ts4,s5\n 224:\tmove\ts1,s2\n 228:\tsra\ts0,s2,0x1f\n 22c:\tlw\ts3,20(sp)\n 230:\tmfhi\ta0\n 234:\tmflo\ta1\n 238:\tmove\ta2,s0\n 23c:\tnop\n 240:\tjal\t0 \n 244:\tmove\ta3,s1\n 248:\tnop\n 24c:\tmult\ts3,s5\n 250:\tmove\ta2,s0\n 254:\tmove\ta3,s1\n 258:\tlw\ts2,24(sp)\n 25c:\tmfhi\ta0\n 260:\tmflo\ta1\n\t...\n 26c:\tjal\t0 \n 270:\tsubu\ts4,v1,s4\n 274:\tnop\n 278:\tmult\ts2,s5\n 27c:\tmove\ta2,s0\n 280:\tmove\ta3,s1\n 284:\tsubu\ts3,v1,s3\n 288:\tsw\ts4,16(sp)\n 28c:\tmfhi\ta0\n 290:\tmflo\ta1\n\t...\n 29c:\tjal\t0 \n 2a0:\tsw\ts3,20(sp)\n 2a4:\tsubu\ts2,v1,s2\n 2a8:\tsw\ts2,24(sp)\n 2ac:\tlw\tv0,1076(s6)\n 2b0:\tsubu\tv0,v0,s4\n 2b4:\tsw\tv0,1076(s6)\n 2b8:\tlw\tv0,1080(s6)\n 2bc:\tlw\tv1,20(sp)\n 2c0:\tsubu\tv0,v0,v1\n 2c4:\tsw\tv0,1080(s6)\n 2c8:\tlw\tv0,1084(s6)\n 2cc:\tlw\tv1,24(sp)\n 2d0:\tsubu\tv0,v0,v1\n 2d4:\tsw\tv0,1084(s6)\n 2d8:\tlbu\tv0,3033(s7)\n 2dc:\tsltiu\tv1,s8,1\n 2e0:\txori\tv0,v0,0x2\n 2e4:\tsltiu\tv0,v0,1\n 2e8:\tand\tv0,v0,v1\n 2ec:\tbeqz\tv0,374 \n 2f0:\tnop\n 2f4:\tlw\tv0,16(sp)\n 2f8:\tmult\tv0,v0\n 2fc:\tlw\tv0,24(sp)\n 300:\tmfhi\ta0\n 304:\tmflo\ta1\n\t...\n 310:\tmult\tv0,v0\n 314:\tmfhi\tt0\n 318:\tmflo\tt1\n 31c:\tsw\tt0,48(sp)\n 320:\tsw\tt1,52(sp)\n 324:\taddu\ta1,a1,t1\n 328:\tsltu\tv0,a1,t1\n 32c:\taddu\ta0,a0,t0\n 330:\tjal\t0 \n 334:\taddu\ta0,a0,v0\n 338:\tmove\ts2,v0\n 33c:\tlui\tv0,0x3\n 340:\tslt\tv0,v0,s2\n 344:\tbeqz\tv0,374 \n 348:\tnop\n 34c:\tlw\ta0,1076(s7)\n 350:\tlw\ta1,1084(s7)\n 354:\tlw\ta2,1076(s6)\n 358:\tjal\t0 \n 35c:\tlw\ta3,1084(s6)\n 360:\tmove\ta0,s6\n 364:\tsll\tv0,v0,0x10\n 368:\tsra\ta1,v0,0x10\n 36c:\tjal\t0 \n 370:\tmove\ta2,s2\n 374:\tlw\tt0,44(sp)\n 378:\tlb\tv0,2996(s7)\n 37c:\taddiu\ts8,s8,1\n 380:\taddiu\tt0,t0,12\n 384:\tslt\tv0,s8,v0\n 388:\tbnez\tv0,78 \n 38c:\tsw\tt0,44(sp)\n 390:\tlw\tra,92(sp)\n 394:\tlw\ts8,88(sp)\n 398:\tlw\ts7,84(sp)\n 39c:\tlw\ts6,80(sp)\n 3a0:\tlw\ts5,76(sp)\n 3a4:\tlw\ts4,72(sp)\n 3a8:\tlw\ts3,68(sp)\n 3ac:\tlw\ts2,64(sp)\n 3b0:\tlw\ts1,60(sp)\n 3b4:\tlw\ts0,56(sp)\n 3b8:\tjr\tra\n 3bc:\taddiu\tsp,sp,96\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-84d07a69b637e7e0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t000003c0 func_8005AE8C_5BA8C\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n00000000 *UND*\t00000000 func_80058B30_59730\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 func_80058950_59550\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n00000084 R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n00000204 R_MIPS_26 func_80058B30_59730\n0000020c R_MIPS_26 .text\n00000240 R_MIPS_26 __divdi3\n0000026c R_MIPS_26 __divdi3\n0000029c R_MIPS_26 __divdi3\n00000330 R_MIPS_26 isqrt64\n00000358 R_MIPS_26 func_8006D21C_6DE1C\n0000036c R_MIPS_26 func_80058950_59550\n\n\nContents of section .text:\n 0000 27bdffa0 afb60050 0080b021 afbf005c '......P...!...\\\n 0010 afbe0058 afb70054 afb5004c afb40048 ...X...T...L...H\n 0020 afb30044 afb20040 afb1003c 0c000000 ...D...@...<....\n 0030 afb00038 8c440010 92c30bb8 908217a0 ...8.D..........\n 0040 106200d3 24970be8 8ec20b88 30420010 .b..$.......0B..\n 0050 144000cf 00000000 8c821770 30420010 .@.........p0B..\n 0060 144000cb 00000000 8082179c 184000c8 .@...........@..\n 0070 0000f021 afb7002c 8fa8002c 27a40010 ...!...,...,'...\n 0080 2406000c 0c000000 25050ae4 8fa40010 $.......%.......\n 0090 8ee20434 8fa50014 00822021 afa40010 ...4...... !....\n 00a0 8ee20438 8fa60018 00a22821 afa50014 ...8......(!....\n 00b0 8ee2043c 00c23021 afa60018 8ec20434 ...<..0!.......4\n 00c0 8ec30ad4 00431021 00822023 afa40010 .....C.!.. #....\n 00d0 8ec20438 8ec30ad8 00431021 00a23823 ...8.....C.!..8#\n 00e0 afa70014 8ec2043c 8ec30adc 00431021 .......<.....C.!\n 00f0 00c23023 001e1080 00571021 afa60018 ..0#.....W.!....\n 0100 8c430b2c 8ec20ae0 0062a821 00151823 .C.,.....b.!...#\n 0110 0064102a 10400097 0095102a 10400095 .d.*.@.....*.@..\n 0120 0067102a 10400093 00f5102a 10400091 .g.*.@.....*.@..\n 0130 0066102a 1040008f 00d5102a 1040008d .f.*.@.....*.@..\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80030 ...............0\n 0170 afa90034 00a92821 00a9302b 00882021 ...4..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00409021 0255102a 10400072 24020001 .@.!.U.*.@.r$...\n 01b0 92e30bd9 1462000a 24020003 8ee20b84 .....b..$.......\n 01c0 3c080004 00481024 10400004 27c2fffc <....H.$.@..'...\n 01d0 2c420002 1440000b 00000000 24020003 ,B...@......$...\n 01e0 1462000c 3c090004 8ee20b84 00491024 .b..<........I.$\n 01f0 10400008 27c2ffff 2c420002 10400005 .@..'...,B...@..\n 0200 00000000 0c000000 02c02021 080000dd .......... !....\n 0210 00000000 52400001 24120001 8fb40010 ....R@..$.......\n 0220 02950018 02408821 001287c3 8fb30014 .....@.!........\n 0230 00002010 00002812 02003021 00000000 .. ...(...0!....\n 0240 0c000000 02203821 00000000 02750018 ..... 8!.....u..\n 0250 02003021 02203821 8fb20018 00002010 ..0!. 8!...... .\n 0260 00002812 00000000 00000000 0c000000 ..(.............\n 0270 0074a023 00000000 02550018 02003021 .t.#.....U....0!\n 0280 02203821 00739823 afb40010 00002010 . 8!.s.#...... .\n 0290 00002812 00000000 00000000 0c000000 ..(.............\n 02a0 afb30014 00729023 afb20018 8ec20434 .....r.#.......4\n 02b0 00541023 aec20434 8ec20438 8fa30014 .T.#...4...8....\n 02c0 00431023 aec20438 8ec2043c 8fa30018 .C.#...8...<....\n 02d0 00431023 aec2043c 92e20bd9 2fc30001 .C.#...<..../...\n 02e0 38420002 2c420001 00431024 10400021 8B..,B...C.$.@.!\n 02f0 00000000 8fa20010 00420018 8fa20018 .........B......\n 0300 00002010 00002812 00000000 00000000 .. ...(.........\n 0310 00420018 00004010 00004812 afa80030 .B....@...H....0\n 0320 afa90034 00a92821 00a9102b 00882021 ...4..(!...+.. !\n 0330 0c000000 00822021 00409021 3c020003 ...... !.@.!<...\n 0340 0052102a 1040000b 00000000 8ee40434 .R.*.@.........4\n 0350 8ee5043c 8ec60434 0c000000 8ec7043c ...<...4.......<\n 0360 02c02021 00021400 00022c03 0c000000 .. !......,.....\n 0370 02403021 8fa8002c 82e20bb4 27de0001 .@0!...,....'...\n 0380 2508000c 03c2102a 1440ff3b afa8002c %......*.@.;...,\n 0390 8fbf005c 8fbe0058 8fb70054 8fb60050 ...\\...X...T...P\n 03a0 8fb5004c 8fb40048 8fb30044 8fb20040 ...L...H...D...@\n 03b0 8fb1003c 8fb00038 03e00008 27bd0060 ...<...8....'..`\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005AE8C_5BA8C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005AE8C_5BA8C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_8005DF10_5EB10:gcc2.7.2kmc","sym":"func_8005DF10_5EB10","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["pointer","array","shift","call"],"loc":125,"refSource":"void func_8005DF10_5EB10(s16 arg0, s16 arg1, s16 arg2, s16 *arg3) {\n s32 spVars[3];\n s16 temp_s0;\n s16 temp_s1;\n s32 temp_a0;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a3;\n s32 temp_s0_2;\n s32 temp_s1_2;\n s32 temp_s2;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_t0;\n s32 temp_t1;\n s32 temp_t2;\n s32 temp_v1;\n s32 temp_v1_2;\n s32 temp_v1_3;\n s32 var_a0;\n s32 var_v0;\n s32 var_v1;\n\n temp_s0 = arg1;\n temp_s1 = -arg0;\n temp_s5 = approximateSin(temp_s1);\n temp_s0 = -temp_s0;\n temp_s1_2 = approximateSin(temp_s0);\n temp_s0_2 = approximateCos(temp_s1);\n temp_s4 = approximateCos(temp_s0);\n temp_s2 = approximateSin(arg2);\n temp_a3 = approximateCos(arg2);\n var_v1 = temp_s5 * temp_s1_2;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_s5 * temp_s4;\n temp_a2 = var_v1 >> 0xD;\n spVars[0] = temp_a2;\n spVars[1] = temp_s0_2;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a2 * temp_s0_2;\n temp_a0 = var_v0 >> 0xD;\n spVars[2] = temp_a0;\n temp_a1 = 0x2000 - temp_a3;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_s0_2 * temp_a0;\n temp_t2 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a0 * temp_a2;\n temp_t0 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a2 * temp_a2;\n temp_t1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_a0 = temp_a2 * temp_s2;\n temp_a1 = var_v1 >> 0xD;\n if (var_a0 < 0) {\n var_a0 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1 = var_a0 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[0] = temp_a1 + (var_v0 >> 0xD);\n arg3[7] = (s16)(temp_t0 - temp_v1);\n arg3[5] = (s16)(temp_t0 + temp_v1);\n var_v0 = spVars[1] * spVars[1];\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = spVars[1] * temp_s2;\n temp_a1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1_2 = var_v1 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[4] = (s16)(temp_a1 + (var_v0 >> 0xD));\n arg3[6] = (s16)(temp_t1 + temp_v1_2);\n arg3[2] = (s16)(temp_t1 - temp_v1_2);\n var_v0 = spVars[2] * spVars[2];\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = spVars[2] * temp_s2;\n temp_a1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1_3 = var_v1 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[8] = (s16)(temp_a1 + (var_v0 >> 0xD));\n arg3[3] = (s16)(temp_t2 - temp_v1_3);\n arg3[1] = (s16)(temp_t2 + temp_v1_3);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5EA60.c#L33-L157","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a1\n c:\tsw\ts2,40(sp)\n 10:\tmove\ts2,a2\n 14:\tsw\ts3,44(sp)\n 18:\tmove\ts3,a3\n 1c:\tsw\ts1,36(sp)\n 20:\tnegu\ts1,a0\n 24:\tsll\ts1,s1,0x10\n 28:\tsra\ts1,s1,0x10\n 2c:\tmove\ta0,s1\n 30:\tsw\tra,56(sp)\n 34:\tsw\ts5,52(sp)\n 38:\tjal\t0 \n 3c:\tsw\ts4,48(sp)\n 40:\tnegu\ts0,s0\n 44:\tsll\ts0,s0,0x10\n 48:\tsra\ts0,s0,0x10\n 4c:\tmove\ta0,s0\n 50:\tjal\t0 \n 54:\tmove\ts5,v0\n 58:\tmove\ta0,s1\n 5c:\tjal\t0 \n 60:\tmove\ts1,v0\n 64:\tmove\ta0,s0\n 68:\tjal\t0 \n 6c:\tmove\ts0,v0\n 70:\tsll\ts2,s2,0x10\n 74:\tsra\ts2,s2,0x10\n 78:\tmove\ta0,s2\n 7c:\tjal\t0 \n 80:\tmove\ts4,v0\n 84:\tmove\ta0,s2\n 88:\tjal\t0 \n 8c:\tmove\ts2,v0\n 90:\tnop\n 94:\tmult\ts5,s1\n 98:\tmflo\tv1\n\t...\n a4:\tbgez\tv1,b0 \n a8:\tmove\ta3,v0\n ac:\taddiu\tv1,v1,8191\n b0:\tnop\n b4:\tmult\ts5,s4\n b8:\tmflo\tv0\n bc:\tsra\ta2,v1,0xd\n c0:\tsw\ta2,16(sp)\n c4:\tbgez\tv0,d0 \n c8:\tsw\ts0,20(sp)\n cc:\taddiu\tv0,v0,8191\n d0:\tnop\n d4:\tmult\ta2,s0\n d8:\tmflo\tv1\n dc:\tsra\ta0,v0,0xd\n e0:\tsw\ta0,24(sp)\n e4:\tli\tv0,8192\n e8:\tbgez\tv1,f4 \n ec:\tsubu\ta1,v0,a3\n f0:\taddiu\tv1,v1,8191\n f4:\tsra\tv0,v1,0xd\n f8:\tmult\tv0,a1\n fc:\tmflo\tv0\n\t...\n 108:\tbltzl\tv0,110 \n 10c:\taddiu\tv0,v0,8191\n 110:\tnop\n 114:\tmult\ts0,a0\n 118:\tmflo\tv1\n\t...\n 124:\tbgez\tv1,130 \n 128:\tsra\tt2,v0,0xd\n 12c:\taddiu\tv1,v1,8191\n 130:\tsra\tv0,v1,0xd\n 134:\tmult\tv0,a1\n 138:\tmflo\tv0\n\t...\n 144:\tbltzl\tv0,14c \n 148:\taddiu\tv0,v0,8191\n 14c:\tnop\n 150:\tmult\ta0,a2\n 154:\tmflo\tv1\n\t...\n 160:\tbgez\tv1,16c \n 164:\tsra\tt0,v0,0xd\n 168:\taddiu\tv1,v1,8191\n 16c:\tsra\tv0,v1,0xd\n 170:\tmult\tv0,a1\n 174:\tmflo\tv0\n\t...\n 180:\tbltzl\tv0,188 \n 184:\taddiu\tv0,v0,8191\n 188:\tnop\n 18c:\tmult\ta2,a2\n 190:\tmflo\tv1\n\t...\n 19c:\tbgez\tv1,1a8 \n 1a0:\tsra\tt1,v0,0xd\n 1a4:\taddiu\tv1,v1,8191\n 1a8:\tnop\n 1ac:\tmult\ta2,s2\n 1b0:\tmflo\ta0\n\t...\n 1bc:\tbgez\ta0,1c8 \n 1c0:\tsra\ta1,v1,0xd\n 1c4:\taddiu\ta0,a0,8191\n 1c8:\tli\ta2,8192\n 1cc:\tsubu\tv0,a2,a1\n 1d0:\tmult\ta3,v0\n 1d4:\tmflo\tv0\n\t...\n 1e0:\tbgez\tv0,1ec \n 1e4:\tsra\tv1,a0,0xd\n 1e8:\taddiu\tv0,v0,8191\n 1ec:\tsra\tv0,v0,0xd\n 1f0:\taddu\tv0,a1,v0\n 1f4:\tsh\tv0,0(s3)\n 1f8:\tsubu\tv0,t0,v1\n 1fc:\tsh\tv0,14(s3)\n 200:\taddu\tv0,t0,v1\n 204:\tsh\tv0,10(s3)\n 208:\tlw\tv1,20(sp)\n 20c:\tmult\tv1,v1\n 210:\tmflo\tv0\n\t...\n 21c:\tbltzl\tv0,224 \n 220:\taddiu\tv0,v0,8191\n 224:\tnop\n 228:\tmult\tv1,s2\n 22c:\tmflo\tv1\n\t...\n 238:\tbgez\tv1,244 \n 23c:\tsra\ta1,v0,0xd\n 240:\taddiu\tv1,v1,8191\n 244:\tsubu\tv0,a2,a1\n 248:\tmult\ta3,v0\n 24c:\tmflo\tv0\n\t...\n 258:\tbgez\tv0,264 \n 25c:\tsra\tv1,v1,0xd\n 260:\taddiu\tv0,v0,8191\n 264:\tsra\tv0,v0,0xd\n 268:\taddu\tv0,a1,v0\n 26c:\tsh\tv0,8(s3)\n 270:\taddu\tv0,t1,v1\n 274:\tsh\tv0,12(s3)\n 278:\tsubu\tv0,t1,v1\n 27c:\tsh\tv0,4(s3)\n 280:\tlw\tv1,24(sp)\n 284:\tmult\tv1,v1\n 288:\tmflo\tv0\n\t...\n 294:\tbltzl\tv0,29c \n 298:\taddiu\tv0,v0,8191\n 29c:\tnop\n 2a0:\tmult\tv1,s2\n 2a4:\tmflo\tv1\n\t...\n 2b0:\tbgez\tv1,2bc \n 2b4:\tsra\ta1,v0,0xd\n 2b8:\taddiu\tv1,v1,8191\n 2bc:\tsubu\tv0,a2,a1\n 2c0:\tmult\ta3,v0\n 2c4:\tmflo\tv0\n\t...\n 2d0:\tbgez\tv0,2dc \n 2d4:\tsra\tv1,v1,0xd\n 2d8:\taddiu\tv0,v0,8191\n 2dc:\tsra\tv0,v0,0xd\n 2e0:\taddu\tv0,a1,v0\n 2e4:\tsh\tv0,16(s3)\n 2e8:\tsubu\tv0,t2,v1\n 2ec:\tsh\tv0,6(s3)\n 2f0:\taddu\tv0,t2,v1\n 2f4:\tsh\tv0,2(s3)\n 2f8:\tlw\tra,56(sp)\n 2fc:\tlw\ts5,52(sp)\n 300:\tlw\ts4,48(sp)\n 304:\tlw\ts3,44(sp)\n 308:\tlw\ts2,40(sp)\n 30c:\tlw\ts1,36(sp)\n 310:\tlw\ts0,32(sp)\n 314:\tjr\tra\n 318:\taddiu\tsp,sp,64\n 31c:\tnop\n","proto":{"func_8005DF10_5EB10":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-16844b3ba3fca8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000031c func_8005DF10_5EB10\n00000000 *UND*\t00000000 approximateSin\n00000000 *UND*\t00000000 approximateCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000038 R_MIPS_26 approximateSin\n00000050 R_MIPS_26 approximateSin\n0000005c R_MIPS_26 approximateCos\n00000068 R_MIPS_26 approximateCos\n0000007c R_MIPS_26 approximateSin\n00000088 R_MIPS_26 approximateCos\n\n\nContents of section .text:\n 0000 27bdffc0 afb00020 00a08021 afb20028 '...... ...!...(\n 0010 00c09021 afb3002c 00e09821 afb10024 ...!...,...!...$\n 0020 00048823 00118c00 00118c03 02202021 ...#......... !\n 0030 afbf0038 afb50034 0c000000 afb40030 ...8...4.......0\n 0040 00108023 00108400 00108403 02002021 ...#.......... !\n 0050 0c000000 0040a821 02202021 0c000000 .....@.!. !....\n 0060 00408821 02002021 0c000000 00408021 .@.!.. !.....@.!\n 0070 00129400 00129403 02402021 0c000000 .........@ !....\n 0080 0040a021 02402021 0c000000 00409021 .@.!.@ !.....@.!\n 0090 00000000 02b10018 00001812 00000000 ................\n 00a0 00000000 04610002 00403821 24631fff .....a...@8!$c..\n 00b0 00000000 02b40018 00001012 00033343 ..............3C\n 00c0 afa60010 04410002 afb00014 24421fff .....A......$B..\n 00d0 00000000 00d00018 00001812 00022343 ..............#C\n 00e0 afa40018 24022000 04610002 00472823 ....$. ..a...G(#\n 00f0 24631fff 00031343 00450018 00001012 $c.....C.E......\n 0100 00000000 00000000 04420001 24421fff .........B..$B..\n 0110 00000000 02040018 00001812 00000000 ................\n 0120 00000000 04610002 00025343 24631fff .....a....SC$c..\n 0130 00031343 00450018 00001012 00000000 ...C.E..........\n 0140 00000000 04420001 24421fff 00000000 .....B..$B......\n 0150 00860018 00001812 00000000 00000000 ................\n 0160 04610002 00024343 24631fff 00031343 .a....CC$c.....C\n 0170 00450018 00001012 00000000 00000000 .E..............\n 0180 04420001 24421fff 00000000 00c60018 .B..$B..........\n 0190 00001812 00000000 00000000 04610002 .............a..\n 01a0 00024b43 24631fff 00000000 00d20018 ..KC$c..........\n 01b0 00002012 00000000 00000000 04810002 .. .............\n 01c0 00032b43 24841fff 24062000 00c51023 ..+C$...$. ....#\n 01d0 00e20018 00001012 00000000 00000000 ................\n 01e0 04410002 00041b43 24421fff 00021343 .A.....C$B.....C\n 01f0 00a21021 a6620000 01031023 a662000e ...!.b.....#.b..\n 0200 01031021 a662000a 8fa30014 00630018 ...!.b.......c..\n 0210 00001012 00000000 00000000 04420001 .............B..\n 0220 24421fff 00000000 00720018 00001812 $B.......r......\n 0230 00000000 00000000 04610002 00022b43 .........a....+C\n 0240 24631fff 00c51023 00e20018 00001012 $c.....#........\n 0250 00000000 00000000 04410002 00031b43 .........A.....C\n 0260 24421fff 00021343 00a21021 a6620008 $B.....C...!.b..\n 0270 01231021 a662000c 01231023 a6620004 .#.!.b...#.#.b..\n 0280 8fa30018 00630018 00001012 00000000 .....c..........\n 0290 00000000 04420001 24421fff 00000000 .....B..$B......\n 02a0 00720018 00001812 00000000 00000000 .r..............\n 02b0 04610002 00022b43 24631fff 00c51023 .a....+C$c.....#\n 02c0 00e20018 00001012 00000000 00000000 ................\n 02d0 04410002 00031b43 24421fff 00021343 .A.....C$B.....C\n 02e0 00a21021 a6620010 01431023 a6620006 ...!.b...C.#.b..\n 02f0 01431021 a6620002 8fbf0038 8fb50034 .C.!.b.....8...4\n 0300 8fb40030 8fb3002c 8fb20028 8fb10024 ...0...,...(...$\n 0310 8fb00020 03e00008 27bd0040 00000000 ... ....'..@....\nContents of section .reginfo:\n 0000 a03f07fc 00000000 00000000 00000000 .?..............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005DF10_5EB10' — lift: cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — 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\ts0,32(sp) */\n/* 8:\tmove\ts0,a1 */\n/* c:\tsw\ts2,40(sp) */\n/* 10:\tmove\ts2,a2 */\n/* 14:\tsw\ts3,44(sp) */\n/* 18:\tmove\ts3,a3 */\n/* 1c:\tsw\ts1,36(sp) */\n/* 20:\tnegu\ts1,a0 */\n/* 24:\tsll\ts1,s1,0x10 */\n/* 28:\tsra\ts1,s1,0x10 */\n/* 2c:\tmove\ta0,s1 */\n/* 30:\tsw\tra,56(sp) */\n/* 34:\tsw\ts5,52(sp) */\n/* 38:\tjal\t0 */\n/* 3c:\tsw\ts4,48(sp) */\n/* 40:\tnegu\ts0,s0 */\n/* 44:\tsll\ts0,s0,0x10 */\n/* 48:\tsra\ts0,s0,0x10 */\n/* 4c:\tmove\ta0,s0 */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ts5,v0 */\n/* 58:\tmove\ta0,s1 */\n/* 5c:\tjal\t0 */\n/* 60:\tmove\ts1,v0 */\n/* 64:\tmove\ta0,s0 */\n/* 68:\tjal\t0 */\n/* 6c:\tmove\ts0,v0 */\n/* 70:\tsll\ts2,s2,0x10 */\n/* 74:\tsra\ts2,s2,0x10 */\n/* 78:\tmove\ta0,s2 */\n/* 7c:\tjal\t0 */\n/* 80:\tmove\ts4,v0 */\n/* 84:\tmove\ta0,s2 */\n/* 88:\tjal\t0 */\n/* 8c:\tmove\ts2,v0 */\n/* 90:\tnop */\n/* 94:\tmult\ts5,s1 */\n/* 98:\tmflo\tv1 */\n/* \t... */\n/* a4:\tbgez\tv1,b0 */\n/* a8:\tmove\ta3,v0 */\n/* ac:\taddiu\tv1,v1,8191 */\n/* b0:\tnop */\n/* b4:\tmult\ts5,s4 */\n/* b8:\tmflo\tv0 */\n/* bc:\tsra\ta2,v1,0xd */\n/* c0:\tsw\ta2,16(sp) */\n/* c4:\tbgez\tv0,d0 */\n/* c8:\tsw\ts0,20(sp) */\n/* cc:\taddiu\tv0,v0,8191 */\n/* d0:\tnop */\n/* d4:\tmult\ta2,s0 */\n/* d8:\tmflo\tv1 */\n/* dc:\tsra\ta0,v0,0xd */\n/* e0:\tsw\ta0,24(sp) */\n/* e4:\tli\tv0,8192 */\n/* e8:\tbgez\tv1,f4 */\n/* ec:\tsubu\ta1,v0,a3 */\n/* f0:\taddiu\tv1,v1,8191 */\n/* f4:\tsra\tv0,v1,0xd */\n/* f8:\tmult\tv0,a1 */\n/* fc:\tmflo\tv0 */\n/* \t... */\n/* 108:\tbltzl\tv0,110 */\n/* 10c:\taddiu\tv0,v0,8191 */\n/* 110:\tnop */\n/* 114:\tmult\ts0,a0 */\n/* 118:\tmflo\tv1 */\n/* \t... */\n/* 124:\tbgez\tv1,130 */\n/* 128:\tsra\tt2,v0,0xd */\n/* 12c:\taddiu\tv1,v1,8191 */\n/* 130:\tsra\tv0,v1,0xd */\n/* 134:\tmult\tv0,a1 */\n/* 138:\tmflo\tv0 */\n/* \t... */\n/* 144:\tbltzl\tv0,14c */\n/* 148:\taddiu\tv0,v0,8191 */\n/* 14c:\tnop */\n/* 150:\tmult\ta0,a2 */\n/* 154:\tmflo\tv1 */\n/* \t... */\n/* 160:\tbgez\tv1,16c */\n/* 164:\tsra\tt0,v0,0xd */\n/* 168:\taddiu\tv1,v1,8191 */\n/* 16c:\tsra\tv0,v1,0xd */\n/* 170:\tmult\tv0,a1 */\n/* 174:\tmflo\tv0 */\n/* \t... */\n/* 180:\tbltzl\tv0,188 */\n/* 184:\taddiu\tv0,v0,8191 */\n/* 188:\tnop */\n/* 18c:\tmult\ta2,a2 */\n/* 190:\tmflo\tv1 */\n/* \t... */\n/* 19c:\tbgez\tv1,1a8 */\n/* 1a0:\tsra\tt1,v0,0xd */\n/* 1a4:\taddiu\tv1,v1,8191 */\n/* 1a8:\tnop */\n/* 1ac:\tmult\ta2,s2 */\n/* 1b0:\tmflo\ta0 */\n/* \t... */\n/* 1bc:\tbgez\ta0,1c8 */\n/* 1c0:\tsra\ta1,v1,0xd */\n/* 1c4:\taddiu\ta0,a0,8191 */\n/* 1c8:\tli\ta2,8192 */\n/* 1cc:\tsubu\tv0,a2,a1 */\n/* 1d0:\tmult\ta3,v0 */\n/* 1d4:\tmflo\tv0 */\n/* \t... */\n/* 1e0:\tbgez\tv0,1ec */\n/* 1e4:\tsra\tv1,a0,0xd */\n/* 1e8:\taddiu\tv0,v0,8191 */\n/* 1ec:\tsra\tv0,v0,0xd */\n/* 1f0:\taddu\tv0,a1,v0 */\n/* 1f4:\tsh\tv0,0(s3) */\n/* 1f8:\tsubu\tv0,t0,v1 */\n/* 1fc:\tsh\tv0,14(s3) */\n/* 200:\taddu\tv0,t0,v1 */\n/* 204:\tsh\tv0,10(s3) */\n/* 208:\tlw\tv1,20(sp) */\n/* 20c:\tmult\tv1,v1 */\n/* 210:\tmflo\tv0 */\n/* \t... */\n/* 21c:\tbltzl\tv0,224 */\n/* 220:\taddiu\tv0,v0,8191 */\n/* 224:\tnop */\n/* 228:\tmult\tv1,s2 */\n/* 22c:\tmflo\tv1 */\n/* \t... */\n/* 238:\tbgez\tv1,244 */\n/* 23c:\tsra\ta1,v0,0xd */\n/* 240:\taddiu\tv1,v1,8191 */\n/* 244:\tsubu\tv0,a2,a1 */\n/* 248:\tmult\ta3,v0 */\n/* 24c:\tmflo\tv0 */\n/* \t... */\n/* 258:\tbgez\tv0,264 */\n/* 25c:\tsra\tv1,v1,0xd */\n/* 260:\taddiu\tv0,v0,8191 */\n/* 264:\tsra\tv0,v0,0xd */\n/* 268:\taddu\tv0,a1,v0 */\n/* 26c:\tsh\tv0,8(s3) */\n/* 270:\taddu\tv0,t1,v1 */\n/* 274:\tsh\tv0,12(s3) */\n/* 278:\tsubu\tv0,t1,v1 */\n/* 27c:\tsh\tv0,4(s3) */\n/* 280:\tlw\tv1,24(sp) */\n/* 284:\tmult\tv1,v1 */\n/* 288:\tmflo\tv0 */\n/* \t... */\n/* 294:\tbltzl\tv0,29c */\n/* 298:\taddiu\tv0,v0,8191 */\n/* 29c:\tnop */\n/* 2a0:\tmult\tv1,s2 */\n/* 2a4:\tmflo\tv1 */\n/* \t... */\n/* 2b0:\tbgez\tv1,2bc */\n/* 2b4:\tsra\ta1,v0,0xd */\n/* 2b8:\taddiu\tv1,v1,8191 */\n/* 2bc:\tsubu\tv0,a2,a1 */\n/* 2c0:\tmult\ta3,v0 */\n/* 2c4:\tmflo\tv0 */\n/* \t... */\n/* 2d0:\tbgez\tv0,2dc */\n/* 2d4:\tsra\tv1,v1,0xd */\n/* 2d8:\taddiu\tv0,v0,8191 */\n/* 2dc:\tsra\tv0,v0,0xd */\n/* 2e0:\taddu\tv0,a1,v0 */\n/* 2e4:\tsh\tv0,16(s3) */\n/* 2e8:\tsubu\tv0,t2,v1 */\n/* 2ec:\tsh\tv0,6(s3) */\n/* 2f0:\taddu\tv0,t2,v1 */\n/* 2f4:\tsh\tv0,2(s3) */\n/* 2f8:\tlw\tra,56(sp) */\n/* 2fc:\tlw\ts5,52(sp) */\n/* 300:\tlw\ts4,48(sp) */\n/* 304:\tlw\ts3,44(sp) */\n/* 308:\tlw\ts2,40(sp) */\n/* 30c:\tlw\ts1,36(sp) */\n/* 310:\tlw\ts0,32(sp) */\n/* 314:\tjr\tra */\n/* 318:\taddiu\tsp,sp,64 */\n/* 31c:\tnop */\nvoid func_8005DF10_5EB10(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":193,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 approximateCos(s16); /* extern */\ns32 approximateSin(s16); /* extern */\n\nvoid func_8005DF10_5EB10(s32 arg0, s32 arg1, s16 arg2, void *arg3) {\n s32 sp14;\n s32 sp18;\n s16 temp_s0;\n s16 temp_s1;\n s32 temp_a0;\n s32 temp_a1;\n s32 temp_a1_2;\n s32 temp_a1_3;\n s32 temp_a1_4;\n s32 temp_a2;\n s32 temp_a3;\n s32 temp_s0_2;\n s32 temp_s1_2;\n s32 temp_s2;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_t0;\n s32 temp_t1;\n s32 temp_t2;\n s32 temp_v1;\n s32 temp_v1_2;\n s32 temp_v1_3;\n s32 var_a0;\n s32 var_v0;\n s32 var_v0_2;\n s32 var_v0_3;\n s32 var_v0_4;\n s32 var_v0_5;\n s32 var_v0_6;\n s32 var_v0_7;\n s32 var_v0_8;\n s32 var_v0_9;\n s32 var_v1;\n s32 var_v1_2;\n s32 var_v1_3;\n s32 var_v1_4;\n s32 var_v1_5;\n s32 var_v1_6;\n s32 var_v1_7;\n\n temp_s1 = arg0 * -1;\n temp_s0 = arg1 * -1;\n temp_s5 = approximateSin(temp_s1);\n temp_s1_2 = approximateSin(temp_s0);\n temp_s0_2 = approximateCos(temp_s1);\n temp_s4 = approximateCos(temp_s0);\n temp_s2 = approximateSin(arg2);\n var_v1 = temp_s5 * temp_s1_2;\n temp_a3 = approximateCos(arg2);\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_s5 * temp_s4;\n temp_a2 = var_v1 >> 0xD;\n sp14 = temp_s0_2;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1_2 = temp_a2 * temp_s0_2;\n temp_a0 = var_v0 >> 0xD;\n sp18 = temp_a0;\n temp_a1 = 0x2000 - temp_a3;\n if (var_v1_2 < 0) {\n var_v1_2 += 0x1FFF;\n }\n var_v0_2 = (var_v1_2 >> 0xD) * temp_a1;\n if (var_v0_2 < 0) {\n var_v0_2 += 0x1FFF;\n }\n var_v1_3 = temp_s0_2 * temp_a0;\n temp_t2 = var_v0_2 >> 0xD;\n if (var_v1_3 < 0) {\n var_v1_3 += 0x1FFF;\n }\n var_v0_3 = (var_v1_3 >> 0xD) * temp_a1;\n if (var_v0_3 < 0) {\n var_v0_3 += 0x1FFF;\n }\n var_v1_4 = temp_a0 * temp_a2;\n temp_t0 = var_v0_3 >> 0xD;\n if (var_v1_4 < 0) {\n var_v1_4 += 0x1FFF;\n }\n var_v0_4 = (var_v1_4 >> 0xD) * temp_a1;\n if (var_v0_4 < 0) {\n var_v0_4 += 0x1FFF;\n }\n var_v1_5 = temp_a2 * temp_a2;\n temp_t1 = var_v0_4 >> 0xD;\n if (var_v1_5 < 0) {\n var_v1_5 += 0x1FFF;\n }\n var_a0 = temp_a2 * temp_s2;\n temp_a1_2 = var_v1_5 >> 0xD;\n if (var_a0 < 0) {\n var_a0 += 0x1FFF;\n }\n var_v0_5 = temp_a3 * (0x2000 - temp_a1_2);\n temp_v1 = var_a0 >> 0xD;\n if (var_v0_5 < 0) {\n var_v0_5 += 0x1FFF;\n }\n arg3->unk0 = (s16) (temp_a1_2 + (var_v0_5 >> 0xD));\n arg3->unkE = (s16) (temp_t0 - temp_v1);\n arg3->unkA = (s16) (temp_t0 + temp_v1);\n var_v0_6 = sp14 * sp14;\n if (var_v0_6 < 0) {\n var_v0_6 += 0x1FFF;\n }\n var_v1_6 = sp14 * temp_s2;\n temp_a1_3 = var_v0_6 >> 0xD;\n if (var_v1_6 < 0) {\n var_v1_6 += 0x1FFF;\n }\n var_v0_7 = temp_a3 * (0x2000 - temp_a1_3);\n temp_v1_2 = var_v1_6 >> 0xD;\n if (var_v0_7 < 0) {\n var_v0_7 += 0x1FFF;\n }\n arg3->unk8 = (s16) (temp_a1_3 + (var_v0_7 >> 0xD));\n arg3->unkC = (s16) (temp_t1 + temp_v1_2);\n arg3->unk4 = (s16) (temp_t1 - temp_v1_2);\n var_v0_8 = sp18 * sp18;\n if (var_v0_8 < 0) {\n var_v0_8 += 0x1FFF;\n }\n var_v1_7 = sp18 * temp_s2;\n temp_a1_4 = var_v0_8 >> 0xD;\n if (var_v1_7 < 0) {\n var_v1_7 += 0x1FFF;\n }\n var_v0_9 = temp_a3 * (0x2000 - temp_a1_4);\n temp_v1_3 = var_v1_7 >> 0xD;\n if (var_v0_9 < 0) {\n var_v0_9 += 0x1FFF;\n }\n arg3->unk10 = (s16) (temp_a1_4 + (var_v0_9 >> 0xD));\n arg3->unk6 = (s16) (temp_t2 - temp_v1_3);\n arg3->unk2 = (s16) (temp_t2 + temp_v1_3);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":142,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1993: request for member `unk0' in something not a structure or union","/c.i:1994: request for member `unkE' in something not a structure or union","/c.i:1995: request for member `unkA' in something not a structure or union","/c.i:2010: request for member `unk8' in something not a structure or union","/c.i:2011: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005DF10_5EB10` — benchmark function snowboardkids2:func_8005DF10_5EB10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005DF10_5EB10\n addiu\t$sp, $sp, -64\n sw\t$s0, 32($sp)\n move\t$s0, $a1\n sw\t$s2, 40($sp)\n move\t$s2, $a2\n sw\t$s3, 44($sp)\n move\t$s3, $a3\n sw\t$s1, 36($sp)\n negu\t$s1, $a0\n sll\t$s1, $s1, 0x10\n sra\t$s1, $s1, 0x10\n move\t$a0, $s1\n sw\t$ra, 56($sp)\n sw\t$s5, 52($sp)\n jal\tapproximateSin\n sw\t$s4, 48($sp)\n negu\t$s0, $s0\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n move\t$a0, $s0\n jal\tapproximateSin\n move\t$s5, $v0\n move\t$a0, $s1\n jal\tapproximateCos\n move\t$s1, $v0\n move\t$a0, $s0\n jal\tapproximateCos\n move\t$s0, $v0\n sll\t$s2, $s2, 0x10\n sra\t$s2, $s2, 0x10\n move\t$a0, $s2\n jal\tapproximateSin\n move\t$s4, $v0\n move\t$a0, $s2\n jal\tapproximateCos\n move\t$s2, $v0\n nop\n mult\t$s5, $s1\n mflo\t$v1\n bgez\t$v1, .Lb0\n move\t$a3, $v0\n addiu\t$v1, $v1, 8191\n.Lb0:\n nop\n mult\t$s5, $s4\n mflo\t$v0\n sra\t$a2, $v1, 0xd\n sw\t$a2, 16($sp)\n bgez\t$v0, .Ld0\n sw\t$s0, 20($sp)\n addiu\t$v0, $v0, 8191\n.Ld0:\n nop\n mult\t$a2, $s0\n mflo\t$v1\n sra\t$a0, $v0, 0xd\n sw\t$a0, 24($sp)\n li\t$v0, 8192\n bgez\t$v1, .Lf4\n subu\t$a1, $v0, $a3\n addiu\t$v1, $v1, 8191\n.Lf4:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L110\n addiu\t$v0, $v0, 8191\n.L110:\n nop\n mult\t$s0, $a0\n mflo\t$v1\n bgez\t$v1, .L130\n sra\t$t2, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L130:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L14c\n addiu\t$v0, $v0, 8191\n.L14c:\n nop\n mult\t$a0, $a2\n mflo\t$v1\n bgez\t$v1, .L16c\n sra\t$t0, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L16c:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L188\n addiu\t$v0, $v0, 8191\n.L188:\n nop\n mult\t$a2, $a2\n mflo\t$v1\n bgez\t$v1, .L1a8\n sra\t$t1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L1a8:\n nop\n mult\t$a2, $s2\n mflo\t$a0\n bgez\t$a0, .L1c8\n sra\t$a1, $v1, 0xd\n addiu\t$a0, $a0, 8191\n.L1c8:\n li\t$a2, 8192\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L1ec\n sra\t$v1, $a0, 0xd\n addiu\t$v0, $v0, 8191\n.L1ec:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 0($s3)\n subu\t$v0, $t0, $v1\n sh\t$v0, 14($s3)\n addu\t$v0, $t0, $v1\n sh\t$v0, 10($s3)\n lw\t$v1, 20($sp)\n mult\t$v1, $v1\n mflo\t$v0\n bltzl\t$v0, .L224\n addiu\t$v0, $v0, 8191\n.L224:\n nop\n mult\t$v1, $s2\n mflo\t$v1\n bgez\t$v1, .L244\n sra\t$a1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L244:\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L264\n sra\t$v1, $v1, 0xd\n addiu\t$v0, $v0, 8191\n.L264:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 8($s3)\n addu\t$v0, $t1, $v1\n sh\t$v0, 12($s3)\n subu\t$v0, $t1, $v1\n sh\t$v0, 4($s3)\n lw\t$v1, 24($sp)\n mult\t$v1, $v1\n mflo\t$v0\n bltzl\t$v0, .L29c\n addiu\t$v0, $v0, 8191\n.L29c:\n nop\n mult\t$v1, $s2\n mflo\t$v1\n bgez\t$v1, .L2bc\n sra\t$a1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L2bc:\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L2dc\n sra\t$v1, $v1, 0xd\n addiu\t$v0, $v0, 8191\n.L2dc:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 16($s3)\n subu\t$v0, $t2, $v1\n sh\t$v0, 6($s3)\n addu\t$v0, $t2, $v1\n sh\t$v0, 2($s3)\n lw\t$ra, 56($sp)\n lw\t$s5, 52($sp)\n lw\t$s4, 48($sp)\n lw\t$s3, 44($sp)\n lw\t$s2, 40($sp)\n lw\t$s1, 36($sp)\n lw\t$s0, 32($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_8005DF10_5EB10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005DF10_5EB10` — benchmark function snowboardkids2:func_8005DF10_5EB10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005DF10_5EB10: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\ts0,32(sp)\n 8:\tmove\ts0,a1\n c:\tsw\ts2,40(sp)\n 10:\tmove\ts2,a2\n 14:\tsw\ts3,44(sp)\n 18:\tmove\ts3,a3\n 1c:\tsw\ts1,36(sp)\n 20:\tnegu\ts1,a0\n 24:\tsll\ts1,s1,0x10\n 28:\tsra\ts1,s1,0x10\n 2c:\tmove\ta0,s1\n 30:\tsw\tra,56(sp)\n 34:\tsw\ts5,52(sp)\n 38:\tjal\t0 \n 3c:\tsw\ts4,48(sp)\n 40:\tnegu\ts0,s0\n 44:\tsll\ts0,s0,0x10\n 48:\tsra\ts0,s0,0x10\n 4c:\tmove\ta0,s0\n 50:\tjal\t0 \n 54:\tmove\ts5,v0\n 58:\tmove\ta0,s1\n 5c:\tjal\t0 \n 60:\tmove\ts1,v0\n 64:\tmove\ta0,s0\n 68:\tjal\t0 \n 6c:\tmove\ts0,v0\n 70:\tsll\ts2,s2,0x10\n 74:\tsra\ts2,s2,0x10\n 78:\tmove\ta0,s2\n 7c:\tjal\t0 \n 80:\tmove\ts4,v0\n 84:\tmove\ta0,s2\n 88:\tjal\t0 \n 8c:\tmove\ts2,v0\n 90:\tnop\n 94:\tmult\ts5,s1\n 98:\tmflo\tv1\n\t...\n a4:\tbgez\tv1,b0 \n a8:\tmove\ta3,v0\n ac:\taddiu\tv1,v1,8191\n b0:\tnop\n b4:\tmult\ts5,s4\n b8:\tmflo\tv0\n bc:\tsra\ta2,v1,0xd\n c0:\tsw\ta2,16(sp)\n c4:\tbgez\tv0,d0 \n c8:\tsw\ts0,20(sp)\n cc:\taddiu\tv0,v0,8191\n d0:\tnop\n d4:\tmult\ta2,s0\n d8:\tmflo\tv1\n dc:\tsra\ta0,v0,0xd\n e0:\tsw\ta0,24(sp)\n e4:\tli\tv0,8192\n e8:\tbgez\tv1,f4 \n ec:\tsubu\ta1,v0,a3\n f0:\taddiu\tv1,v1,8191\n f4:\tsra\tv0,v1,0xd\n f8:\tmult\tv0,a1\n fc:\tmflo\tv0\n\t...\n 108:\tbltzl\tv0,110 \n 10c:\taddiu\tv0,v0,8191\n 110:\tnop\n 114:\tmult\ts0,a0\n 118:\tmflo\tv1\n\t...\n 124:\tbgez\tv1,130 \n 128:\tsra\tt2,v0,0xd\n 12c:\taddiu\tv1,v1,8191\n 130:\tsra\tv0,v1,0xd\n 134:\tmult\tv0,a1\n 138:\tmflo\tv0\n\t...\n 144:\tbltzl\tv0,14c \n 148:\taddiu\tv0,v0,8191\n 14c:\tnop\n 150:\tmult\ta0,a2\n 154:\tmflo\tv1\n\t...\n 160:\tbgez\tv1,16c \n 164:\tsra\tt0,v0,0xd\n 168:\taddiu\tv1,v1,8191\n 16c:\tsra\tv0,v1,0xd\n 170:\tmult\tv0,a1\n 174:\tmflo\tv0\n\t...\n 180:\tbltzl\tv0,188 \n 184:\taddiu\tv0,v0,8191\n 188:\tnop\n 18c:\tmult\ta2,a2\n 190:\tmflo\tv1\n\t...\n 19c:\tbgez\tv1,1a8 \n 1a0:\tsra\tt1,v0,0xd\n 1a4:\taddiu\tv1,v1,8191\n 1a8:\tnop\n 1ac:\tmult\ta2,s2\n 1b0:\tmflo\ta0\n\t...\n 1bc:\tbgez\ta0,1c8 \n 1c0:\tsra\ta1,v1,0xd\n 1c4:\taddiu\ta0,a0,8191\n 1c8:\tli\ta2,8192\n 1cc:\tsubu\tv0,a2,a1\n 1d0:\tmult\ta3,v0\n 1d4:\tmflo\tv0\n\t...\n 1e0:\tbgez\tv0,1ec \n 1e4:\tsra\tv1,a0,0xd\n 1e8:\taddiu\tv0,v0,8191\n 1ec:\tsra\tv0,v0,0xd\n 1f0:\taddu\tv0,a1,v0\n 1f4:\tsh\tv0,0(s3)\n 1f8:\tsubu\tv0,t0,v1\n 1fc:\tsh\tv0,14(s3)\n 200:\taddu\tv0,t0,v1\n 204:\tsh\tv0,10(s3)\n 208:\tlw\tv1,20(sp)\n 20c:\tmult\tv1,v1\n 210:\tmflo\tv0\n\t...\n 21c:\tbltzl\tv0,224 \n 220:\taddiu\tv0,v0,8191\n 224:\tnop\n 228:\tmult\tv1,s2\n 22c:\tmflo\tv1\n\t...\n 238:\tbgez\tv1,244 \n 23c:\tsra\ta1,v0,0xd\n 240:\taddiu\tv1,v1,8191\n 244:\tsubu\tv0,a2,a1\n 248:\tmult\ta3,v0\n 24c:\tmflo\tv0\n\t...\n 258:\tbgez\tv0,264 \n 25c:\tsra\tv1,v1,0xd\n 260:\taddiu\tv0,v0,8191\n 264:\tsra\tv0,v0,0xd\n 268:\taddu\tv0,a1,v0\n 26c:\tsh\tv0,8(s3)\n 270:\taddu\tv0,t1,v1\n 274:\tsh\tv0,12(s3)\n 278:\tsubu\tv0,t1,v1\n 27c:\tsh\tv0,4(s3)\n 280:\tlw\tv1,24(sp)\n 284:\tmult\tv1,v1\n 288:\tmflo\tv0\n\t...\n 294:\tbltzl\tv0,29c \n 298:\taddiu\tv0,v0,8191\n 29c:\tnop\n 2a0:\tmult\tv1,s2\n 2a4:\tmflo\tv1\n\t...\n 2b0:\tbgez\tv1,2bc \n 2b4:\tsra\ta1,v0,0xd\n 2b8:\taddiu\tv1,v1,8191\n 2bc:\tsubu\tv0,a2,a1\n 2c0:\tmult\ta3,v0\n 2c4:\tmflo\tv0\n\t...\n 2d0:\tbgez\tv0,2dc \n 2d4:\tsra\tv1,v1,0xd\n 2d8:\taddiu\tv0,v0,8191\n 2dc:\tsra\tv0,v0,0xd\n 2e0:\taddu\tv0,a1,v0\n 2e4:\tsh\tv0,16(s3)\n 2e8:\tsubu\tv0,t2,v1\n 2ec:\tsh\tv0,6(s3)\n 2f0:\taddu\tv0,t2,v1\n 2f4:\tsh\tv0,2(s3)\n 2f8:\tlw\tra,56(sp)\n 2fc:\tlw\ts5,52(sp)\n 300:\tlw\ts4,48(sp)\n 304:\tlw\ts3,44(sp)\n 308:\tlw\ts2,40(sp)\n 30c:\tlw\ts1,36(sp)\n 310:\tlw\ts0,32(sp)\n 314:\tjr\tra\n 318:\taddiu\tsp,sp,64\n 31c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-16844b3ba3fca8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000031c func_8005DF10_5EB10\n00000000 *UND*\t00000000 approximateSin\n00000000 *UND*\t00000000 approximateCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000038 R_MIPS_26 approximateSin\n00000050 R_MIPS_26 approximateSin\n0000005c R_MIPS_26 approximateCos\n00000068 R_MIPS_26 approximateCos\n0000007c R_MIPS_26 approximateSin\n00000088 R_MIPS_26 approximateCos\n\n\nContents of section .text:\n 0000 27bdffc0 afb00020 00a08021 afb20028 '...... ...!...(\n 0010 00c09021 afb3002c 00e09821 afb10024 ...!...,...!...$\n 0020 00048823 00118c00 00118c03 02202021 ...#......... !\n 0030 afbf0038 afb50034 0c000000 afb40030 ...8...4.......0\n 0040 00108023 00108400 00108403 02002021 ...#.......... !\n 0050 0c000000 0040a821 02202021 0c000000 .....@.!. !....\n 0060 00408821 02002021 0c000000 00408021 .@.!.. !.....@.!\n 0070 00129400 00129403 02402021 0c000000 .........@ !....\n 0080 0040a021 02402021 0c000000 00409021 .@.!.@ !.....@.!\n 0090 00000000 02b10018 00001812 00000000 ................\n 00a0 00000000 04610002 00403821 24631fff .....a...@8!$c..\n 00b0 00000000 02b40018 00001012 00033343 ..............3C\n 00c0 afa60010 04410002 afb00014 24421fff .....A......$B..\n 00d0 00000000 00d00018 00001812 00022343 ..............#C\n 00e0 afa40018 24022000 04610002 00472823 ....$. ..a...G(#\n 00f0 24631fff 00031343 00450018 00001012 $c.....C.E......\n 0100 00000000 00000000 04420001 24421fff .........B..$B..\n 0110 00000000 02040018 00001812 00000000 ................\n 0120 00000000 04610002 00025343 24631fff .....a....SC$c..\n 0130 00031343 00450018 00001012 00000000 ...C.E..........\n 0140 00000000 04420001 24421fff 00000000 .....B..$B......\n 0150 00860018 00001812 00000000 00000000 ................\n 0160 04610002 00024343 24631fff 00031343 .a....CC$c.....C\n 0170 00450018 00001012 00000000 00000000 .E..............\n 0180 04420001 24421fff 00000000 00c60018 .B..$B..........\n 0190 00001812 00000000 00000000 04610002 .............a..\n 01a0 00024b43 24631fff 00000000 00d20018 ..KC$c..........\n 01b0 00002012 00000000 00000000 04810002 .. .............\n 01c0 00032b43 24841fff 24062000 00c51023 ..+C$...$. ....#\n 01d0 00e20018 00001012 00000000 00000000 ................\n 01e0 04410002 00041b43 24421fff 00021343 .A.....C$B.....C\n 01f0 00a21021 a6620000 01031023 a662000e ...!.b.....#.b..\n 0200 01031021 a662000a 8fa30014 00630018 ...!.b.......c..\n 0210 00001012 00000000 00000000 04420001 .............B..\n 0220 24421fff 00000000 00720018 00001812 $B.......r......\n 0230 00000000 00000000 04610002 00022b43 .........a....+C\n 0240 24631fff 00c51023 00e20018 00001012 $c.....#........\n 0250 00000000 00000000 04410002 00031b43 .........A.....C\n 0260 24421fff 00021343 00a21021 a6620008 $B.....C...!.b..\n 0270 01231021 a662000c 01231023 a6620004 .#.!.b...#.#.b..\n 0280 8fa30018 00630018 00001012 00000000 .....c..........\n 0290 00000000 04420001 24421fff 00000000 .....B..$B......\n 02a0 00720018 00001812 00000000 00000000 .r..............\n 02b0 04610002 00022b43 24631fff 00c51023 .a....+C$c.....#\n 02c0 00e20018 00001012 00000000 00000000 ................\n 02d0 04410002 00031b43 24421fff 00021343 .A.....C$B.....C\n 02e0 00a21021 a6620010 01431023 a6620006 ...!.b...C.#.b..\n 02f0 01431021 a6620002 8fbf0038 8fb50034 .C.!.b.....8...4\n 0300 8fb40030 8fb3002c 8fb20028 8fb10024 ...0...,...(...$\n 0310 8fb00020 03e00008 27bd0040 00000000 ... ....'..@....\nContents of section .reginfo:\n 0000 a03f07fc 00000000 00000000 00000000 .?..............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005DF10_5EB10\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005DF10_5EB10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B0DC0_1DCF60\n lw\t$v0, 4($a0)\n addu\t$v0, $v0, $a0\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B0DC0_1DCF60 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc","sym":"func_800B2C18_A2AC8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","goto","bitwise","call"],"loc":98,"refSource":"s32 func_800B2C18_A2AC8(Player *arg0) {\n GameState *state;\n s32 flags;\n u8 stateUnk7A;\n s16 var_a0;\n s16 var_v1;\n s32 temp_v0;\n\n state = getCurrentAllocation();\n flags = arg0->unkB84;\n\n if (flags & 1) {\n return 0;\n }\n\n if (flags & 0x1000) {\n func_800B46BC_A456C(arg0);\n return 1;\n }\n\n if (flags & 0x80000) {\n goto skip_to_end;\n }\n\n stateUnk7A = state->unk7A;\n if (stateUnk7A != 0 && stateUnk7A != 8) {\n if (!(stateUnk7A == 9 || stateUnk7A == 10)) {\n arg0->unkBAC = 0;\n }\n }\n\n if (arg0->unkBAC != 0) {\n func_80059A48_5A648(arg0, arg0->unkBAC);\n if (arg0->unkBC7 == 0) {\n func_8004D890_4E490(arg0->unkBB8, arg0->unkBAC);\n\n var_v1 = arg0->unkBAC;\n if (var_v1 < 0x96) {\n var_a0 = 0x11C;\n } else {\n var_a0 = 0x11D;\n }\n\n if (var_v1 >= 0x12C) {\n var_a0 = 0x11E;\n }\n if (var_v1 >= 0x190) {\n var_a0 = 0x11F;\n }\n if (var_v1 >= 0x1F4) {\n var_a0 = 0x120;\n }\n if (var_v1 >= 0xBB8) {\n var_a0 = 0x121;\n }\n\n func_80058530_59130(var_a0, 6);\n }\n }\n\n if (state->unk7A == 6) {\n if (arg0->unkBAA != 0) {\n func_8004FCF0_508F0(arg0->unkBAA);\n func_80059A88_5A688(arg0, arg0->unkBAA);\n\n var_v1 = arg0->unkBAA;\n if (var_v1 < 0xF) {\n var_a0 = 0x11C;\n } else {\n var_a0 = 0x11D;\n }\n\n if (var_v1 >= 0x1E) {\n var_a0 = 0x11E;\n }\n if (var_v1 >= 0x37) {\n var_a0 = 0x11F;\n }\n if (var_v1 >= 0x5F) {\n var_a0 = 0x120;\n }\n if (var_v1 >= 0x3E7) {\n var_a0 = 0x121;\n }\n\n func_80058530_59130(var_a0, 6);\n }\n }\n\nskip_to_end:\n if (arg0->unkBAE != 0) {\n func_80059BD4_5A7D4(arg0);\n func_8005D804_5E404(arg0, 1, 0xF);\n }\n\n func_800B00D4_9FF84(arg0, 3);\n return 1;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L799-L896","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:\tlw\tv1,2948(s0)\n 1c:\tmove\ts1,v0\n 20:\tandi\tv0,v1,0x1\n 24:\tbnez\tv0,1b0 \n 28:\tmove\tv0,zero\n 2c:\tandi\tv0,v1,0x1000\n 30:\tbeqz\tv0,48 \n 34:\tlui\tv0,0x8\n 38:\tjal\t0 \n 3c:\tmove\ta0,s0\n 40:\tj\t1b0 \n 44:\tli\tv0,1\n 48:\tand\tv0,v1,v0\n 4c:\tbnez\tv0,17c \n 50:\tnop\n 54:\tlbu\ta0,122(s1)\n 58:\tandi\tv0,a0,0xff\n 5c:\tsltu\tv1,zero,v0\n 60:\txori\tv0,v0,0x8\n 64:\tsltu\tv0,zero,v0\n 68:\tand\tv1,v1,v0\n 6c:\tbeqz\tv1,80 \n 70:\taddiu\tv0,a0,-9\n 74:\tsltiu\tv0,v0,2\n 78:\tbeqzl\tv0,80 \n 7c:\tsh\tzero,2988(s0)\n 80:\tlh\ta1,2988(s0)\n 84:\tbeqz\ta1,fc \n 88:\tnop\n 8c:\tjal\t0 \n 90:\tmove\ta0,s0\n 94:\tlbu\tv0,3015(s0)\n 98:\tbnez\tv0,fc \n 9c:\tnop\n a0:\tlbu\ta0,3000(s0)\n a4:\tjal\t0 \n a8:\tlh\ta1,2988(s0)\n ac:\tlh\tv1,2988(s0)\n b0:\tslti\tv0,v1,150\n b4:\txori\tv0,v0,0x1\n b8:\tnegu\tv0,v0\n bc:\tandi\tv0,v0,0x11d\n c0:\tori\ta0,v0,0x11c\n c4:\tslti\tv0,v1,300\n c8:\tbeqzl\tv0,d0 \n cc:\tli\ta0,286\n d0:\tslti\tv0,v1,400\n d4:\tbeqzl\tv0,dc \n d8:\tli\ta0,287\n dc:\tslti\tv0,v1,500\n e0:\tbeqzl\tv0,e8 \n e4:\tli\ta0,288\n e8:\tslti\tv0,v1,3000\n ec:\tbeqzl\tv0,f4 \n f0:\tli\ta0,289\n f4:\tjal\t0 \n f8:\tli\ta1,6\n fc:\tlbu\tv1,122(s1)\n 100:\tli\tv0,6\n 104:\tbne\tv1,v0,17c \n 108:\tnop\n 10c:\tlh\ta0,2986(s0)\n 110:\tbeqz\ta0,17c \n 114:\tnop\n 118:\tjal\t0 \n 11c:\tnop\n 120:\tlh\ta1,2986(s0)\n 124:\tjal\t0 \n 128:\tmove\ta0,s0\n 12c:\tlh\tv1,2986(s0)\n 130:\tslti\tv0,v1,15\n 134:\txori\tv0,v0,0x1\n 138:\tnegu\tv0,v0\n 13c:\tandi\tv0,v0,0x11d\n 140:\tori\ta0,v0,0x11c\n 144:\tslti\tv0,v1,30\n 148:\tbeqzl\tv0,150 \n 14c:\tli\ta0,286\n 150:\tslti\tv0,v1,55\n 154:\tbeqzl\tv0,15c \n 158:\tli\ta0,287\n 15c:\tslti\tv0,v1,95\n 160:\tbeqzl\tv0,168 \n 164:\tli\ta0,288\n 168:\tslti\tv0,v1,999\n 16c:\tbeqzl\tv0,174 \n 170:\tli\ta0,289\n 174:\tjal\t0 \n 178:\tli\ta1,6\n 17c:\tlh\tv0,2990(s0)\n 180:\tbeqz\tv0,1a4 \n 184:\tmove\ta0,s0\n 188:\tjal\t0 \n 18c:\tmove\ta0,s0\n 190:\tmove\ta0,s0\n 194:\tli\ta1,1\n 198:\tjal\t0 \n 19c:\tli\ta2,15\n 1a0:\tmove\ta0,s0\n 1a4:\tjal\t0 \n 1a8:\tli\ta1,3\n 1ac:\tli\tv0,1\n 1b0:\tlw\tra,24(sp)\n 1b4:\tlw\ts1,20(sp)\n 1b8:\tlw\ts0,16(sp)\n 1bc:\tjr\tra\n 1c0:\taddiu\tsp,sp,32\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-5a3edb649490b9c4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 func_800B2C18_A2AC8\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_800B46BC_A456C\n00000000 *UND*\t00000000 func_80059A48_5A648\n00000000 *UND*\t00000000 func_8004D890_4E490\n00000000 *UND*\t00000000 func_80058530_59130\n00000000 *UND*\t00000000 func_8004FCF0_508F0\n00000000 *UND*\t00000000 func_80059A88_5A688\n00000000 *UND*\t00000000 func_80059BD4_5A7D4\n00000000 *UND*\t00000000 func_8005D804_5E404\n00000000 *UND*\t00000000 func_800B00D4_9FF84\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_800B46BC_A456C\n00000040 R_MIPS_26 .text\n0000008c R_MIPS_26 func_80059A48_5A648\n000000a4 R_MIPS_26 func_8004D890_4E490\n000000f4 R_MIPS_26 func_80058530_59130\n00000118 R_MIPS_26 func_8004FCF0_508F0\n00000124 R_MIPS_26 func_80059A88_5A688\n00000174 R_MIPS_26 func_80058530_59130\n00000188 R_MIPS_26 func_80059BD4_5A7D4\n00000198 R_MIPS_26 func_8005D804_5E404\n000001a4 R_MIPS_26 func_800B00D4_9FF84\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 8e030b84 00408821 .............@.!\n 0020 30620001 14400062 00001021 30621000 0b...@.b...!0b..\n 0030 10400005 3c020008 0c000000 02002021 .@..<......... !\n 0040 0800006c 24020001 00621024 1440004b ...l$....b.$.@.K\n 0050 00000000 9224007a 308200ff 0002182b .....$.z0......+\n 0060 38420008 0002102b 00621824 10600004 8B.....+.b.$.`..\n 0070 2482fff7 2c420002 50400001 a6000bac $...,B..P@......\n 0080 86050bac 10a0001d 00000000 0c000000 ................\n 0090 02002021 92020bc7 14400018 00000000 .. !.....@......\n 00a0 92040bb8 0c000000 86050bac 86030bac ................\n 00b0 28620096 38420001 00021023 3042011d (b..8B.....#0B..\n 00c0 3444011c 2862012c 50400001 2404011e 4D..(b.,P@..$...\n 00d0 28620190 50400001 2404011f 286201f4 (b..P@..$...(b..\n 00e0 50400001 24040120 28620bb8 50400001 P@..$.. (b..P@..\n 00f0 24040121 0c000000 24050006 9223007a $..!....$....#.z\n 0100 24020006 1462001d 00000000 86040baa $....b..........\n 0110 1080001a 00000000 0c000000 00000000 ................\n 0120 86050baa 0c000000 02002021 86030baa .......... !....\n 0130 2862000f 38420001 00021023 3042011d (b..8B.....#0B..\n 0140 3444011c 2862001e 50400001 2404011e 4D..(b..P@..$...\n 0150 28620037 50400001 2404011f 2862005f (b.7P@..$...(b._\n 0160 50400001 24040120 286203e7 50400001 P@..$.. (b..P@..\n 0170 24040121 0c000000 24050006 86020bae $..!....$.......\n 0180 10400008 02002021 0c000000 02002021 .@.... !...... !\n 0190 02002021 24050001 0c000000 2406000f .. !$.......$...\n 01a0 02002021 0c000000 24050003 24020001 .. !....$...$...\n 01b0 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 01c0 27bd0020 00000000 00000000 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_800B2C18_A2AC8' — lift: cannot lift 'func_800B2C18_A2AC8': 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:\tlw\tv1,2948(s0) */\n/* 1c:\tmove\ts1,v0 */\n/* 20:\tandi\tv0,v1,0x1 */\n/* 24:\tbnez\tv0,1b0 */\n/* 28:\tmove\tv0,zero */\n/* 2c:\tandi\tv0,v1,0x1000 */\n/* 30:\tbeqz\tv0,48 */\n/* 34:\tlui\tv0,0x8 */\n/* 38:\tjal\t0 */\n/* 3c:\tmove\ta0,s0 */\n/* 40:\tj\t1b0 */\n/* 44:\tli\tv0,1 */\n/* 48:\tand\tv0,v1,v0 */\n/* 4c:\tbnez\tv0,17c */\n/* 50:\tnop */\n/* 54:\tlbu\ta0,122(s1) */\n/* 58:\tandi\tv0,a0,0xff */\n/* 5c:\tsltu\tv1,zero,v0 */\n/* 60:\txori\tv0,v0,0x8 */\n/* 64:\tsltu\tv0,zero,v0 */\n/* 68:\tand\tv1,v1,v0 */\n/* 6c:\tbeqz\tv1,80 */\n/* 70:\taddiu\tv0,a0,-9 */\n/* 74:\tsltiu\tv0,v0,2 */\n/* 78:\tbeqzl\tv0,80 */\n/* 7c:\tsh\tzero,2988(s0) */\n/* 80:\tlh\ta1,2988(s0) */\n/* 84:\tbeqz\ta1,fc */\n/* 88:\tnop */\n/* 8c:\tjal\t0 */\n/* 90:\tmove\ta0,s0 */\n/* 94:\tlbu\tv0,3015(s0) */\n/* 98:\tbnez\tv0,fc */\n/* 9c:\tnop */\n/* a0:\tlbu\ta0,3000(s0) */\n/* a4:\tjal\t0 */\n/* a8:\tlh\ta1,2988(s0) */\n/* ac:\tlh\tv1,2988(s0) */\n/* b0:\tslti\tv0,v1,150 */\n/* b4:\txori\tv0,v0,0x1 */\n/* b8:\tnegu\tv0,v0 */\n/* bc:\tandi\tv0,v0,0x11d */\n/* c0:\tori\ta0,v0,0x11c */\n/* c4:\tslti\tv0,v1,300 */\n/* c8:\tbeqzl\tv0,d0 */\n/* cc:\tli\ta0,286 */\n/* d0:\tslti\tv0,v1,400 */\n/* d4:\tbeqzl\tv0,dc */\n/* d8:\tli\ta0,287 */\n/* dc:\tslti\tv0,v1,500 */\n/* e0:\tbeqzl\tv0,e8 */\n/* e4:\tli\ta0,288 */\n/* e8:\tslti\tv0,v1,3000 */\n/* ec:\tbeqzl\tv0,f4 */\n/* f0:\tli\ta0,289 */\n/* f4:\tjal\t0 */\n/* f8:\tli\ta1,6 */\n/* fc:\tlbu\tv1,122(s1) */\n/* 100:\tli\tv0,6 */\n/* 104:\tbne\tv1,v0,17c */\n/* 108:\tnop */\n/* 10c:\tlh\ta0,2986(s0) */\n/* 110:\tbeqz\ta0,17c */\n/* 114:\tnop */\n/* 118:\tjal\t0 */\n/* 11c:\tnop */\n/* 120:\tlh\ta1,2986(s0) */\n/* 124:\tjal\t0 */\n/* 128:\tmove\ta0,s0 */\n/* 12c:\tlh\tv1,2986(s0) */\n/* 130:\tslti\tv0,v1,15 */\n/* 134:\txori\tv0,v0,0x1 */\n/* 138:\tnegu\tv0,v0 */\n/* 13c:\tandi\tv0,v0,0x11d */\n/* 140:\tori\ta0,v0,0x11c */\n/* 144:\tslti\tv0,v1,30 */\n/* 148:\tbeqzl\tv0,150 */\n/* 14c:\tli\ta0,286 */\n/* 150:\tslti\tv0,v1,55 */\n/* 154:\tbeqzl\tv0,15c */\n/* 158:\tli\ta0,287 */\n/* 15c:\tslti\tv0,v1,95 */\n/* 160:\tbeqzl\tv0,168 */\n/* 164:\tli\ta0,288 */\n/* 168:\tslti\tv0,v1,999 */\n/* 16c:\tbeqzl\tv0,174 */\n/* 170:\tli\ta0,289 */\n/* 174:\tjal\t0 */\n/* 178:\tli\ta1,6 */\n/* 17c:\tlh\tv0,2990(s0) */\n/* 180:\tbeqz\tv0,1a4 */\n/* 184:\tmove\ta0,s0 */\n/* 188:\tjal\t0 */\n/* 18c:\tmove\ta0,s0 */\n/* 190:\tmove\ta0,s0 */\n/* 194:\tli\ta1,1 */\n/* 198:\tjal\t0 */\n/* 19c:\tli\ta2,15 */\n/* 1a0:\tmove\ta0,s0 */\n/* 1a4:\tjal\t0 */\n/* 1a8:\tli\ta1,3 */\n/* 1ac:\tli\tv0,1 */\n/* 1b0:\tlw\tra,24(sp) */\n/* 1b4:\tlw\ts1,20(sp) */\n/* 1b8:\tlw\ts0,16(sp) */\n/* 1bc:\tjr\tra */\n/* 1c0:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_800B2C18_A2AC8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B2C18_A2AC8': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B2C18_A2AC8': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_80059A88_5A688(Player *, s16); /* extern */\n? func_800B46BC_A456C(Player *); /* extern */\n\ns32 func_800B2C18_A2AC8(Player *arg0) {\n s16 temp_a0_2;\n s16 temp_a1;\n s16 temp_v1_2;\n s16 temp_v1_3;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a0;\n s32 var_a0_2;\n s32 var_v0;\n u8 temp_a0;\n void *temp_s1;\n\n temp_v1 = arg0->unkB84;\n temp_s1 = getCurrentAllocation();\n var_v0 = 0;\n if (!(temp_v1 & 1)) {\n if (temp_v1 & 0x1000) {\n func_800B46BC_A456C(arg0);\n return 1;\n }\n if (!(temp_v1 & 0x80000)) {\n temp_a0 = temp_s1->unk7A;\n temp_v0 = temp_a0 & 0xFF;\n if (((temp_v0 != 0) & (temp_v0 != 8)) && ((u32) (temp_a0 - 9) >= 2U)) {\n arg0->unkBAC = 0;\n }\n temp_a1 = arg0->unkBAC;\n if (temp_a1 != 0) {\n func_80059A48_5A648(arg0, (s32) temp_a1);\n if (arg0->unkBC7 == 0) {\n func_8004D890_4E490((s32) arg0->unkBB8, (s32) arg0->unkBAC);\n temp_v1_2 = arg0->unkBAC;\n var_a0 = (-(temp_v1_2 >= 0x96) & 0x11D) | 0x11C;\n if (temp_v1_2 >= 0x12C) {\n var_a0 = 0x11E;\n }\n if (temp_v1_2 >= 0x190) {\n var_a0 = 0x11F;\n }\n if (temp_v1_2 >= 0x1F4) {\n var_a0 = 0x120;\n }\n if (temp_v1_2 >= 0xBB8) {\n var_a0 = 0x121;\n }\n func_80058530_59130(var_a0, 6);\n }\n }\n if (temp_s1->unk7A == 6) {\n temp_a0_2 = arg0->unkBAA;\n if (temp_a0_2 != 0) {\n func_8004FCF0_508F0((s32) temp_a0_2);\n func_80059A88_5A688(arg0, arg0->unkBAA);\n temp_v1_3 = arg0->unkBAA;\n var_a0_2 = (-(temp_v1_3 >= 0xF) & 0x11D) | 0x11C;\n if (temp_v1_3 >= 0x1E) {\n var_a0_2 = 0x11E;\n }\n if (temp_v1_3 >= 0x37) {\n var_a0_2 = 0x11F;\n }\n if (temp_v1_3 >= 0x5F) {\n var_a0_2 = 0x120;\n }\n if (temp_v1_3 >= 0x3E7) {\n var_a0_2 = 0x121;\n }\n func_80058530_59130(var_a0_2, 6);\n }\n }\n }\n if (arg0->unkBAE != 0) {\n func_80059BD4_5A7D4(arg0);\n func_8005D804_5E404(arg0, 1U, 0xFU);\n }\n func_800B00D4_9FF84(arg0, 3);\n var_v0 = 1;\n /* Duplicate return node #32. Try simplifying control flow for better match */\n return var_v0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":94,"lines":84,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B2C18_A2AC8` — benchmark function snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B2C18_A2AC8\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 lw\t$v1, 2948($s0)\n move\t$s1, $v0\n andi\t$v0, $v1, 0x1\n bnez\t$v0, .L1b0\n move\t$v0, $zero\n andi\t$v0, $v1, 0x1000\n beqz\t$v0, .L48\n lui\t$v0, 0x8\n jal\tfunc_800B46BC_A456C\n move\t$a0, $s0\n j\t.L1b0\n li\t$v0, 1\n.L48:\n and\t$v0, $v1, $v0\n bnez\t$v0, .L17c\n nop\n lbu\t$a0, 122($s1)\n andi\t$v0, $a0, 0xff\n sltu\t$v1, $zero, $v0\n xori\t$v0, $v0, 0x8\n sltu\t$v0, $zero, $v0\n and\t$v1, $v1, $v0\n beqz\t$v1, .L80\n addiu\t$v0, $a0, -9\n sltiu\t$v0, $v0, 2\n beqzl\t$v0, .L80\n sh\t$zero, 2988($s0)\n.L80:\n lh\t$a1, 2988($s0)\n beqz\t$a1, .Lfc\n nop\n jal\tfunc_80059A48_5A648\n move\t$a0, $s0\n lbu\t$v0, 3015($s0)\n bnez\t$v0, .Lfc\n nop\n lbu\t$a0, 3000($s0)\n jal\tfunc_8004D890_4E490\n lh\t$a1, 2988($s0)\n lh\t$v1, 2988($s0)\n slti\t$v0, $v1, 150\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n andi\t$v0, $v0, 0x11d\n ori\t$a0, $v0, 0x11c\n slti\t$v0, $v1, 300\n beqzl\t$v0, .Ld0\n li\t$a0, 286\n.Ld0:\n slti\t$v0, $v1, 400\n beqzl\t$v0, .Ldc\n li\t$a0, 287\n.Ldc:\n slti\t$v0, $v1, 500\n beqzl\t$v0, .Le8\n li\t$a0, 288\n.Le8:\n slti\t$v0, $v1, 3000\n beqzl\t$v0, .Lf4\n li\t$a0, 289\n.Lf4:\n jal\tfunc_80058530_59130\n li\t$a1, 6\n.Lfc:\n lbu\t$v1, 122($s1)\n li\t$v0, 6\n bne\t$v1, $v0, .L17c\n nop\n lh\t$a0, 2986($s0)\n beqz\t$a0, .L17c\n nop\n jal\tfunc_8004FCF0_508F0\n nop\n lh\t$a1, 2986($s0)\n jal\tfunc_80059A88_5A688\n move\t$a0, $s0\n lh\t$v1, 2986($s0)\n slti\t$v0, $v1, 15\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n andi\t$v0, $v0, 0x11d\n ori\t$a0, $v0, 0x11c\n slti\t$v0, $v1, 30\n beqzl\t$v0, .L150\n li\t$a0, 286\n.L150:\n slti\t$v0, $v1, 55\n beqzl\t$v0, .L15c\n li\t$a0, 287\n.L15c:\n slti\t$v0, $v1, 95\n beqzl\t$v0, .L168\n li\t$a0, 288\n.L168:\n slti\t$v0, $v1, 999\n beqzl\t$v0, .L174\n li\t$a0, 289\n.L174:\n jal\tfunc_80058530_59130\n li\t$a1, 6\n.L17c:\n lh\t$v0, 2990($s0)\n beqz\t$v0, .L1a4\n move\t$a0, $s0\n jal\tfunc_80059BD4_5A7D4\n move\t$a0, $s0\n move\t$a0, $s0\n li\t$a1, 1\n jal\tfunc_8005D804_5E404\n li\t$a2, 15\n move\t$a0, $s0\n.L1a4:\n jal\tfunc_800B00D4_9FF84\n li\t$a1, 3\n li\t$v0, 1\n.L1b0:\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\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_800B2C18_A2AC8(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B2C18_A2AC8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B2C18_A2AC8` — benchmark function snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B2C18_A2AC8: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:\tlw\tv1,2948(s0)\n 1c:\tmove\ts1,v0\n 20:\tandi\tv0,v1,0x1\n 24:\tbnez\tv0,1b0 \n 28:\tmove\tv0,zero\n 2c:\tandi\tv0,v1,0x1000\n 30:\tbeqz\tv0,48 \n 34:\tlui\tv0,0x8\n 38:\tjal\t0 \n 3c:\tmove\ta0,s0\n 40:\tj\t1b0 \n 44:\tli\tv0,1\n 48:\tand\tv0,v1,v0\n 4c:\tbnez\tv0,17c \n 50:\tnop\n 54:\tlbu\ta0,122(s1)\n 58:\tandi\tv0,a0,0xff\n 5c:\tsltu\tv1,zero,v0\n 60:\txori\tv0,v0,0x8\n 64:\tsltu\tv0,zero,v0\n 68:\tand\tv1,v1,v0\n 6c:\tbeqz\tv1,80 \n 70:\taddiu\tv0,a0,-9\n 74:\tsltiu\tv0,v0,2\n 78:\tbeqzl\tv0,80 \n 7c:\tsh\tzero,2988(s0)\n 80:\tlh\ta1,2988(s0)\n 84:\tbeqz\ta1,fc \n 88:\tnop\n 8c:\tjal\t0 \n 90:\tmove\ta0,s0\n 94:\tlbu\tv0,3015(s0)\n 98:\tbnez\tv0,fc \n 9c:\tnop\n a0:\tlbu\ta0,3000(s0)\n a4:\tjal\t0 \n a8:\tlh\ta1,2988(s0)\n ac:\tlh\tv1,2988(s0)\n b0:\tslti\tv0,v1,150\n b4:\txori\tv0,v0,0x1\n b8:\tnegu\tv0,v0\n bc:\tandi\tv0,v0,0x11d\n c0:\tori\ta0,v0,0x11c\n c4:\tslti\tv0,v1,300\n c8:\tbeqzl\tv0,d0 \n cc:\tli\ta0,286\n d0:\tslti\tv0,v1,400\n d4:\tbeqzl\tv0,dc \n d8:\tli\ta0,287\n dc:\tslti\tv0,v1,500\n e0:\tbeqzl\tv0,e8 \n e4:\tli\ta0,288\n e8:\tslti\tv0,v1,3000\n ec:\tbeqzl\tv0,f4 \n f0:\tli\ta0,289\n f4:\tjal\t0 \n f8:\tli\ta1,6\n fc:\tlbu\tv1,122(s1)\n 100:\tli\tv0,6\n 104:\tbne\tv1,v0,17c \n 108:\tnop\n 10c:\tlh\ta0,2986(s0)\n 110:\tbeqz\ta0,17c \n 114:\tnop\n 118:\tjal\t0 \n 11c:\tnop\n 120:\tlh\ta1,2986(s0)\n 124:\tjal\t0 \n 128:\tmove\ta0,s0\n 12c:\tlh\tv1,2986(s0)\n 130:\tslti\tv0,v1,15\n 134:\txori\tv0,v0,0x1\n 138:\tnegu\tv0,v0\n 13c:\tandi\tv0,v0,0x11d\n 140:\tori\ta0,v0,0x11c\n 144:\tslti\tv0,v1,30\n 148:\tbeqzl\tv0,150 \n 14c:\tli\ta0,286\n 150:\tslti\tv0,v1,55\n 154:\tbeqzl\tv0,15c \n 158:\tli\ta0,287\n 15c:\tslti\tv0,v1,95\n 160:\tbeqzl\tv0,168 \n 164:\tli\ta0,288\n 168:\tslti\tv0,v1,999\n 16c:\tbeqzl\tv0,174 \n 170:\tli\ta0,289\n 174:\tjal\t0 \n 178:\tli\ta1,6\n 17c:\tlh\tv0,2990(s0)\n 180:\tbeqz\tv0,1a4 \n 184:\tmove\ta0,s0\n 188:\tjal\t0 \n 18c:\tmove\ta0,s0\n 190:\tmove\ta0,s0\n 194:\tli\ta1,1\n 198:\tjal\t0 \n 19c:\tli\ta2,15\n 1a0:\tmove\ta0,s0\n 1a4:\tjal\t0 \n 1a8:\tli\ta1,3\n 1ac:\tli\tv0,1\n 1b0:\tlw\tra,24(sp)\n 1b4:\tlw\ts1,20(sp)\n 1b8:\tlw\ts0,16(sp)\n 1bc:\tjr\tra\n 1c0:\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-5a3edb649490b9c4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 func_800B2C18_A2AC8\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_800B46BC_A456C\n00000000 *UND*\t00000000 func_80059A48_5A648\n00000000 *UND*\t00000000 func_8004D890_4E490\n00000000 *UND*\t00000000 func_80058530_59130\n00000000 *UND*\t00000000 func_8004FCF0_508F0\n00000000 *UND*\t00000000 func_80059A88_5A688\n00000000 *UND*\t00000000 func_80059BD4_5A7D4\n00000000 *UND*\t00000000 func_8005D804_5E404\n00000000 *UND*\t00000000 func_800B00D4_9FF84\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_800B46BC_A456C\n00000040 R_MIPS_26 .text\n0000008c R_MIPS_26 func_80059A48_5A648\n000000a4 R_MIPS_26 func_8004D890_4E490\n000000f4 R_MIPS_26 func_80058530_59130\n00000118 R_MIPS_26 func_8004FCF0_508F0\n00000124 R_MIPS_26 func_80059A88_5A688\n00000174 R_MIPS_26 func_80058530_59130\n00000188 R_MIPS_26 func_80059BD4_5A7D4\n00000198 R_MIPS_26 func_8005D804_5E404\n000001a4 R_MIPS_26 func_800B00D4_9FF84\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 8e030b84 00408821 .............@.!\n 0020 30620001 14400062 00001021 30621000 0b...@.b...!0b..\n 0030 10400005 3c020008 0c000000 02002021 .@..<......... !\n 0040 0800006c 24020001 00621024 1440004b ...l$....b.$.@.K\n 0050 00000000 9224007a 308200ff 0002182b .....$.z0......+\n 0060 38420008 0002102b 00621824 10600004 8B.....+.b.$.`..\n 0070 2482fff7 2c420002 50400001 a6000bac $...,B..P@......\n 0080 86050bac 10a0001d 00000000 0c000000 ................\n 0090 02002021 92020bc7 14400018 00000000 .. !.....@......\n 00a0 92040bb8 0c000000 86050bac 86030bac ................\n 00b0 28620096 38420001 00021023 3042011d (b..8B.....#0B..\n 00c0 3444011c 2862012c 50400001 2404011e 4D..(b.,P@..$...\n 00d0 28620190 50400001 2404011f 286201f4 (b..P@..$...(b..\n 00e0 50400001 24040120 28620bb8 50400001 P@..$.. (b..P@..\n 00f0 24040121 0c000000 24050006 9223007a $..!....$....#.z\n 0100 24020006 1462001d 00000000 86040baa $....b..........\n 0110 1080001a 00000000 0c000000 00000000 ................\n 0120 86050baa 0c000000 02002021 86030baa .......... !....\n 0130 2862000f 38420001 00021023 3042011d (b..8B.....#0B..\n 0140 3444011c 2862001e 50400001 2404011e 4D..(b..P@..$...\n 0150 28620037 50400001 2404011f 2862005f (b.7P@..$...(b._\n 0160 50400001 24040120 286203e7 50400001 P@..$.. (b..P@..\n 0170 24040121 0c000000 24050006 86020bae $..!....$.......\n 0180 10400008 02002021 0c000000 02002021 .@.... !...... !\n 0190 02002021 24050001 0c000000 2406000f .. !$.......$...\n 01a0 02002021 0c000000 24050003 24020001 .. !....$...$...\n 01b0 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 01c0 27bd0020 00000000 00000000 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_800B2C18_A2AC8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_800B3784_A3634:gcc2.7.2kmc","sym":"func_800B3784_A3634","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","switch","bitwise","call","comparison-tree"],"loc":79,"refSource":"void func_800B3784_A3634(Player *arg0) {\n s32 result;\n u8 temp;\n\n switch (arg0->unkBD5) {\n default:\n break;\n\n case 0:\n arg0->unkBD5++;\n arg0->unkBD6 = 4;\n case 1:\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD6 = result;\n arg0->unkBD7 = 0;\n arg0->unkBD5 = arg0->unkBD5 + 1;\n arg0->unkB84 |= 0x8000;\n }\n func_8005D308_5DF08(arg0, arg0->unkBD6);\n break;\n\n case 2:\n result = func_8005D308_5DF08(arg0, arg0->unkBD6);\n if (result != 0) {\n if (arg0->unkBD6 == 0x17) {\n func_800B2950_A2800(arg0, 0);\n }\n\n if (arg0->unkBD6 == 0x19) {\n func_800B2950_A2800(arg0, 1);\n }\n\n if (arg0->unkBD6 == 0x15) {\n func_800B2950_A2800(arg0, 2);\n }\n\n if (arg0->unkBD6 == 0x13) {\n func_800B2950_A2800(arg0, 3);\n }\n\n arg0->unkBD5++;\n arg0->unkBD6++;\n }\n\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD7 = result;\n }\n\n break;\n\n case 3:\n result = func_8005D308_5DF08(arg0, arg0->unkBD6);\n if (result != 0) {\n if (arg0->unkBD7 != 0) {\n arg0->unkBD5 = 2;\n arg0->unkBD6 = arg0->unkBD7;\n arg0->unkBD7 = 0;\n break;\n } else {\n arg0->unkB84 &= 0xFFFF7FFF;\n arg0->unkBD5 = 1;\n }\n }\n\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD7 = result;\n }\n break;\n }\n\n if (arg0->unkB84 & 0xC000) {\n arg0->unkB84 |= 0x1000;\n } else {\n arg0->unkB84 &= ~0x1000;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L1272-L1350","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:\tlbu\ta0,3029(s0)\n 14:\tli\tv0,1\n 18:\tandi\tv1,a0,0xff\n 1c:\tbeq\tv1,v0,60 \n 20:\tslti\tv0,v1,2\n 24:\tbeqzl\tv0,3c \n 28:\tli\tv0,2\n 2c:\tbeqz\tv1,54 \n 30:\taddiu\tv0,a0,1\n 34:\tj\t1a0 \n 38:\tnop\n 3c:\tbeq\tv1,v0,a8 \n 40:\tli\tv0,3\n 44:\tbeq\tv1,v0,13c \n 48:\tnop\n 4c:\tj\t1a0 \n 50:\tnop\n 54:\tsb\tv0,3029(s0)\n 58:\tli\tv0,4\n 5c:\tsb\tv0,3030(s0)\n 60:\tjal\t0 \n 64:\tmove\ta0,s0\n 68:\tmove\ta0,v0\n 6c:\tbeqz\ta0,94 \n 70:\tnop\n 74:\tlbu\tv0,3029(s0)\n 78:\tlw\tv1,2948(s0)\n 7c:\tsb\ta0,3030(s0)\n 80:\tsb\tzero,3031(s0)\n 84:\taddiu\tv0,v0,1\n 88:\tori\tv1,v1,0x8000\n 8c:\tsb\tv0,3029(s0)\n 90:\tsw\tv1,2948(s0)\n 94:\tlbu\ta1,3030(s0)\n 98:\tjal\t0 \n 9c:\tmove\ta0,s0\n a0:\tj\t1a0 \n a4:\tnop\n a8:\tlbu\ta1,3030(s0)\n ac:\tjal\t0 \n b0:\tmove\ta0,s0\n b4:\tbeqz\tv0,18c \n b8:\tli\tv0,23\n bc:\tlbu\tv1,3030(s0)\n c0:\tbne\tv1,v0,dc \n c4:\tli\tv0,25\n c8:\tmove\ta0,s0\n cc:\tjal\t0 \n d0:\tmove\ta1,zero\n d4:\tlbu\tv1,3030(s0)\n d8:\tli\tv0,25\n dc:\tbne\tv1,v0,ec \n e0:\tmove\ta0,s0\n e4:\tjal\t0 \n e8:\tli\ta1,1\n ec:\tlbu\tv1,3030(s0)\n f0:\tli\tv0,21\n f4:\tbne\tv1,v0,110 \n f8:\tli\tv0,19\n fc:\tmove\ta0,s0\n 100:\tjal\t0 \n 104:\tli\ta1,2\n 108:\tlbu\tv1,3030(s0)\n 10c:\tli\tv0,19\n 110:\tbne\tv1,v0,120 \n 114:\tmove\ta0,s0\n 118:\tjal\t0 \n 11c:\tli\ta1,3\n 120:\tlbu\tv0,3029(s0)\n 124:\tlbu\tv1,3030(s0)\n 128:\taddiu\tv0,v0,1\n 12c:\taddiu\tv1,v1,1\n 130:\tsb\tv0,3029(s0)\n 134:\tj\t18c \n 138:\tsb\tv1,3030(s0)\n 13c:\tlbu\ta1,3030(s0)\n 140:\tjal\t0 \n 144:\tmove\ta0,s0\n 148:\tbeqz\tv0,18c \n 14c:\tnop\n 150:\tlbu\tv0,3031(s0)\n 154:\tbeqz\tv0,170 \n 158:\tli\tv0,2\n 15c:\tlbu\tv1,3031(s0)\n 160:\tsb\tv0,3029(s0)\n 164:\tsb\tzero,3031(s0)\n 168:\tj\t1a0 \n 16c:\tsb\tv1,3030(s0)\n 170:\tlui\ta0,0xffff\n 174:\tlw\tv1,2948(s0)\n 178:\tori\ta0,a0,0x7fff\n 17c:\tli\tv0,1\n 180:\tsb\tv0,3029(s0)\n 184:\tand\tv1,v1,a0\n 188:\tsw\tv1,2948(s0)\n 18c:\tjal\t0 \n 190:\tmove\ta0,s0\n 194:\tmove\ta0,v0\n 198:\tbnezl\ta0,1a0 \n 19c:\tsb\ta0,3031(s0)\n 1a0:\tlw\tv1,2948(s0)\n 1a4:\tandi\tv0,v1,0xc000\n 1a8:\tbnez\tv0,1b8 \n 1ac:\tori\tv0,v1,0x1000\n 1b0:\tli\tv0,-4097\n 1b4:\tand\tv0,v1,v0\n 1b8:\tsw\tv0,2948(s0)\n 1bc:\tlw\tra,20(sp)\n 1c0:\tlw\ts0,16(sp)\n 1c4:\tjr\tra\n 1c8:\taddiu\tsp,sp,24\n 1cc:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","proto":{"func_800B3784_A3634":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-147a74c9aecbaebf/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001cc func_800B3784_A3634\n00000000 *UND*\t00000000 func_800B36F0_A35A0\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_800B2950_A2800\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000034 R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000060 R_MIPS_26 func_800B36F0_A35A0\n00000098 R_MIPS_26 func_8005D308_5DF08\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_26 func_8005D308_5DF08\n000000cc R_MIPS_26 func_800B2950_A2800\n000000e4 R_MIPS_26 func_800B2950_A2800\n00000100 R_MIPS_26 func_800B2950_A2800\n00000118 R_MIPS_26 func_800B2950_A2800\n00000134 R_MIPS_26 .text\n00000140 R_MIPS_26 func_8005D308_5DF08\n00000168 R_MIPS_26 .text\n0000018c R_MIPS_26 func_800B36F0_A35A0\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 92040bd5 24020001 308300ff 10620010 ....$...0....b..\n 0020 28620002 50400005 24020002 10600009 (b..P@..$....`..\n 0030 24820001 08000068 00000000 1062001a $......h.....b..\n 0040 24020003 1062003d 00000000 08000068 $....b.=.......h\n 0050 00000000 a2020bd5 24020004 a2020bd6 ........$.......\n 0060 0c000000 02002021 00402021 10800009 ...... !.@ !....\n 0070 00000000 92020bd5 8e030b84 a2040bd6 ................\n 0080 a2000bd7 24420001 34638000 a2020bd5 ....$B..4c......\n 0090 ae030b84 92050bd6 0c000000 02002021 .............. !\n 00a0 08000068 00000000 92050bd6 0c000000 ...h............\n 00b0 02002021 10400035 24020017 92030bd6 .. !.@.5$.......\n 00c0 14620006 24020019 02002021 0c000000 .b..$..... !....\n 00d0 00002821 92030bd6 24020019 14620003 ..(!....$....b..\n 00e0 02002021 0c000000 24050001 92030bd6 .. !....$.......\n 00f0 24020015 14620006 24020013 02002021 $....b..$..... !\n 0100 0c000000 24050002 92030bd6 24020013 ....$.......$...\n 0110 14620003 02002021 0c000000 24050003 .b.... !....$...\n 0120 92020bd5 92030bd6 24420001 24630001 ........$B..$c..\n 0130 a2020bd5 08000063 a2030bd6 92050bd6 .......c........\n 0140 0c000000 02002021 10400010 00000000 ...... !.@......\n 0150 92020bd7 10400006 24020002 92030bd7 .....@..$.......\n 0160 a2020bd5 a2000bd7 08000068 a2030bd6 ...........h....\n 0170 3c04ffff 8e030b84 34847fff 24020001 <.......4...$...\n 0180 a2020bd5 00641824 ae030b84 0c000000 .....d.$........\n 0190 02002021 00402021 54800001 a2040bd7 .. !.@ !T.......\n 01a0 8e030b84 3062c000 14400003 34621000 ....0b...@..4b..\n 01b0 2402efff 00621024 ae020b84 8fbf0014 $....b.$........\n 01c0 8fb00010 03e00008 27bd0018 00000000 ........'.......\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_800B3784_A3634' — lift: cannot lift 'func_800B3784_A3634': 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:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tlbu\ta0,3029(s0) */\n/* 14:\tli\tv0,1 */\n/* 18:\tandi\tv1,a0,0xff */\n/* 1c:\tbeq\tv1,v0,60 */\n/* 20:\tslti\tv0,v1,2 */\n/* 24:\tbeqzl\tv0,3c */\n/* 28:\tli\tv0,2 */\n/* 2c:\tbeqz\tv1,54 */\n/* 30:\taddiu\tv0,a0,1 */\n/* 34:\tj\t1a0 */\n/* 38:\tnop */\n/* 3c:\tbeq\tv1,v0,a8 */\n/* 40:\tli\tv0,3 */\n/* 44:\tbeq\tv1,v0,13c */\n/* 48:\tnop */\n/* 4c:\tj\t1a0 */\n/* 50:\tnop */\n/* 54:\tsb\tv0,3029(s0) */\n/* 58:\tli\tv0,4 */\n/* 5c:\tsb\tv0,3030(s0) */\n/* 60:\tjal\t0 */\n/* 64:\tmove\ta0,s0 */\n/* 68:\tmove\ta0,v0 */\n/* 6c:\tbeqz\ta0,94 */\n/* 70:\tnop */\n/* 74:\tlbu\tv0,3029(s0) */\n/* 78:\tlw\tv1,2948(s0) */\n/* 7c:\tsb\ta0,3030(s0) */\n/* 80:\tsb\tzero,3031(s0) */\n/* 84:\taddiu\tv0,v0,1 */\n/* 88:\tori\tv1,v1,0x8000 */\n/* 8c:\tsb\tv0,3029(s0) */\n/* 90:\tsw\tv1,2948(s0) */\n/* 94:\tlbu\ta1,3030(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\tmove\ta0,s0 */\n/* a0:\tj\t1a0 */\n/* a4:\tnop */\n/* a8:\tlbu\ta1,3030(s0) */\n/* ac:\tjal\t0 */\n/* b0:\tmove\ta0,s0 */\n/* b4:\tbeqz\tv0,18c */\n/* b8:\tli\tv0,23 */\n/* bc:\tlbu\tv1,3030(s0) */\n/* c0:\tbne\tv1,v0,dc */\n/* c4:\tli\tv0,25 */\n/* c8:\tmove\ta0,s0 */\n/* cc:\tjal\t0 */\n/* d0:\tmove\ta1,zero */\n/* d4:\tlbu\tv1,3030(s0) */\n/* d8:\tli\tv0,25 */\n/* dc:\tbne\tv1,v0,ec */\n/* e0:\tmove\ta0,s0 */\n/* e4:\tjal\t0 */\n/* e8:\tli\ta1,1 */\n/* ec:\tlbu\tv1,3030(s0) */\n/* f0:\tli\tv0,21 */\n/* f4:\tbne\tv1,v0,110 */\n/* f8:\tli\tv0,19 */\n/* fc:\tmove\ta0,s0 */\n/* 100:\tjal\t0 */\n/* 104:\tli\ta1,2 */\n/* 108:\tlbu\tv1,3030(s0) */\n/* 10c:\tli\tv0,19 */\n/* 110:\tbne\tv1,v0,120 */\n/* 114:\tmove\ta0,s0 */\n/* 118:\tjal\t0 */\n/* 11c:\tli\ta1,3 */\n/* 120:\tlbu\tv0,3029(s0) */\n/* 124:\tlbu\tv1,3030(s0) */\n/* 128:\taddiu\tv0,v0,1 */\n/* 12c:\taddiu\tv1,v1,1 */\n/* 130:\tsb\tv0,3029(s0) */\n/* 134:\tj\t18c */\n/* 138:\tsb\tv1,3030(s0) */\n/* 13c:\tlbu\ta1,3030(s0) */\n/* 140:\tjal\t0 */\n/* 144:\tmove\ta0,s0 */\n/* 148:\tbeqz\tv0,18c */\n/* 14c:\tnop */\n/* 150:\tlbu\tv0,3031(s0) */\n/* 154:\tbeqz\tv0,170 */\n/* 158:\tli\tv0,2 */\n/* 15c:\tlbu\tv1,3031(s0) */\n/* 160:\tsb\tv0,3029(s0) */\n/* 164:\tsb\tzero,3031(s0) */\n/* 168:\tj\t1a0 */\n/* 16c:\tsb\tv1,3030(s0) */\n/* 170:\tlui\ta0,0xffff */\n/* 174:\tlw\tv1,2948(s0) */\n/* 178:\tori\ta0,a0,0x7fff */\n/* 17c:\tli\tv0,1 */\n/* 180:\tsb\tv0,3029(s0) */\n/* 184:\tand\tv1,v1,a0 */\n/* 188:\tsw\tv1,2948(s0) */\n/* 18c:\tjal\t0 */\n/* 190:\tmove\ta0,s0 */\n/* 194:\tmove\ta0,v0 */\n/* 198:\tbnezl\ta0,1a0 */\n/* 19c:\tsb\ta0,3031(s0) */\n/* 1a0:\tlw\tv1,2948(s0) */\n/* 1a4:\tandi\tv0,v1,0xc000 */\n/* 1a8:\tbnez\tv0,1b8 */\n/* 1ac:\tori\tv0,v1,0x1000 */\n/* 1b0:\tli\tv0,-4097 */\n/* 1b4:\tand\tv0,v1,v0 */\n/* 1b8:\tsw\tv0,2948(s0) */\n/* 1bc:\tlw\tra,20(sp) */\n/* 1c0:\tlw\ts0,16(sp) */\n/* 1c4:\tjr\tra */\n/* 1c8:\taddiu\tsp,sp,24 */\n/* 1cc:\tnop */\nvoid func_800B3784_A3634(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B3784_A3634': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":124,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B3784_A3634': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_800B2950_A2800(Player *, ?); /* extern */\nu8 func_800B36F0_A35A0(Player *); /* extern */\n\nvoid func_800B3784_A3634(Player *arg0) {\n s32 temp_v1;\n s32 temp_v1_3;\n s32 var_v0;\n u8 temp_a0;\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v1_2;\n\n temp_a0 = arg0->unkBD5;\n temp_v1 = temp_a0 & 0xFF;\n switch (temp_v1) { /* irregular */\n case 0:\n arg0->unkBD5 = temp_a0 + 1;\n arg0->unkBD6 = 4;\n /* fallthrough */\n case 1:\n temp_v0 = func_800B36F0_A35A0(arg0);\n if (temp_v0 != 0) {\n arg0->unkBD6 = temp_v0;\n arg0->unkBD7 = 0;\n arg0->unkBD5 += 1;\n arg0->unkB84 |= 0x8000;\n }\n func_8005D308_5DF08(arg0, (s32) arg0->unkBD6);\n break;\n case 2:\n if (func_8005D308_5DF08(arg0, (s32) arg0->unkBD6) != 0) {\n if (arg0->unkBD6 == 0x17) {\n func_800B2950_A2800(arg0, 0);\n }\n if (arg0->unkBD6 == 0x19) {\n func_800B2950_A2800(arg0, 1);\n }\n if (arg0->unkBD6 == 0x15) {\n func_800B2950_A2800(arg0, 2);\n }\n if (arg0->unkBD6 == 0x13) {\n func_800B2950_A2800(arg0, 3);\n }\n arg0->unkBD5 += 1;\n arg0->unkBD6 += 1;\n }\nblock_27:\n temp_v0_2 = func_800B36F0_A35A0(arg0);\n if (temp_v0_2 != 0) {\n arg0->unkBD7 = temp_v0_2;\n }\n break;\n case 3:\n if (func_8005D308_5DF08(arg0, (s32) arg0->unkBD6) != 0) {\n if (arg0->unkBD7 != 0) {\n temp_v1_2 = arg0->unkBD7;\n arg0->unkBD5 = 2;\n arg0->unkBD7 = 0;\n arg0->unkBD6 = temp_v1_2;\n } else {\n arg0->unkBD5 = 1;\n arg0->unkB84 &= 0xFFFF7FFF;\n goto block_27;\n }\n } else {\n goto block_27;\n }\n break;\n }\n temp_v1_3 = arg0->unkB84;\n var_v0 = temp_v1_3 | 0x1000;\n if (!(temp_v1_3 & 0xC000)) {\n var_v0 = temp_v1_3 & ~0x1000;\n }\n arg0->unkB84 = var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":78,"lines":74,"gotos":2,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B3784_A3634` — benchmark function snowboardkids2:func_800B3784_A3634:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B3784_A3634\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lbu\t$a0, 3029($s0)\n li\t$v0, 1\n andi\t$v1, $a0, 0xff\n beq\t$v1, $v0, .L60\n slti\t$v0, $v1, 2\n beqzl\t$v0, .L3c\n li\t$v0, 2\n beqz\t$v1, .L54\n addiu\t$v0, $a0, 1\n j\t.L1a0\n nop\n.L3c:\n beq\t$v1, $v0, .La8\n li\t$v0, 3\n beq\t$v1, $v0, .L13c\n nop\n j\t.L1a0\n nop\n.L54:\n sb\t$v0, 3029($s0)\n li\t$v0, 4\n sb\t$v0, 3030($s0)\n.L60:\n jal\tfunc_800B36F0_A35A0\n move\t$a0, $s0\n move\t$a0, $v0\n beqz\t$a0, .L94\n nop\n lbu\t$v0, 3029($s0)\n lw\t$v1, 2948($s0)\n sb\t$a0, 3030($s0)\n sb\t$zero, 3031($s0)\n addiu\t$v0, $v0, 1\n ori\t$v1, $v1, 0x8000\n sb\t$v0, 3029($s0)\n sw\t$v1, 2948($s0)\n.L94:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n j\t.L1a0\n nop\n.La8:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n beqz\t$v0, .L18c\n li\t$v0, 23\n lbu\t$v1, 3030($s0)\n bne\t$v1, $v0, .Ldc\n li\t$v0, 25\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n move\t$a1, $zero\n lbu\t$v1, 3030($s0)\n li\t$v0, 25\n.Ldc:\n bne\t$v1, $v0, .Lec\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 1\n.Lec:\n lbu\t$v1, 3030($s0)\n li\t$v0, 21\n bne\t$v1, $v0, .L110\n li\t$v0, 19\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 2\n lbu\t$v1, 3030($s0)\n li\t$v0, 19\n.L110:\n bne\t$v1, $v0, .L120\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 3\n.L120:\n lbu\t$v0, 3029($s0)\n lbu\t$v1, 3030($s0)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, 1\n sb\t$v0, 3029($s0)\n j\t.L18c\n sb\t$v1, 3030($s0)\n.L13c:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n beqz\t$v0, .L18c\n nop\n lbu\t$v0, 3031($s0)\n beqz\t$v0, .L170\n li\t$v0, 2\n lbu\t$v1, 3031($s0)\n sb\t$v0, 3029($s0)\n sb\t$zero, 3031($s0)\n j\t.L1a0\n sb\t$v1, 3030($s0)\n.L170:\n lui\t$a0, 0xffff\n lw\t$v1, 2948($s0)\n ori\t$a0, $a0, 0x7fff\n li\t$v0, 1\n sb\t$v0, 3029($s0)\n and\t$v1, $v1, $a0\n sw\t$v1, 2948($s0)\n.L18c:\n jal\tfunc_800B36F0_A35A0\n move\t$a0, $s0\n move\t$a0, $v0\n bnezl\t$a0, .L1a0\n sb\t$a0, 3031($s0)\n.L1a0:\n lw\t$v1, 2948($s0)\n andi\t$v0, $v1, 0xc000\n bnez\t$v0, .L1b8\n ori\t$v0, $v1, 0x1000\n li\t$v0, -4097\n and\t$v0, $v1, $v0\n.L1b8:\n sw\t$v0, 2948($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B3784_A3634(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B3784_A3634 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B3784_A3634` — benchmark function snowboardkids2:func_800B3784_A3634:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B3784_A3634: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:\tlbu\ta0,3029(s0)\n 14:\tli\tv0,1\n 18:\tandi\tv1,a0,0xff\n 1c:\tbeq\tv1,v0,60 \n 20:\tslti\tv0,v1,2\n 24:\tbeqzl\tv0,3c \n 28:\tli\tv0,2\n 2c:\tbeqz\tv1,54 \n 30:\taddiu\tv0,a0,1\n 34:\tj\t1a0 \n 38:\tnop\n 3c:\tbeq\tv1,v0,a8 \n 40:\tli\tv0,3\n 44:\tbeq\tv1,v0,13c \n 48:\tnop\n 4c:\tj\t1a0 \n 50:\tnop\n 54:\tsb\tv0,3029(s0)\n 58:\tli\tv0,4\n 5c:\tsb\tv0,3030(s0)\n 60:\tjal\t0 \n 64:\tmove\ta0,s0\n 68:\tmove\ta0,v0\n 6c:\tbeqz\ta0,94 \n 70:\tnop\n 74:\tlbu\tv0,3029(s0)\n 78:\tlw\tv1,2948(s0)\n 7c:\tsb\ta0,3030(s0)\n 80:\tsb\tzero,3031(s0)\n 84:\taddiu\tv0,v0,1\n 88:\tori\tv1,v1,0x8000\n 8c:\tsb\tv0,3029(s0)\n 90:\tsw\tv1,2948(s0)\n 94:\tlbu\ta1,3030(s0)\n 98:\tjal\t0 \n 9c:\tmove\ta0,s0\n a0:\tj\t1a0 \n a4:\tnop\n a8:\tlbu\ta1,3030(s0)\n ac:\tjal\t0 \n b0:\tmove\ta0,s0\n b4:\tbeqz\tv0,18c \n b8:\tli\tv0,23\n bc:\tlbu\tv1,3030(s0)\n c0:\tbne\tv1,v0,dc \n c4:\tli\tv0,25\n c8:\tmove\ta0,s0\n cc:\tjal\t0 \n d0:\tmove\ta1,zero\n d4:\tlbu\tv1,3030(s0)\n d8:\tli\tv0,25\n dc:\tbne\tv1,v0,ec \n e0:\tmove\ta0,s0\n e4:\tjal\t0 \n e8:\tli\ta1,1\n ec:\tlbu\tv1,3030(s0)\n f0:\tli\tv0,21\n f4:\tbne\tv1,v0,110 \n f8:\tli\tv0,19\n fc:\tmove\ta0,s0\n 100:\tjal\t0 \n 104:\tli\ta1,2\n 108:\tlbu\tv1,3030(s0)\n 10c:\tli\tv0,19\n 110:\tbne\tv1,v0,120 \n 114:\tmove\ta0,s0\n 118:\tjal\t0 \n 11c:\tli\ta1,3\n 120:\tlbu\tv0,3029(s0)\n 124:\tlbu\tv1,3030(s0)\n 128:\taddiu\tv0,v0,1\n 12c:\taddiu\tv1,v1,1\n 130:\tsb\tv0,3029(s0)\n 134:\tj\t18c \n 138:\tsb\tv1,3030(s0)\n 13c:\tlbu\ta1,3030(s0)\n 140:\tjal\t0 \n 144:\tmove\ta0,s0\n 148:\tbeqz\tv0,18c \n 14c:\tnop\n 150:\tlbu\tv0,3031(s0)\n 154:\tbeqz\tv0,170 \n 158:\tli\tv0,2\n 15c:\tlbu\tv1,3031(s0)\n 160:\tsb\tv0,3029(s0)\n 164:\tsb\tzero,3031(s0)\n 168:\tj\t1a0 \n 16c:\tsb\tv1,3030(s0)\n 170:\tlui\ta0,0xffff\n 174:\tlw\tv1,2948(s0)\n 178:\tori\ta0,a0,0x7fff\n 17c:\tli\tv0,1\n 180:\tsb\tv0,3029(s0)\n 184:\tand\tv1,v1,a0\n 188:\tsw\tv1,2948(s0)\n 18c:\tjal\t0 \n 190:\tmove\ta0,s0\n 194:\tmove\ta0,v0\n 198:\tbnezl\ta0,1a0 \n 19c:\tsb\ta0,3031(s0)\n 1a0:\tlw\tv1,2948(s0)\n 1a4:\tandi\tv0,v1,0xc000\n 1a8:\tbnez\tv0,1b8 \n 1ac:\tori\tv0,v1,0x1000\n 1b0:\tli\tv0,-4097\n 1b4:\tand\tv0,v1,v0\n 1b8:\tsw\tv0,2948(s0)\n 1bc:\tlw\tra,20(sp)\n 1c0:\tlw\ts0,16(sp)\n 1c4:\tjr\tra\n 1c8:\taddiu\tsp,sp,24\n 1cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-147a74c9aecbaebf/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001cc func_800B3784_A3634\n00000000 *UND*\t00000000 func_800B36F0_A35A0\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_800B2950_A2800\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000034 R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000060 R_MIPS_26 func_800B36F0_A35A0\n00000098 R_MIPS_26 func_8005D308_5DF08\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_26 func_8005D308_5DF08\n000000cc R_MIPS_26 func_800B2950_A2800\n000000e4 R_MIPS_26 func_800B2950_A2800\n00000100 R_MIPS_26 func_800B2950_A2800\n00000118 R_MIPS_26 func_800B2950_A2800\n00000134 R_MIPS_26 .text\n00000140 R_MIPS_26 func_8005D308_5DF08\n00000168 R_MIPS_26 .text\n0000018c R_MIPS_26 func_800B36F0_A35A0\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 92040bd5 24020001 308300ff 10620010 ....$...0....b..\n 0020 28620002 50400005 24020002 10600009 (b..P@..$....`..\n 0030 24820001 08000068 00000000 1062001a $......h.....b..\n 0040 24020003 1062003d 00000000 08000068 $....b.=.......h\n 0050 00000000 a2020bd5 24020004 a2020bd6 ........$.......\n 0060 0c000000 02002021 00402021 10800009 ...... !.@ !....\n 0070 00000000 92020bd5 8e030b84 a2040bd6 ................\n 0080 a2000bd7 24420001 34638000 a2020bd5 ....$B..4c......\n 0090 ae030b84 92050bd6 0c000000 02002021 .............. !\n 00a0 08000068 00000000 92050bd6 0c000000 ...h............\n 00b0 02002021 10400035 24020017 92030bd6 .. !.@.5$.......\n 00c0 14620006 24020019 02002021 0c000000 .b..$..... !....\n 00d0 00002821 92030bd6 24020019 14620003 ..(!....$....b..\n 00e0 02002021 0c000000 24050001 92030bd6 .. !....$.......\n 00f0 24020015 14620006 24020013 02002021 $....b..$..... !\n 0100 0c000000 24050002 92030bd6 24020013 ....$.......$...\n 0110 14620003 02002021 0c000000 24050003 .b.... !....$...\n 0120 92020bd5 92030bd6 24420001 24630001 ........$B..$c..\n 0130 a2020bd5 08000063 a2030bd6 92050bd6 .......c........\n 0140 0c000000 02002021 10400010 00000000 ...... !.@......\n 0150 92020bd7 10400006 24020002 92030bd7 .....@..$.......\n 0160 a2020bd5 a2000bd7 08000068 a2030bd6 ...........h....\n 0170 3c04ffff 8e030b84 34847fff 24020001 <.......4...$...\n 0180 a2020bd5 00641824 ae030b84 0c000000 .....d.$........\n 0190 02002021 00402021 54800001 a2040bd7 .. !.@ !T.......\n 01a0 8e030b84 3062c000 14400003 34621000 ....0b...@..4b..\n 01b0 2402efff 00621024 ae020b84 8fbf0014 $....b.$........\n 01c0 8fb00010 03e00008 27bd0018 00000000 ........'.......\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800B3784_A3634\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_800B3784_A3634 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_800B3F2C_A3DDC:gcc2.7.2kmc","sym":"func_800B3F2C_A3DDC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","switch","bitwise","call","jump-table"],"loc":80,"refSource":"s32 func_800B3F2C_A3DDC(Player *arg0) {\n u32 temp_v0;\n s32 temp_v1;\n s32 temp_v0_2;\n u8 state;\n s32 temp;\n\n temp_v0 = arg0->unkB84;\n temp_v1 = arg0->unk450;\n\n arg0->unk44C = 0;\n arg0->unk454 = 0;\n\n temp_v0 |= 0x60;\n temp_v1 += -0x6000;\n\n arg0->unkB84 = temp_v0;\n arg0->unk450 = temp_v1;\n\n func_800B40D4_A3F84(arg0);\n func_800B02AC_A015C(arg0);\n\n temp = arg0->unkAE0;\n if (!(0xDFFFF < temp)) {\n arg0->unkAE0 = temp + 0x8000;\n }\n\n state = arg0->unkBC0;\n\n switch (state) {\n case 0:\n if (func_8005D308_5DF08(arg0, 0x1E)) {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 1:\n if (func_8005D308_5DF08(arg0, 0x20)) {\n temp_v1 = 0x14;\n temp_v0_2 = arg0->unkBC0;\n arg0->unkB8C = temp_v1;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 2:\n temp_v0_2 = arg0->unkB8C;\n if (temp_v0_2 != 0) {\n temp_v0_2--;\n arg0->unkB8C = temp_v0_2;\n } else {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 3:\n if (func_8005D308_5DF08(arg0, 0x1F)) {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 4:\n if (func_8005D308_5DF08(arg0, 0x20)) {\n arg0->unkBC0 = 2;\n arg0->unkB8C = 0x14;\n }\n break;\n }\n\n func_8005D804_5E404(arg0, 4, 0);\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L1480-L1559","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\tv0,2948(s0)\n 14:\tlw\tv1,1104(s0)\n 18:\tsw\tzero,1100(s0)\n 1c:\tsw\tzero,1108(s0)\n 20:\tori\tv0,v0,0x60\n 24:\taddiu\tv1,v1,-24576\n 28:\tsw\tv0,2948(s0)\n 2c:\tjal\t0 \n 30:\tsw\tv1,1104(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlw\tv1,2784(s0)\n 40:\tlui\tv0,0xd\n 44:\tori\tv0,v0,0xffff\n 48:\tslt\tv0,v0,v1\n 4c:\tbnez\tv0,5c \n 50:\tli\tv0,0x8000\n 54:\taddu\tv0,v1,v0\n 58:\tsw\tv0,2784(s0)\n 5c:\tlbu\tv1,3008(s0)\n 60:\tsltiu\tv0,v1,5\n 64:\tbeqz\tv0,108 \n 68:\tsll\tv0,v1,0x2\n 6c:\tlui\tat,0x0\n 70:\taddu\tat,at,v0\n 74:\tlw\tv0,0(at)\n 78:\tjr\tv0\n 7c:\tnop\n 80:\tmove\ta0,s0\n 84:\tj\tc8 \n 88:\tli\ta1,30\n 8c:\tmove\ta0,s0\n 90:\tjal\t0 \n 94:\tli\ta1,32\n 98:\tbeqz\tv0,108 \n 9c:\tli\tv1,20\n a0:\tlbu\tv0,3008(s0)\n a4:\tj\tdc \n a8:\tsw\tv1,2956(s0)\n ac:\tlw\tv0,2956(s0)\n b0:\tbeqz\tv0,d8 \n b4:\taddiu\tv0,v0,-1\n b8:\tj\t108 \n bc:\tsw\tv0,2956(s0)\n c0:\tmove\ta0,s0\n c4:\tli\ta1,31\n c8:\tjal\t0 \n cc:\tnop\n d0:\tbeqz\tv0,10c \n d4:\tmove\ta0,s0\n d8:\tlbu\tv0,3008(s0)\n dc:\taddiu\tv0,v0,1\n e0:\tj\t108 \n e4:\tsb\tv0,3008(s0)\n e8:\tmove\ta0,s0\n ec:\tjal\t0 \n f0:\tli\ta1,32\n f4:\tbeqz\tv0,108 \n f8:\tli\tv0,2\n fc:\tsb\tv0,3008(s0)\n 100:\tli\tv0,20\n 104:\tsw\tv0,2956(s0)\n 108:\tmove\ta0,s0\n 10c:\tli\ta1,4\n 110:\tjal\t0 \n 114:\tmove\ta2,zero\n 118:\tmove\tv0,zero\n 11c:\tlw\tra,20(sp)\n 120:\tlw\ts0,16(sp)\n 124:\tjr\tra\n 128:\taddiu\tsp,sp,24\n 12c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-5f3a093c3f6ff0bb/u.i\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\t0000012c func_800B3F2C_A3DDC\n00000000 *UND*\t00000000 func_800B40D4_A3F84\n00000000 *UND*\t00000000 func_800B02AC_A015C\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_8005D804_5E404\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B40D4_A3F84\n00000034 R_MIPS_26 func_800B02AC_A015C\n0000006c R_MIPS_HI16 .rodata\n00000074 R_MIPS_LO16 .rodata\n00000084 R_MIPS_26 .text\n00000090 R_MIPS_26 func_8005D308_5DF08\n000000a4 R_MIPS_26 .text\n000000b8 R_MIPS_26 .text\n000000c8 R_MIPS_26 func_8005D308_5DF08\n000000e0 R_MIPS_26 .text\n000000ec R_MIPS_26 func_8005D308_5DF08\n00000110 R_MIPS_26 func_8005D804_5E404\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\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e020b84 8e030450 ae00044c ae000454 .......P...L...T\n 0020 34420060 2463a000 ae020b84 0c000000 4B.`$c..........\n 0030 ae030450 0c000000 02002021 8e030ae0 ...P...... !....\n 0040 3c02000d 3442ffff 0043102a 14400003 <...4B...C.*.@..\n 0050 34028000 00621021 ae020ae0 92030bc0 4....b.!........\n 0060 2c620005 10400028 00031080 3c010000 ,b...@.(....<...\n 0070 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0080 02002021 08000032 2405001e 02002021 .. !...2$..... !\n 0090 0c000000 24050020 1040001b 24030014 ....$.. .@..$...\n 00a0 92020bc0 08000037 ae030b8c 8e020b8c .......7........\n 00b0 10400009 2442ffff 08000042 ae020b8c .@..$B.....B....\n 00c0 02002021 2405001f 0c000000 00000000 .. !$...........\n 00d0 1040000e 02002021 92020bc0 24420001 .@.... !....$B..\n 00e0 08000042 a2020bc0 02002021 0c000000 ...B...... !....\n 00f0 24050020 10400004 24020002 a2020bc0 $.. .@..$.......\n 0100 24020014 ae020b8c 02002021 24050004 $......... !$...\n 0110 0c000000 00003021 00001021 8fbf0014 ......0!...!....\n 0120 8fb00010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a001007e 00000000 00000000 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 00000080 0000008c 000000ac 000000c0 ................\n 0010 000000e8 00000000 ........ \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_800B3F2C_A3DDC' — lift: cannot lift 'func_800B3F2C_A3DDC': 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\tv0,2948(s0) */\n/* 14:\tlw\tv1,1104(s0) */\n/* 18:\tsw\tzero,1100(s0) */\n/* 1c:\tsw\tzero,1108(s0) */\n/* 20:\tori\tv0,v0,0x60 */\n/* 24:\taddiu\tv1,v1,-24576 */\n/* 28:\tsw\tv0,2948(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\tv1,1104(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlw\tv1,2784(s0) */\n/* 40:\tlui\tv0,0xd */\n/* 44:\tori\tv0,v0,0xffff */\n/* 48:\tslt\tv0,v0,v1 */\n/* 4c:\tbnez\tv0,5c */\n/* 50:\tli\tv0,0x8000 */\n/* 54:\taddu\tv0,v1,v0 */\n/* 58:\tsw\tv0,2784(s0) */\n/* 5c:\tlbu\tv1,3008(s0) */\n/* 60:\tsltiu\tv0,v1,5 */\n/* 64:\tbeqz\tv0,108 */\n/* 68:\tsll\tv0,v1,0x2 */\n/* 6c:\tlui\tat,0x0 */\n/* 70:\taddu\tat,at,v0 */\n/* 74:\tlw\tv0,0(at) */\n/* 78:\tjr\tv0 */\n/* 7c:\tnop */\n/* 80:\tmove\ta0,s0 */\n/* 84:\tj\tc8 */\n/* 88:\tli\ta1,30 */\n/* 8c:\tmove\ta0,s0 */\n/* 90:\tjal\t0 */\n/* 94:\tli\ta1,32 */\n/* 98:\tbeqz\tv0,108 */\n/* 9c:\tli\tv1,20 */\n/* a0:\tlbu\tv0,3008(s0) */\n/* a4:\tj\tdc */\n/* a8:\tsw\tv1,2956(s0) */\n/* ac:\tlw\tv0,2956(s0) */\n/* b0:\tbeqz\tv0,d8 */\n/* b4:\taddiu\tv0,v0,-1 */\n/* b8:\tj\t108 */\n/* bc:\tsw\tv0,2956(s0) */\n/* c0:\tmove\ta0,s0 */\n/* c4:\tli\ta1,31 */\n/* c8:\tjal\t0 */\n/* cc:\tnop */\n/* d0:\tbeqz\tv0,10c */\n/* d4:\tmove\ta0,s0 */\n/* d8:\tlbu\tv0,3008(s0) */\n/* dc:\taddiu\tv0,v0,1 */\n/* e0:\tj\t108 */\n/* e4:\tsb\tv0,3008(s0) */\n/* e8:\tmove\ta0,s0 */\n/* ec:\tjal\t0 */\n/* f0:\tli\ta1,32 */\n/* f4:\tbeqz\tv0,108 */\n/* f8:\tli\tv0,2 */\n/* fc:\tsb\tv0,3008(s0) */\n/* 100:\tli\tv0,20 */\n/* 104:\tsw\tv0,2956(s0) */\n/* 108:\tmove\ta0,s0 */\n/* 10c:\tli\ta1,4 */\n/* 110:\tjal\t0 */\n/* 114:\tmove\ta2,zero */\n/* 118:\tmove\tv0,zero */\n/* 11c:\tlw\tra,20(sp) */\n/* 120:\tlw\ts0,16(sp) */\n/* 124:\tjr\tra */\n/* 128:\taddiu\tsp,sp,24 */\n/* 12c:\tnop */\nvoid func_800B3F2C_A3DDC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B3F2C_A3DDC': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":84,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B3F2C_A3DDC': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_800B40D4_A3F84(); /* extern */\n\ns32 func_800B3F2C_A3DDC(Player *arg0) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a1;\n u8 temp_v1_2;\n\n arg0->unk44C = 0;\n arg0->unk454 = 0;\n arg0->unkB84 |= 0x60;\n arg0->unk450 -= 0x6000;\n func_800B40D4_A3F84();\n func_800B02AC_A015C(arg0);\n temp_v1 = arg0->unkAE0;\n if (temp_v1 <= 0xDFFFF) {\n arg0->unkAE0 = temp_v1 + 0x8000;\n }\n temp_v1_2 = arg0->unkBC0;\n switch (temp_v1_2) {\n case 0:\n var_a1 = 0x1E;\nblock_10:\n if (func_8005D308_5DF08(arg0, var_a1) != 0) {\nblock_11:\nblock_12:\n arg0->unkBC0 += 1;\n default:\n }\n break;\n case 1:\n if (func_8005D308_5DF08(arg0, 0x20) != 0) {\n arg0->unkB8C = 0x14;\n goto block_12;\n }\n break;\n case 2:\n temp_v0 = arg0->unkB8C;\n if (temp_v0 != 0) {\n arg0->unkB8C = temp_v0 - 1;\n } else {\n goto block_11;\n }\n break;\n case 3:\n var_a1 = 0x1F;\n goto block_10;\n case 4:\n if (func_8005D308_5DF08(arg0, 0x20) != 0) {\n arg0->unkBC0 = 2;\n arg0->unkB8C = 0x14;\n }\n break;\n }\n func_8005D804_5E404(arg0, 4U, 0U);\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":55,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B3F2C_A3DDC` — benchmark function snowboardkids2:func_800B3F2C_A3DDC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B3F2C_A3DDC\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$v0, 2948($s0)\n lw\t$v1, 1104($s0)\n sw\t$zero, 1100($s0)\n sw\t$zero, 1108($s0)\n ori\t$v0, $v0, 0x60\n addiu\t$v1, $v1, -24576\n sw\t$v0, 2948($s0)\n jal\tfunc_800B40D4_A3F84\n sw\t$v1, 1104($s0)\n jal\tfunc_800B02AC_A015C\n move\t$a0, $s0\n lw\t$v1, 2784($s0)\n lui\t$v0, 0xd\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .L5c\n li\t$v0, 0x8000\n addu\t$v0, $v1, $v0\n sw\t$v0, 2784($s0)\n.L5c:\n lbu\t$v1, 3008($s0)\n sltiu\t$v0, $v1, 5\n beqz\t$v0, .L108\n sll\t$v0, $v1, 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.L80:\n move\t$a0, $s0\n j\t.Lc8\n li\t$a1, 30\n.L8c:\n move\t$a0, $s0\n jal\tfunc_8005D308_5DF08\n li\t$a1, 32\n beqz\t$v0, .L108\n li\t$v1, 20\n lbu\t$v0, 3008($s0)\n j\t.Ldc\n sw\t$v1, 2956($s0)\n.Lac:\n lw\t$v0, 2956($s0)\n beqz\t$v0, .Ld8\n addiu\t$v0, $v0, -1\n j\t.L108\n sw\t$v0, 2956($s0)\n.Lc0:\n move\t$a0, $s0\n li\t$a1, 31\n.Lc8:\n jal\tfunc_8005D308_5DF08\n nop\n beqz\t$v0, .L10c\n move\t$a0, $s0\n.Ld8:\n lbu\t$v0, 3008($s0)\n.Ldc:\n addiu\t$v0, $v0, 1\n j\t.L108\n sb\t$v0, 3008($s0)\n.Le8:\n move\t$a0, $s0\n jal\tfunc_8005D308_5DF08\n li\t$a1, 32\n beqz\t$v0, .L108\n li\t$v0, 2\n sb\t$v0, 3008($s0)\n li\t$v0, 20\n sw\t$v0, 2956($s0)\n.L108:\n move\t$a0, $s0\n.L10c:\n li\t$a1, 4\n jal\tfunc_8005D804_5E404\n move\t$a2, $zero\n move\t$v0, $zero\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L80\n.word .L8c\n.word .Lac\n.word .Lc0\n.word .Le8\n.word 0x0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_800B3F2C_A3DDC(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B3F2C_A3DDC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B3F2C_A3DDC` — benchmark function snowboardkids2:func_800B3F2C_A3DDC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B3F2C_A3DDC: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\tv0,2948(s0)\n 14:\tlw\tv1,1104(s0)\n 18:\tsw\tzero,1100(s0)\n 1c:\tsw\tzero,1108(s0)\n 20:\tori\tv0,v0,0x60\n 24:\taddiu\tv1,v1,-24576\n 28:\tsw\tv0,2948(s0)\n 2c:\tjal\t0 \n 30:\tsw\tv1,1104(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlw\tv1,2784(s0)\n 40:\tlui\tv0,0xd\n 44:\tori\tv0,v0,0xffff\n 48:\tslt\tv0,v0,v1\n 4c:\tbnez\tv0,5c \n 50:\tli\tv0,0x8000\n 54:\taddu\tv0,v1,v0\n 58:\tsw\tv0,2784(s0)\n 5c:\tlbu\tv1,3008(s0)\n 60:\tsltiu\tv0,v1,5\n 64:\tbeqz\tv0,108 \n 68:\tsll\tv0,v1,0x2\n 6c:\tlui\tat,0x0\n 70:\taddu\tat,at,v0\n 74:\tlw\tv0,0(at)\n 78:\tjr\tv0\n 7c:\tnop\n 80:\tmove\ta0,s0\n 84:\tj\tc8 \n 88:\tli\ta1,30\n 8c:\tmove\ta0,s0\n 90:\tjal\t0 \n 94:\tli\ta1,32\n 98:\tbeqz\tv0,108 \n 9c:\tli\tv1,20\n a0:\tlbu\tv0,3008(s0)\n a4:\tj\tdc \n a8:\tsw\tv1,2956(s0)\n ac:\tlw\tv0,2956(s0)\n b0:\tbeqz\tv0,d8 \n b4:\taddiu\tv0,v0,-1\n b8:\tj\t108 \n bc:\tsw\tv0,2956(s0)\n c0:\tmove\ta0,s0\n c4:\tli\ta1,31\n c8:\tjal\t0 \n cc:\tnop\n d0:\tbeqz\tv0,10c \n d4:\tmove\ta0,s0\n d8:\tlbu\tv0,3008(s0)\n dc:\taddiu\tv0,v0,1\n e0:\tj\t108 \n e4:\tsb\tv0,3008(s0)\n e8:\tmove\ta0,s0\n ec:\tjal\t0 \n f0:\tli\ta1,32\n f4:\tbeqz\tv0,108 \n f8:\tli\tv0,2\n fc:\tsb\tv0,3008(s0)\n 100:\tli\tv0,20\n 104:\tsw\tv0,2956(s0)\n 108:\tmove\ta0,s0\n 10c:\tli\ta1,4\n 110:\tjal\t0 \n 114:\tmove\ta2,zero\n 118:\tmove\tv0,zero\n 11c:\tlw\tra,20(sp)\n 120:\tlw\ts0,16(sp)\n 124:\tjr\tra\n 128:\taddiu\tsp,sp,24\n 12c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-5f3a093c3f6ff0bb/u.i\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\t0000012c func_800B3F2C_A3DDC\n00000000 *UND*\t00000000 func_800B40D4_A3F84\n00000000 *UND*\t00000000 func_800B02AC_A015C\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_8005D804_5E404\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B40D4_A3F84\n00000034 R_MIPS_26 func_800B02AC_A015C\n0000006c R_MIPS_HI16 .rodata\n00000074 R_MIPS_LO16 .rodata\n00000084 R_MIPS_26 .text\n00000090 R_MIPS_26 func_8005D308_5DF08\n000000a4 R_MIPS_26 .text\n000000b8 R_MIPS_26 .text\n000000c8 R_MIPS_26 func_8005D308_5DF08\n000000e0 R_MIPS_26 .text\n000000ec R_MIPS_26 func_8005D308_5DF08\n00000110 R_MIPS_26 func_8005D804_5E404\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\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e020b84 8e030450 ae00044c ae000454 .......P...L...T\n 0020 34420060 2463a000 ae020b84 0c000000 4B.`$c..........\n 0030 ae030450 0c000000 02002021 8e030ae0 ...P...... !....\n 0040 3c02000d 3442ffff 0043102a 14400003 <...4B...C.*.@..\n 0050 34028000 00621021 ae020ae0 92030bc0 4....b.!........\n 0060 2c620005 10400028 00031080 3c010000 ,b...@.(....<...\n 0070 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0080 02002021 08000032 2405001e 02002021 .. !...2$..... !\n 0090 0c000000 24050020 1040001b 24030014 ....$.. .@..$...\n 00a0 92020bc0 08000037 ae030b8c 8e020b8c .......7........\n 00b0 10400009 2442ffff 08000042 ae020b8c .@..$B.....B....\n 00c0 02002021 2405001f 0c000000 00000000 .. !$...........\n 00d0 1040000e 02002021 92020bc0 24420001 .@.... !....$B..\n 00e0 08000042 a2020bc0 02002021 0c000000 ...B...... !....\n 00f0 24050020 10400004 24020002 a2020bc0 $.. .@..$.......\n 0100 24020014 ae020b8c 02002021 24050004 $......... !$...\n 0110 0c000000 00003021 00001021 8fbf0014 ......0!...!....\n 0120 8fb00010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a001007e 00000000 00000000 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 00000080 0000008c 000000ac 000000c0 ................\n 0010 000000e8 00000000 ........ \nContents of section .comment:\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_800B3F2C_A3DDC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B4B30_1E1BE0\n addiu\t$sp, $sp, -40\n sw\t$s1, 28($sp)\n move\t$s1, $a1\n sw\t$s2, 32($sp)\n move\t$s2, $a2\n sll\t$a3, $a3, 0x10\n sw\t$s0, 24($sp)\n sra\t$s0, $a3, 0x10\n bgtz\t$s0, .L60\n sw\t$ra, 36($sp)\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80058360_58F60\n move\t$a3, $zero\n j\t.L94\n nop\n.L60:\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sw\t$s0, 16($sp)\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80057DF0_589F0\n move\t$a3, $zero\n.L94:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B4B30_1E1BE0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc","sym":"func_800B5B7C_1E2C2C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":33,"refSource":"void func_800B5B7C_1E2C2C(func_800B5E64_1E2F14_arg0 *arg0, u16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[32]; u16 field_32; u16 field_34; u16 field_36; u16 field_38; u16 field_40; u16 field_42; u16 field_44; u16 field_46; u16 field_48; u16 field_50; s32 field_52; s32 field_56; s32 field_60; s32 field_64; s32 field_68; s32 field_72; s32 field_76; s32 field_80; s32 field_84; u16 field_88; u16 field_90; u16 field_92; u16 field_94; u16 field_96; u16 field_98; s32 field_100; s32 field_104; u16 field_108; u16 field_110; u8 field_112; u8 field_113; };\nvoid 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B5B7C_1E2C2C\n sh\t$zero, 32($a0)\n sh\t$zero, 34($a0)\n sh\t$zero, 36($a0)\n sh\t$zero, 38($a0)\n sh\t$zero, 40($a0)\n sh\t$zero, 42($a0)\n sh\t$zero, 44($a0)\n sh\t$zero, 46($a0)\n sh\t$zero, 48($a0)\n sh\t$zero, 50($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 60($a0)\n sw\t$zero, 64($a0)\n sw\t$zero, 68($a0)\n sw\t$zero, 72($a0)\n sw\t$zero, 76($a0)\n sw\t$zero, 80($a0)\n sw\t$zero, 84($a0)\n sh\t$zero, 88($a0)\n sh\t$zero, 90($a0)\n sh\t$zero, 92($a0)\n sh\t$zero, 94($a0)\n sh\t$zero, 96($a0)\n sh\t$zero, 98($a0)\n sw\t$zero, 100($a0)\n sw\t$zero, 104($a0)\n sh\t$zero, 108($a0)\n sh\t$a1, 110($a0)\n sb\t$zero, 112($a0)\n jr\t$ra\n sb\t$zero, 113($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B5B7C_1E2C2C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc","sym":"func_800B68F4_1E39A4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":8,"refSource":"void func_800B68F4_1E39A4(unk_func_800B68F4_1E39A4 *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B68F4_1E39A4\n sw\t$a1, 96($a0)\n sw\t$a1, 84($a0)\n sw\t$a2, 100($a0)\n sw\t$a2, 88($a0)\n sw\t$a3, 104($a0)\n jr\t$ra\n sw\t$a3, 92($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B68F4_1E39A4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc","sym":"func_800B7620_1E46D0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","union","ternary","shift","bitwise","call","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7620_1E46D0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lw\t$a0, 36($s0)\n sw\t$a1, 148($s0)\n lw\t$a1, 44($s0)\n li\t$v0, 6\n sb\t$v0, 0($s0)\n sh\t$a3, 146($s0)\n sh\t$a2, 132($s0)\n jal\tatan2Fixed\n sh\t$a2, 134($s0)\n sll\t$a0, $v0, 0x10\n sra\t$a0, $a0, 0x10\n addiu\t$a0, $a0, 4096\n andi\t$a0, $a0, 0x1fff\n jal\tapproximateCos\n sw\t$a0, 156($s0)\n sll\t$v1, $v0, 0x2\n bnez\t$v1, .Lb8\n sra\t$v1, $v1, 0x8\n lh\t$a0, 158($s0)\n jal\tapproximateSin\n nop\n lw\t$v1, 36($s0)\n sll\t$v0, $v0, 0x2\n sra\t$v0, $v0, 0x8\n sll\t$v1, $v1, 0x8\n div\t$zero, $v1, $v0\n bnez\t$v0, .L84\n nop\n break\t0x7\n.L84:\n li\t$at, -1\n bne\t$v0, $at, .L9c\n lui\t$at, 0x8000\n bne\t$v1, $at, .L9c\n nop\n break\t0x6\n.L9c:\n mflo\t$v1\n bltzl\t$v1, .Lb0\n negu\t$v1, $v1\n.Lb0:\n j\t.L100\n sw\t$v1, 152($s0)\n.Lb8:\n lw\t$v0, 44($s0)\n sll\t$v0, $v0, 0x8\n div\t$zero, $v0, $v1\n bnez\t$v1, .Ld0\n nop\n break\t0x7\n.Ld0:\n li\t$at, -1\n bne\t$v1, $at, .Le8\n lui\t$at, 0x8000\n bne\t$v0, $at, .Le8\n nop\n break\t0x6\n.Le8:\n mflo\t$v0\n bltzl\t$v0, .Lfc\n negu\t$v0, $v0\n.Lfc:\n sw\t$v0, 152($s0)\n.L100:\n lw\t$v0, 148($s0)\n blez\t$v0, .L118\n nop\n lw\t$v0, 156($s0)\n j\t.L128\n addiu\t$v0, $v0, 2048\n.L118:\n bgez\t$v0, .L130\n nop\n lw\t$v0, 156($s0)\n addiu\t$v0, $v0, -2048\n.L128:\n andi\t$v0, $v0, 0x1fff\n sh\t$v0, 122($s0)\n.L130:\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7620_1E46D0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc","sym":"func_800B7760_1E4810","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7760_1E4810\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n blezl\t$a2, .L54\n sw\t$a1, 84($a0)\n lw\t$v0, 84($a0)\n subu\t$v0, $a1, $v0\n div\t$zero, $v0, $a2\n bnez\t$a2, .L28\n nop\n break\t0x7\n.L28:\n li\t$at, -1\n bne\t$a2, $at, .L40\n lui\t$at, 0x8000\n bne\t$v0, $at, .L40\n nop\n break\t0x6\n.L40:\n mflo\t$v0\n sw\t$a1, 96($a0)\n nop\n j\t.L5c\n sw\t$v0, 108($a0)\n.L54:\n sw\t$a1, 96($a0)\n sw\t$zero, 108($a0)\n.L5c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7760_1E4810 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc","sym":"func_800B93F0_1E64A0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B93F0_1E64A0\n beqzl\t$a0, .L8\n li\t$a0, 1\n.L8:\n lui\t$v0, 0x400\n div\t$zero, $v0, $a0\n bnez\t$a0, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a0, $at, .L34\n lui\t$at, 0x8000\n bne\t$v0, $at, .L34\n nop\n break\t0x6\n.L34:\n mflo\t$a0\n slti\t$v0, $a0, 16384\n nop\n beqzl\t$v0, .L48\n li\t$a0, 16384\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B93F0_1E64A0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc","sym":"func_800B9C20_1E6CD0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call"],"loc":5,"refSource":"void func_800B9C20_1E6CD0(cutsceneSys2Wait_exec_asset *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B9C20_1E6CD0' — lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tlw\ta0,160(s0) */\n/* 18:\tlw\ta0,8(s0) */\n/* 1c:\tjal\t0 */\n/* 20:\tsw\tv0,160(s0) */\n/* 24:\tlw\ta0,12(s0) */\n/* 28:\tjal\t0 */\n/* 2c:\tsw\tv0,8(s0) */\n/* 30:\tsw\tv0,12(s0) */\n/* 34:\tlw\tra,20(sp) */\n/* 38:\tlw\ts0,16(sp) */\n/* 3c:\tjr\tra */\n/* 40:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800B9C20_1E6CD0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 freeNodeMemory(s32); /* extern */\n\nvoid func_800B9C20_1E6CD0(void *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3410: request for member `unkA0' in something not a structure or union","/c.i:3411: request for member `unk8' in something not a structure or union","/c.i:3412: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B9C20_1E6CD0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n jal\tfreeNodeMemory\n lw\t$a0, 160($s0)\n lw\t$a0, 8($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 160($s0)\n lw\t$a0, 12($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 8($s0)\n sw\t$v0, 12($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B9C20_1E6CD0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:GenericTriggerInit:gcc2.7.2kmc","sym":"GenericTriggerInit","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","global","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GenericTriggerInit\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n lbu\t$v1, 0($a0)\n li\t$v0, -104\n sb\t$zero, 1($a0)\n sh\t$zero, 4($a0)\n sh\t$v0, 6($a0)\n sh\t$zero, 8($a0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_8008D714_8E314)\n addiu\t$v1, $v1, %lo(D_8008D714_8E314)\n addu\t$v0, $v0, $v1\n sw\t$v0, 12($a0)\n lui\t$a0, %hi(GenericTriggerCheck)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(GenericTriggerCheck)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GenericTriggerInit(EventTrigger *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GenericTriggerInit # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc","sym":"getTableEntryByU16Index","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","field","pointer","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel getTableEntryByU16Index\n lw\t$v1, 4($a0)\n addiu\t$a3, $a0, 8\n andi\t$a1, $a1, 0xffff\n sll\t$a1, $a1, 0x4\n sll\t$v1, $v1, 0x4\n addu\t$v1, $a3, $v1\n addu\t$a3, $a3, $a1\n lw\t$v0, 0($a3)\n addu\t$a0, $a0, $v0\n sw\t$a0, 0($a2)\n lhu\t$v0, 4($a3)\n sll\t$v0, $v0, 0x5\n addu\t$v1, $v1, $v0\n sw\t$v1, 4($a2)\n lhu\t$v0, 6($a3)\n sh\t$v0, 8($a2)\n lhu\t$v0, 8($a3)\n jr\t$ra\n sh\t$v0, 10($a2)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function getTableEntryByU16Index # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc","sym":"initSteppedMatrixController","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","memory","global","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel initSteppedMatrixController\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n addiu\t$a0, $s0, 4\n lui\t$a1, %hi(identityMatrix)\n addiu\t$a1, $a1, %lo(identityMatrix)\n sw\t$ra, 20($sp)\n jal\tmemcpy\n li\t$a2, 32\n lui\t$a0, %hi(cleanupSteppedMatrixController)\n addiu\t$a0, $a0, %lo(cleanupSteppedMatrixController)\n sh\t$zero, 36($s0)\n jal\tsetCleanupCallback\n sh\t$zero, 40($s0)\n lui\t$a0, %hi(updateSteppedMatrixController)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(updateSteppedMatrixController)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid initSteppedMatrixController(SteppedMatrixState *state);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function initSteppedMatrixController # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc","sym":"loadAssetGroupResources","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","loop","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadAssetGroupResources\n addiu\t$sp, $sp, -48\n sw\t$s3, 36($sp)\n move\t$s3, $a0\n sw\t$ra, 40($sp)\n sw\t$s2, 32($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v1, 196($s3)\n sll\t$v0, $v1, 0x1\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(assetGroupTable)\n addiu\t$v1, $v1, %lo(assetGroupTable)\n addu\t$s2, $v0, $v1\n lw\t$s0, 0($s2)\n lui\t$a0, %hi(freeAssetGroupResources)\n addiu\t$a0, $a0, %lo(freeAssetGroupResources)\n jal\tsetCleanupCallback\n move\t$s1, $zero\n sw\t$zero, 16($s3)\n sw\t$zero, 12($s3)\n lbu\t$a0, 8($s2)\n jal\tallocateNodeMemory\n sll\t$a0, $a0, 0x2\n sw\t$v0, 4($s3)\n lbu\t$v0, 8($s2)\n blez\t$v0, .La8\n nop\n.L70:\n lw\t$a0, 0($s0)\n lw\t$a1, 4($s0)\n lw\t$a2, 8($s0)\n jal\tloadCompressedData\n addiu\t$s0, $s0, 12\n lw\t$v1, 4($s3)\n sll\t$a0, $s1, 0x2\n addu\t$a0, $a0, $v1\n sw\t$v0, 0($a0)\n lbu\t$v0, 8($s2)\n addiu\t$s1, $s1, 1\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L70\n nop\n.La8:\n lui\t$a0, %hi(func_80003184_3D84)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80003184_3D84)\n lw\t$ra, 40($sp)\n lw\t$s3, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 48\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid loadAssetGroupResources(AssetGroupTaskData *taskData);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadAssetGroupResources # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:agbcc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 absdiff(u32 a0, u32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r2 = arg0 - arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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":"signed","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, s32 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 v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = (u32)(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 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":107,"maxScore":115,"compileErrors":null,"breakdown":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23},"quality":{"score":100,"lines":31,"gotos":0,"casts":1,"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":107,"maxScore":115,"ratio":0.9304347826086956,"kinds":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n return (s32)((a0 + a1 >> 31) + (a0 + a1)) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r3;\n\n temp_r3 = arg0 + arg1;\n return (s32) ((temp_r3 >> 0x1FU) + temp_r3) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i= 0; v0 = v0 + 1) {\n v1 = v1 + 1;\n }\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":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r3;\n\n var_r2 = arg0;\n var_r3 = 0;\nloop_2:\n if ((var_r3 < arg1) && ((s32) *var_r2 >= 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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if ((u32)*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(u32 *arg0, s32 arg1) {\n s32 var_ctr;\n s32 var_r5;\n u32 *var_r3;\n u32 temp_r4;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r4 = *var_r3;\n if ((temp_r4 >> 0x1FU) == 0) {\n var_r5 += temp_r4;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countdown(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if ((u32)a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = (u32)a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n","score":24,"maxScore":27,"compileErrors":null,"breakdown":{"insert":12,"delete":1,"replace":4,"opMismatch":4,"argMismatch":3},"quality":{"score":100,"lines":41,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_ctr_2;\n s32 var_r3;\n s32 var_r4;\n u32 temp_r0;\n u32 var_ctr;\n\n var_r3 = arg0;\n var_r4 = 0;\n if (var_r3 > 0) {\n temp_r0 = (u32) var_r3 >> 3U;\n var_ctr = temp_r0;\n if (temp_r0 != 0) {\n do {\n var_r4 += 8;\n var_ctr -= 1;\n } while (var_ctr != 0);\n var_r3 &= 7;\n if (var_r3 != 0) {\n goto block_4;\n }\n } else {\nblock_4:\n var_ctr_2 = var_r3;\n do {\n var_r4 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r4;\n}\n","score":6,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0},"quality":{"score":88,"lines":31,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":16,"ratio":0.375,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["method"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = (s32)a0 >> 1;\n } else {\n v0 = (s32)(a0 + 1) >> 1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(s32 arg0) {\n return arg0 / 2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n return (s32)((a0 >> 31) + a0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1FU) + arg0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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/defsite","outcome":"match","source":"s32 fcmp(void) {\n s32 v0;\n v0 = 0;\n if (__gtsf2() > 0) v0 = 1;\n return v0;\n}\n","score":0,"maxScore":10,"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":"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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":"signed","outcome":"nonmatch","source":"s32 fib(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 t0;\n s32 t1;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = 1;\n v2 = 0;\n v3 = (u32)(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 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":122,"maxScore":127,"compileErrors":null,"breakdown":{"insert":94,"delete":4,"replace":3,"opMismatch":5,"argMismatch":16},"quality":{"score":100,"lines":37,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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/defsite","outcome":"match","source":"s32 iszero(u32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 == 0) v0 = 1;\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":6,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a a0) {\n return 1;\n } else {\n v0 = 0;\n return v0;\n }\n } else {\n return 1;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":13,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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/flip-branch","outcome":"nonmatch","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n s32 v1;\n if (a0 < a2) {\n return 1;\n } else {\n if (a2 != a0 || a1 >= a3) {\n v1 = 0;\n return v1;\n } else {\n return 1;\n }\n }\n}\n","score":10,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":6,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","compare","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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/defsite","outcome":"match","source":"s32 lor(u32 a0, u32 a1) {\n s32 v0;\n v0 = 0;\n if (a0 != 0 || a1 != 0) v0 = 1;\n return v0;\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}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 && a1 == 0) {\n return 0;\n } else {\n return 1;\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"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 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":4,"maxScore":9,"ratio":0.4444444444444444,"kinds":{"insert":2,"delete":1,"replace":0,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","load","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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 v0 = 0;\n for (v1 = (u32)(a2 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n 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":79,"maxScore":88,"compileErrors":null,"breakdown":{"insert":45,"delete":4,"replace":3,"opMismatch":4,"argMismatch":23},"quality":{"score":80,"lines":37,"gotos":0,"casts":19,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r8;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *temp_r7;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r0_2;\n\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r6 = arg2 - 8;\n if (arg2 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg1[var_r8];\n temp_r7 = &arg0[var_r8];\n temp_r0 = temp_r6_2->unk0;\n var_r8 += 8;\n temp_r7->unk0 = temp_r0;\n temp_r7->unk1 = (u8) temp_r6_2->unk1;\n temp_r7->unk2 = (u8) temp_r6_2->unk2;\n temp_r7->unk3 = (u8) temp_r6_2->unk3;\n temp_r7->unk4 = (u8) temp_r6_2->unk4;\n temp_r7->unk5 = (u8) temp_r6_2->unk5;\n temp_r7->unk6 = (u8) temp_r6_2->unk6;\n temp_r7->unk7 = (u8) temp_r6_2->unk7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = &arg1[var_r8];\n var_r3 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r0_2 = *var_r4;\n var_r4 += 1;\n *var_r3 = temp_r0_2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":9,"quality":{"score":88,"lines":48,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":{"decompiler":"asmlift","score":79,"maxScore":88,"ratio":0.8977272727272727,"kinds":{"insert":45,"delete":4,"replace":3,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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":"asmlift","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 v0 = 0;\n for (v1 = (u32)(a1 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n 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":71,"maxScore":78,"compileErrors":null,"breakdown":{"insert":47,"delete":4,"replace":3,"opMismatch":4,"argMismatch":13},"quality":{"score":84,"lines":34,"gotos":0,"casts":10,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r7;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *var_r3;\n\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r6 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg0[var_r7];\n var_r7 += 8;\n temp_r6_2->unk0 = arg2;\n temp_r6_2->unk1 = arg2;\n temp_r6_2->unk2 = arg2;\n temp_r6_2->unk3 = arg2;\n temp_r6_2->unk4 = arg2;\n temp_r6_2->unk5 = arg2;\n temp_r6_2->unk6 = arg2;\n temp_r6_2->unk7 = arg2;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = &arg0[var_r7];\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n *var_r3 = arg2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":8,"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":{"decompiler":"asmlift","score":71,"maxScore":78,"ratio":0.9102564102564102,"kinds":{"insert":47,"delete":4,"replace":3,"opMismatch":4,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 || (a0 & 15) == 0) {\n v0 = a0 & 15;\n } else {\n v0 = (a0 & 15) + -16;\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":9,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = (u32)(a0 + -8 + 7) >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n 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":139,"maxScore":148,"compileErrors":null,"breakdown":{"insert":86,"delete":7,"replace":5,"opMismatch":5,"argMismatch":36},"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_r0;\n s32 temp_r12;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r5;\n s32 temp_r6;\n s32 temp_r7;\n s32 temp_r8;\n s32 var_ctr_2;\n s32 var_r10;\n s32 var_r11;\n s32 var_r12;\n s32 var_r30;\n s32 var_r31;\n s32 var_r4;\n u32 var_ctr;\n\n var_r12 = 0;\n var_r11 = 0;\n var_r31 = 0;\nloop_8:\n if (var_r31 < arg0) {\n var_r30 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_r10 = 0;\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r7 = var_r30 + 3;\n temp_r6 = var_r30 + 4;\n temp_r5 = var_r30 + 5;\n temp_r4_2 = var_r30 + 6;\n temp_r0 = var_r30 + 7;\n temp_r12 = var_r12 + var_r10 + (var_r31 * (var_r30 + 1));\n temp_r8 = var_r31 * (var_r30 + 2);\n var_r10 += var_r11;\n var_r30 += 8;\n var_r12 = temp_r12 + temp_r8 + (var_r31 * temp_r7) + (var_r31 * temp_r6) + (var_r31 * temp_r5) + (var_r31 * temp_r4_2) + (var_r31 * temp_r0);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = var_r30 * var_r31;\n var_ctr_2 = arg0 - var_r30;\n if (var_r30 < arg0) {\n do {\n var_r12 += var_r4;\n var_r4 += var_r31;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n var_r11 += 8;\n var_r31 += 1;\n goto loop_8;\n }\n return var_r12;\n}\n","score":63,"maxScore":74,"compileErrors":null,"breakdown":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34},"quality":{"score":88,"lines":60,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":74,"ratio":0.8513513513513513,"kinds":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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/defsite","outcome":"match","source":"s32 notb(u32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 == 0) v0 = 1;\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":6,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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":"signed","outcome":"nonmatch","source":"s32 powi(s32 a0, s32 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 v0 = 1;\n v1 = 0;\n for (v2 = (u32)(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 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":81,"maxScore":87,"compileErrors":null,"breakdown":{"insert":57,"delete":4,"replace":3,"opMismatch":5,"argMismatch":12},"quality":{"score":100,"lines":23,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n return arg0 >> 0x1F;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":8,"ratio":0.75,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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/defsite","outcome":"match","source":"s32 signum(s32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 > 0) v0 = 1;\n return v0 - ((u32)a0 >> 31);\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":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 > 0) {\n var_r1 = 1;\n }\n return var_r1 - ((u32) arg0 >> 0x1F);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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","candidateLabel":"unsigned","outcome":"match","source":"s32 strcmp1(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a0;\n for (v1 = a1; *v0 != 0 && *v0 == *v1; v1 = v1 + 1) {\n v0 = v0 + 1;\n }\n return *v0 - *v1;\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":"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","pointer","compare","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 strcmp1(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a0;\n for (v1 = a1; (s8)*v0 != 0 && (s8)*v0 == (s8)*v1; v1 = v1 + 1) {\n v0 = v0 + 1;\n }\n return (s8)*v0 - (s8)*v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":94,"lines":9,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"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":"asmlift","score":8,"maxScore":16,"ratio":0.5,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":6}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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":"signed","outcome":"nonmatch","source":"s32 structarr(s32 * a0, s32 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 v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = (u32)(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 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":107,"maxScore":115,"compileErrors":null,"breakdown":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23},"quality":{"score":100,"lines":31,"gotos":0,"casts":1,"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":107,"maxScore":115,"ratio":0.9304347826086956,"kinds":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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":"signed","outcome":"nonmatch","source":"s32 sumto(s32 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 v0 = 0;\n v1 = 0;\n for (v2 = (u32)(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 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":97,"maxScore":105,"compileErrors":null,"breakdown":{"insert":67,"delete":4,"replace":3,"opMismatch":5,"argMismatch":18},"quality":{"score":100,"lines":26,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:ubyte:agbcc","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[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\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ubyte # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:gcc2.7.2kmc","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\taddu\ta0,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8850789e15b071c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00862021 03e00008 90820000 ...... !........\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":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":4,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":4,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":5,"ratio":0.8,"kinds":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n sw\t$a1, 0($a0)\n addu\t$a0, $a0, $a2\n jr\t$ra\n lbu\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 ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\taddu\ta0,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(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-8850789e15b071c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00862021 03e00008 90820000 ...... !........\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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:ido7.1","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\taddu\tt6,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(t6)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00867021 03e00008 91c20000 ......p!........\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 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 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 65662d38 38353037 38396531 35623037 ef-8850789e15b07\n 0130 3163382f 7265662e 63007562 79746500 1c8/ref.c.ubyte.\n 0140 75627974 65000000 00000000 00000001 ubyte...........\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 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n sw\t$a1, 0($a0)\n addu\t$t6, $a0, $a2\n jr\t$ra\n lbu\t$v0, 0($t6)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\taddu\tt6,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(t6)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > 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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00867021 03e00008 91c20000 ......p!........\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 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 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 65662d38 38353037 38396531 35623037 ef-8850789e15b07\n 0130 3163382f 7265662e 63007562 79746500 1c8/ref.c.ubyte.\n 0140 75627974 65000000 00000000 00000001 ubyte...........\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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:mwcc_242_81","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tlbzx 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 ubyte\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ubyte\n\n\nContents of section .text:\n 0000 90830000 7c6328ae 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":"nonmatch","source":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n stw r4,0(r3)\n lbzx 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 ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlbzx 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 ubyte\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ubyte\n\n\nContents of section .text:\n 0000 90830000 7c6328ae 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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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","div-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","unsigned","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:uhalf:agbcc","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[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\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — 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\tuhalf */\n/* \t.type\t uhalf,function */\n/* \t.thumb_func */\n/* uhalf: */\n/* \tstr\tr1, [r0] */\n/* \tldrh\tr1, [r0] */\n/* \tldrh\tr0, [r0, #0x2] */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr0, r1, #0 */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t uhalf,.Lfe1-uhalf */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk0' in something not a structure or union","/cand.c.pp.c:4: warning: dereferencing `void *' pointer","/cand.c.pp.c:4: request for member `unk0' in something not a structure or union","/cand.c.pp.c:4: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name uhalf # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:gcc2.7.2kmc","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tlhu\tv1,0(a0)\n 8:\tlhu\tv0,2(a0)\n c:\tjr\tra\n 10:\taddu\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-33a95dfb4711bdfb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 94830000 94820002 03e00008 ................\n 0010 00621021 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 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,0(a0) */\n/* 4:\tlhu\tv1,0(a0) */\n/* 8:\tlhu\tv0,2(a0) */\n/* c:\tjr\tra */\n/* 10:\taddu\tv0,v1,v0 */\n/* \t... */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk0' in something not a structure or union","/cand.c:4: request for member `unk0' in something not a structure or union","/cand.c:4: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n sw\t$a1, 0($a0)\n lhu\t$v1, 0($a0)\n lhu\t$v0, 2($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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhu\tv1,0(a0)\n 8:\tlhu\tv0,2(a0)\n c:\tjr\tra\n 10:\taddu\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-33a95dfb4711bdfb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 94830000 94820002 03e00008 ................\n 0010 00621021 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# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:ido7.1","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tlhu\tt7,0(a0)\n 8:\tlhu\tt6,2(a0)\n c:\tjr\tra\n 10:\taddu\tv0,t6,t7\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 uhalf\n\n\nContents of section .text:\n 0000 ac850000 948f0000 948e0002 03e00008 ................\n 0010 01cf1021 00000000 00000000 00000000 ...!............\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 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 00000003 ................\n 0090 00000003 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 65662d33 33613935 64666234 37313162 ef-33a95dfb4711b\n 0130 6466622f 7265662e 63007568 616c6600 dfb/ref.c.uhalf.\n 0140 7568616c 66000000 00000000 00000001 uhalf...........\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":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,0(a0) */\n/* 4:\tlhu\tt7,0(a0) */\n/* 8:\tlhu\tt6,2(a0) */\n/* c:\tjr\tra */\n/* 10:\taddu\tv0,t6,t7 */\n/* \t... */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return arg0->unk2 + (u16) arg0->unk0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 4: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n sw\t$a1, 0($a0)\n lhu\t$t7, 0($a0)\n lhu\t$t6, 2($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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhu\tt7,0(a0)\n 8:\tlhu\tt6,2(a0)\n c:\tjr\tra\n 10:\taddu\tv0,t6,t7\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark 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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 948f0000 948e0002 03e00008 ................\n 0010 01cf1021 00000000 00000000 00000000 ...!............\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 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 00000003 ................\n 0090 00000003 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 65662d33 33613935 64666234 37313162 ef-33a95dfb4711b\n 0130 6466622f 7265662e 63007568 616c6600 dfb/ref.c.uhalf.\n 0140 7568616c 66000000 00000000 00000001 uhalf...........\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 uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:mwcc_242_81","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tlhz r4,0(r3)\n 8:\tlhz r0,2(r3)\n c:\tadd r3,r4,r0\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 uhalf\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 uhalf\n\n\nContents of section .text:\n 0000 90830000 a0830000 a0030002 7c640214 ............|d..\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":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstw r4,0(r3) */\n/* 4:\tlhz r4,0(r3) */\n/* 8:\tlhz r0,2(r3) */\n/* c:\tadd r3,r4,r0 */\n/* 10:\tblr */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":13,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n stw r4,0(r3)\n lhz r4,0(r3)\n lhz r0,2(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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhz r4,0(r3)\n 8:\tlhz r0,2(r3)\n c:\tadd r3,r4,r0\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 uhalf\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 uhalf\n\n\nContents of section .text:\n 0000 90830000 a0830000 a0030002 7c640214 ............|d..\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 uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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","mod-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","unsigned","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:upun:agbcc","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\n","ctx":"u32 upun(float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 upun(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":"declined","source":"u32 upun(f32 arg0) {\n return (bitwise u32) arg0;\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 bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\nASM_INPUT\n\n# The exact 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 upun(float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name upun # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:gcc2.7.2kmc","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmfc1\tv0,$f12\n 4:\tjr\tra\n 8:\tnop\n c:\tnop\n","ctx":"u32 upun(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9f1339ba3a5a98ca/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 upun\n\n\nContents of section .text:\n 0000 44026000 03e00008 00000000 00000000 D.`.............\nContents of section .reginfo:\n 0000 80000004 00000000 00001000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 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":"s32 upun(void) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'mfc1'\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'mfc1'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 arg0) {\n return (bitwise u32) arg0;\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 bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n mfc1\t$v0, $f12\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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmfc1\tv0,$f12\n 4:\tjr\tra\n 8:\tnop\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-9f1339ba3a5a98ca/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 upun\n\n\nContents of section .text:\n 0000 44026000 03e00008 00000000 00000000 D.`.............\nContents of section .reginfo:\n 0000 80000004 00000000 00001000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:ido7.1","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tswc1\t$f12,4(sp)\n 8:\tlw\tv0,4(sp)\n c:\tjr\tra\n 10:\taddiu\tsp,sp,8\n\t...\n","ctx":"u32 upun(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 upun\n\n\nContents of section .text:\n 0000 27bdfff8 e7ac0004 8fa20004 03e00008 '...............\n 0010 27bd0008 00000000 00000000 00000000 '...............\nContents of section .options:\n 0000 01200000 00000000 a0000004 00000000 . ..............\n 0010 00001000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000004 00000000 00001000 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 00000008 001d001f 00000003 ................\n 0090 00000003 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 66313333 39626133 61356139 ef-9f1339ba3a5a9\n 0130 3863612f 7265662e 63007570 756e0000 8ca/ref.c.upun..\n 0140 7570756e 00000000 00000000 00000001 upun............\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 'upun' — lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque */\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:\tswc1\t$f12,4(sp) */\n/* 8:\tlw\tv0,4(sp) */\n/* c:\tjr\tra */\n/* 10:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid upun(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":14,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 arg0) {\n f32 sp4;\n\n sp4 = arg0;\n return (bitwise u32) sp4;\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":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n addiu\t$sp, $sp, -8\n swc1\t$f12, 4($sp)\n lw\t$v0, 4($sp)\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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > 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:\tswc1\t$f12,4(sp)\n 8:\tlw\tv0,4(sp)\n c:\tjr\tra\n 10:\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 d .text\t00000020 .text\n00000000 g F .text\t00000014 upun\n\n\nContents of section .text:\n 0000 27bdfff8 e7ac0004 8fa20004 03e00008 '...............\n 0010 27bd0008 00000000 00000000 00000000 '...............\nContents of section .options:\n 0000 01200000 00000000 a0000004 00000000 . ..............\n 0010 00001000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000004 00000000 00001000 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 00000008 001d001f 00000003 ................\n 0090 00000003 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 66313333 39626133 61356139 ef-9f1339ba3a5a9\n 0130 3863612f 7265662e 63007570 756e0000 8ca/ref.c.upun..\n 0140 7570756e 00000000 00000000 00000001 upun............\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 upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:mwcc_242_81","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tstfs f1,8(r1)\n 8:\tlwz r3,8(r1)\n c:\taddi r1,r1,16\n 10:\tblr\n","ctx":"u32 upun(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\t00000014 upun\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 upun\n\n\nContents of section .text:\n 0000 9421fff0 d0210008 80610008 38210010 .!...!...a..8!..\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":"declined","source":"/* asmlift could not decompile 'upun' — lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque */\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:\tstfs f1,8(r1) */\n/* 8:\tlwz r3,8(r1) */\n/* c:\taddi r1,r1,16 */\n/* 10:\tblr */\nvoid upun(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":13,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 farg0) {\n f32 sp8;\n\n sp8 = farg0;\n return (bitwise u32) sp8;\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":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n stwu r1,-16(r1)\n stfs f1,8(r1)\n lwz r3,8(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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tstfs f1,8(r1)\n 8:\tlwz r3,8(r1)\n c:\taddi r1,r1,16\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 upun\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 upun\n\n\nContents of section .text:\n 0000 9421fff0 d0210008 80610008 38210010 .!...!...a..8!..\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 upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:agbcc","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=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\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\n return;\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":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_r1;\n\n temp_r1 = (arg1 * 4) + arg0;\n *temp_r1 = arg2;\n *temp_r1 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `union E' 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:4: arithmetic on pointer to an incomplete type","/cand.c.pp.c:4: warning: assignment from incompatible pointer type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:gcc2.7.2kmc","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","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:\tsw\ta2,0(a1)\n c:\tjr\tra\n 10:\tsh\tzero,0(a1)\n\t...\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c4770bb02162926/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ustore\n\n\nContents of section .text:\n 0000 00052880 00a42821 aca60000 03e00008 ..(...(!........\n 0010 a4a00000 00000000 00000000 00000000 ................\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":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\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":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_a1;\n\n temp_a1 = (arg1 * 4) + arg0;\n *temp_a1 = arg2;\n *temp_a1 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:5: arithmetic on pointer to an incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n sw\t$a2, 0($a1)\n jr\t$ra\n sh\t$zero, 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'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tsw\ta2,0(a1)\n c:\tjr\tra\n 10:\tsh\tzero,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-0c4770bb02162926/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ustore\n\n\nContents of section .text:\n 0000 00052880 00a42821 aca60000 03e00008 ..(...(!........\n 0010 a4a00000 00000000 00000000 00000000 ................\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 \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:ido7.1","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tv0,a0,t6\n 8:\tsw\ta2,0(v0)\n c:\tjr\tra\n 10:\tsh\tzero,0(v0)\n\t...\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 ustore\n\n\nContents of section .text:\n 0000 00057080 008e1021 ac460000 03e00008 ..p....!.F......\n 0010 a4400000 00000000 00000000 00000000 .@..............\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 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 00000003 ................\n 0090 00000003 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 63343737 30626230 32313632 ef-0c4770bb02162\n 0130 3932362f 7265662e 63007573 746f7265 926/ref.c.ustore\n 0140 00000000 7573746f 72650000 00000000 ....ustore......\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":"nonmatch","source":"void ustore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n *(u16 *)(a0 + (a1 << 2)) = 0;\n return;\n}\n","score":5,"maxScore":7,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":96,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_v0;\n\n temp_v0 = arg0 + (arg1 * 4);\n *temp_v0 = arg2;\n *temp_v0 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 5: Unacceptable operand of '+'."]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":7,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n sll\t$t6, $a1, 0x2\n addu\t$v0, $a0, $t6\n sw\t$a2, 0($v0)\n jr\t$ra\n sh\t$zero, 0($v0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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\tv0,a0,t6\n 8:\tsw\ta2,0(v0)\n c:\tjr\tra\n 10:\tsh\tzero,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\t00000020 .text\n00000000 g F .text\t00000014 ustore\n\n\nContents of section .text:\n 0000 00057080 008e1021 ac460000 03e00008 ..p....!.F......\n 0010 a4400000 00000000 00000000 00000000 .@..............\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 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 00000003 ................\n 0090 00000003 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 63343737 30626230 32313632 ef-0c4770bb02162\n 0130 3932362f 7265662e 63007573 746f7265 926/ref.c.ustore\n 0140 00000000 7573746f 72650000 00000000 ....ustore......\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:mwcc_242_81","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r4,r4,2\n 4:\tli r0,0\n 8:\tstwx r5,r3,r4\n c:\tsthx r0,r3,r4\n 10:\tblr\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"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 ustore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ustore\n\n\nContents of section .text:\n 0000 5484103a 38000000 7ca3212e 7c03232e T..:8...|.!.|.#.\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":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\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":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 temp_r4;\n\n temp_r4 = arg1 * 4;\n *(arg0 + temp_r4) = arg2;\n *(arg0 + temp_r4) = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# illegal type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n slwi r4,r4,2\n li r0,0\n stwx r5,r3,r4\n sthx r0,r3,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'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 r4,r4,2\n 4:\tli r0,0\n 8:\tstwx r5,r3,r4\n c:\tsthx r0,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 ustore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ustore\n\n\nContents of section .text:\n 0000 5484103a 38000000 7ca3212e 7c03232e T..:8...|.!.|.#.\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 \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:agbcc","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.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\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 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\tutag */\n/* \t.type\t utag,function */\n/* \t.thumb_func */\n/* utag: */\n/* \tldr\tr1, [r0] */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldrb\tr0, [r0, #0x4] */\n/* \tb\t.L9 */\n/* .L4: */\n/* \tldr\tr0, [r0, #0x4] */\n/* \tb\t.L9 */\n/* .L5: */\n/* \tldrh\tr0, [r0, #0x4] */\n/* .L9: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t utag,.Lfe1-utag */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_r1;\n\n temp_r1 = arg0->unk0;\n switch (temp_r1) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:4: warning: dereferencing `void *' pointer","/cand.c.pp.c:4: request for member `unk0' in something not a structure or union","/cand.c.pp.c:7: warning: dereferencing `void *' pointer","/cand.c.pp.c:7: request for member `unk4' in something not a structure or union","/cand.c.pp.c:9: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name utag # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:gcc2.7.2kmc","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a0)\n 4:\tbeqz\tv1,1c \n 8:\tli\tv0,1\n c:\tbeq\tv1,v0,24 \n 10:\tnop\n 14:\tj\t2c \n 18:\tnop\n 1c:\tj\t30 \n 20:\tlw\tv0,4(a0)\n 24:\tj\t30 \n 28:\tlhu\tv0,4(a0)\n 2c:\tlbu\tv0,4(a0)\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-f8e70ed93edb6aa5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 utag\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n0000001c R_MIPS_26 .text\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c830000 10600005 24020001 10620005 .....`..$....b..\n 0010 00000000 0800000b 00000000 0800000c ................\n 0020 8c820004 0800000c 94820004 90820004 ................\n 0030 03e00008 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":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv1,0(a0) */\n/* 4:\tbeqz\tv1,1c */\n/* 8:\tli\tv0,1 */\n/* c:\tbeq\tv1,v0,24 */\n/* 10:\tnop */\n/* 14:\tj\t2c */\n/* 18:\tnop */\n/* 1c:\tj\t30 */\n/* 20:\tlw\tv0,4(a0) */\n/* 24:\tj\t30 */\n/* 28:\tlhu\tv0,4(a0) */\n/* 2c:\tlbu\tv0,4(a0) */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* \t... */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_v1;\n\n temp_v1 = arg0->unk0;\n switch (temp_v1) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:5: request for member `unk0' in something not a structure or union","/cand.c:8: request for member `unk4' in something not a structure or union","/cand.c:10: request for member `unk4' in something not a structure or union","/cand.c:12: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lw\t$v1, 0($a0)\n beqz\t$v1, .L1c\n li\t$v0, 1\n beq\t$v1, $v0, .L24\n nop\n j\t.L2c\n nop\n.L1c:\n j\t.L30\n lw\t$v0, 4($a0)\n.L24:\n j\t.L30\n lhu\t$v0, 4($a0)\n.L2c:\n lbu\t$v0, 4($a0)\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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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(a0)\n 4:\tbeqz\tv1,1c \n 8:\tli\tv0,1\n c:\tbeq\tv1,v0,24 \n 10:\tnop\n 14:\tj\t2c \n 18:\tnop\n 1c:\tj\t30 \n 20:\tlw\tv0,4(a0)\n 24:\tj\t30 \n 28:\tlhu\tv0,4(a0)\n 2c:\tlbu\tv0,4(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 df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8e70ed93edb6aa5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 utag\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n0000001c R_MIPS_26 .text\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c830000 10600005 24020001 10620005 .....`..$....b..\n 0010 00000000 0800000b 00000000 0800000c ................\n 0020 8c820004 0800000c 94820004 90820004 ................\n 0030 03e00008 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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:ido7.1","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tli\tat,1\n 8:\tbeqz\tv0,20 \n c:\tnop\n 10:\tbeq\tv0,at,28 \n 14:\tnop\n 18:\tb\t34 \n 1c:\tlbu\tv0,4(a0)\n 20:\tjr\tra\n 24:\tlw\tv0,4(a0)\n 28:\tjr\tra\n 2c:\tlhu\tv0,4(a0)\n 30:\tlbu\tv0,4(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c utag\n\n\nContents of section .text:\n 0000 8c820000 24010001 10400005 00000000 ....$....@......\n 0010 10410005 00000000 10000006 90820004 .A..............\n 0020 03e00008 8c820004 03e00008 94820004 ................\n 0030 90820004 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 0000000f 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 08050000 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 0000003c 20200001 00000001 .......< ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 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 38653730 65643933 65646236 ef-f8e70ed93edb6\n 0130 6161352f 7265662e 63007574 61670000 aa5/ref.c.utag..\n 0140 75746167 00000000 00000000 00000001 utag............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000f 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":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv0,0(a0) */\n/* 4:\tli\tat,1 */\n/* 8:\tbeqz\tv0,20 */\n/* c:\tnop */\n/* 10:\tbeq\tv0,at,28 */\n/* 14:\tnop */\n/* 18:\tb\t34 */\n/* 1c:\tlbu\tv0,4(a0) */\n/* 20:\tjr\tra */\n/* 24:\tlw\tv0,4(a0) */\n/* 28:\tjr\tra */\n/* 2c:\tlhu\tv0,4(a0) */\n/* 30:\tlbu\tv0,4(a0) */\n/* 34:\tjr\tra */\n/* 38:\tnop */\n/* 3c:\tnop */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_v0;\n\n temp_v0 = arg0->unk0;\n switch (temp_v0) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 8: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 10: Selector requires struct/union pointer as left hand side","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 `utag` — benchmark function synthetic:utag:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lw\t$v0, 0($a0)\n li\t$at, 1\n beqz\t$v0, .L20\n nop\n beq\t$v0, $at, .L28\n nop\n b\t.L34\n lbu\t$v0, 4($a0)\n.L20:\n jr\t$ra\n lw\t$v0, 4($a0)\n.L28:\n jr\t$ra\n lhu\t$v0, 4($a0)\n lbu\t$v0, 4($a0)\n.L34:\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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tli\tat,1\n 8:\tbeqz\tv0,20 \n c:\tnop\n 10:\tbeq\tv0,at,28 \n 14:\tnop\n 18:\tb\t34 \n 1c:\tlbu\tv0,4(a0)\n 20:\tjr\tra\n 24:\tlw\tv0,4(a0)\n 28:\tjr\tra\n 2c:\tlhu\tv0,4(a0)\n 30:\tlbu\tv0,4(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 d .text\t00000040 .text\n00000000 g F .text\t0000003c utag\n\n\nContents of section .text:\n 0000 8c820000 24010001 10400005 00000000 ....$....@......\n 0010 10410005 00000000 10000006 90820004 .A..............\n 0020 03e00008 8c820004 03e00008 94820004 ................\n 0030 90820004 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 0000000f 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 08050000 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 0000003c 20200001 00000001 .......< ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 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 38653730 65643933 65646236 ef-f8e70ed93edb6\n 0130 6161352f 7265662e 63007574 61670000 aa5/ref.c.utag..\n 0140 75746167 00000000 00000000 00000001 utag............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000f 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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:mwcc_242_81","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r0,0(r3)\n 4:\tcmpwi r0,1\n 8:\tbeq 24 \n c:\tbge 2c \n 10:\tcmpwi r0,0\n 14:\tbge 1c \n 18:\tb 2c \n 1c:\tlwz r3,4(r3)\n 20:\tblr\n 24:\tlhz r3,4(r3)\n 28:\tblr\n 2c:\tlbz r3,4(r3)\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 utag\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 utag\n\n\nContents of section .text:\n 0000 80030000 2c000001 4182001c 40800020 ....,...A...@.. \n 0010 2c000000 40800008 48000014 80630004 ,...@...H....c..\n 0020 4e800020 a0630004 4e800020 88630004 N.. .c..N.. .c..\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":"declined","source":"/* asmlift could not decompile 'utag' — lift: cannot lift 'utag': 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:\tlwz r0,0(r3) */\n/* 4:\tcmpwi r0,1 */\n/* 8:\tbeq 24 */\n/* c:\tbge 2c */\n/* 10:\tcmpwi r0,0 */\n/* 14:\tbge 1c */\n/* 18:\tb 2c */\n/* 1c:\tlwz r3,4(r3) */\n/* 20:\tblr */\n/* 24:\tlhz r3,4(r3) */\n/* 28:\tblr */\n/* 2c:\tlbz r3,4(r3) */\n/* 30:\tblr */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'utag': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":21,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'utag': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 utag(void *arg0) {\n s32 temp_r0;\n\n temp_r0 = arg0->unk0;\n switch (temp_r0) { /* irregular */\n case 0:\n return arg0->unk4;\n case 1:\n return (s32) (u16) arg0->unk4;\n default:\n return (s32) (u8) arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^^","# Error: ^^"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lwz r0,0(r3)\n cmpwi r0,1\n beq .L24\n bge .L2c\n cmpwi r0,0\n bge .L1c\n b .L2c\n.L1c:\n lwz r3,4(r3)\n blr\n.L24:\n lhz r3,4(r3)\n blr\n.L2c:\n lbz 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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 r0,0(r3)\n 4:\tcmpwi r0,1\n 8:\tbeq 24 \n c:\tbge 2c \n 10:\tcmpwi r0,0\n 14:\tbge 1c \n 18:\tb 2c \n 1c:\tlwz r3,4(r3)\n 20:\tblr\n 24:\tlhz r3,4(r3)\n 28:\tblr\n 2c:\tlbz r3,4(r3)\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 utag\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 utag\n\n\nContents of section .text:\n 0000 80030000 2c000001 4182001c 40800020 ....,...A...@.. \n 0010 2c000000 40800008 48000014 80630004 ,...@...H....c..\n 0020 4e800020 a0630004 4e800020 88630004 N.. .c..N.. .c..\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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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":["method"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 zextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 zextb\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}}]} \ No newline at end of file +{"meta":{"generatedAt":"2026-08-05T14:19:19.617Z","toolchains":["ido7.1","agbcc","gcc2.7.2","gcc2.7.2kmc","mwcc_242_81"],"counts":{"total":743,"synthetic":503,"real":240},"asmlift":{"commit":"92b4d4019ffc6e30c7f5accaa0740669631bdf74","dirty":false},"m2c":{"commit":"ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0"}},"results":[{"id":"af:_MtxF_to_Mtx:ido7.1","sym":"_MtxF_to_Mtx","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","array","cast","pointer","float","shift","bitwise"],"loc":71,"refSource":"Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest) {\n s32 fp;\n u16* intPart = (u16*)&dest->m[0][0];\n u16* fracPart = (u16*)&dest->m[2][0];\n\n fp = src->xx * 0x10000;\n intPart[0] = (fp >> 0x10);\n fracPart[0] = fp & 0xFFFF;\n\n fp = src->yx * 0x10000;\n intPart[1] = (fp >> 0x10);\n fracPart[1] = fp & 0xFFFF;\n\n fp = src->zx * 0x10000;\n intPart[2] = (fp >> 0x10);\n fracPart[2] = fp & 0xFFFF;\n\n fp = src->wx * 0x10000;\n intPart[3] = (fp >> 0x10);\n fracPart[3] = fp & 0xFFFF;\n\n fp = src->xy * 0x10000;\n intPart[4] = (fp >> 0x10);\n fracPart[4] = fp & 0xFFFF;\n\n fp = src->yy * 0x10000;\n intPart[5] = (fp >> 0x10);\n fracPart[5] = fp & 0xFFFF;\n\n // Ideally these three would use fracPart instead of intPart, but it's required to match.\n fp = src->zy * 0x10000;\n intPart[6] = (fp >> 0x10);\n intPart[22] = fp & 0xFFFF;\n\n fp = src->wy * 0x10000;\n intPart[7] = (fp >> 0x10);\n intPart[23] = fp & 0xFFFF;\n\n fp = src->xz * 0x10000;\n intPart[8] = (fp >> 0x10);\n intPart[24] = fp & 0xFFFF;\n\n fp = src->yz * 0x10000;\n intPart[9] = (fp >> 0x10);\n fracPart[9] = fp & 0xFFFF;\n\n fp = src->zz * 0x10000;\n intPart[10] = (fp >> 0x10);\n fracPart[10] = fp & 0xFFFF;\n\n fp = src->wz * 0x10000;\n intPart[11] = (fp >> 0x10);\n fracPart[11] = fp & 0xFFFF;\n\n fp = src->xw * 0x10000;\n intPart[12] = (fp >> 0x10);\n fracPart[12] = fp & 0xFFFF;\n\n fp = src->yw * 0x10000;\n intPart[13] = (fp >> 0x10);\n fracPart[13] = fp & 0xFFFF;\n\n fp = src->zw * 0x10000;\n intPart[14] = (fp >> 0x10);\n fracPart[14] = fp & 0xFFFF;\n\n fp = src->ww * 0x10000;\n intPart[15] = (fp >> 0x10);\n fracPart[15] = fp & 0xFFFF;\n return dest;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_matrix.c#L768-L838","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 <_MtxF_to_Mtx>:\n 0:\tlui\tat,0x4780\n 4:\tmtc1\tat,$f0\n 8:\tlwc1\t$f4,0(a0)\n c:\taddiu\tv1,a1,32\n 10:\tmove\tv0,a1\n 14:\tmul.s\t$f6,$f4,$f0\n 18:\ttrunc.w.s\t$f8,$f6\n 1c:\tmfc1\tt8,$f8\n 20:\tnop\n 24:\tsra\tt7,t8,0x10\n 28:\tsh\tt7,0(a1)\n 2c:\tsh\tt8,32(a1)\n 30:\tlwc1\t$f10,4(a0)\n 34:\tmul.s\t$f16,$f10,$f0\n 38:\ttrunc.w.s\t$f18,$f16\n 3c:\tmfc1\tt1,$f18\n 40:\tnop\n 44:\tsra\tt0,t1,0x10\n 48:\tsh\tt0,2(a1)\n 4c:\tsh\tt1,34(a1)\n 50:\tlwc1\t$f4,8(a0)\n 54:\tmul.s\t$f6,$f4,$f0\n 58:\ttrunc.w.s\t$f8,$f6\n 5c:\tmfc1\tt4,$f8\n 60:\tnop\n 64:\tsra\tt3,t4,0x10\n 68:\tsh\tt3,4(a1)\n 6c:\tsh\tt4,36(a1)\n 70:\tlwc1\t$f10,12(a0)\n 74:\tmul.s\t$f16,$f10,$f0\n 78:\ttrunc.w.s\t$f18,$f16\n 7c:\tmfc1\tt7,$f18\n 80:\tnop\n 84:\tsra\tt6,t7,0x10\n 88:\tsh\tt6,6(a1)\n 8c:\tsh\tt7,38(a1)\n 90:\tlwc1\t$f4,16(a0)\n 94:\tmul.s\t$f6,$f4,$f0\n 98:\ttrunc.w.s\t$f8,$f6\n 9c:\tmfc1\tt0,$f8\n a0:\tnop\n a4:\tsra\tt9,t0,0x10\n a8:\tsh\tt9,8(a1)\n ac:\tsh\tt0,40(a1)\n b0:\tlwc1\t$f10,20(a0)\n b4:\tmul.s\t$f16,$f10,$f0\n b8:\ttrunc.w.s\t$f18,$f16\n bc:\tmfc1\tt3,$f18\n c0:\tnop\n c4:\tsra\tt2,t3,0x10\n c8:\tsh\tt2,10(a1)\n cc:\tsh\tt3,42(a1)\n d0:\tlwc1\t$f4,24(a0)\n d4:\tmul.s\t$f6,$f4,$f0\n d8:\ttrunc.w.s\t$f8,$f6\n dc:\tmfc1\tt6,$f8\n e0:\tnop\n e4:\tsra\tt5,t6,0x10\n e8:\tsh\tt5,12(a1)\n ec:\tsh\tt6,44(a1)\n f0:\tlwc1\t$f10,28(a0)\n f4:\tmul.s\t$f16,$f10,$f0\n f8:\ttrunc.w.s\t$f18,$f16\n fc:\tmfc1\tt9,$f18\n 100:\tnop\n 104:\tsra\tt8,t9,0x10\n 108:\tsh\tt8,14(a1)\n 10c:\tsh\tt9,46(a1)\n 110:\tlwc1\t$f4,32(a0)\n 114:\tmul.s\t$f6,$f4,$f0\n 118:\ttrunc.w.s\t$f8,$f6\n 11c:\tmfc1\tt2,$f8\n 120:\tnop\n 124:\tsra\tt1,t2,0x10\n 128:\tsh\tt1,16(a1)\n 12c:\tsh\tt2,48(a1)\n 130:\tlwc1\t$f10,36(a0)\n 134:\tmul.s\t$f16,$f10,$f0\n 138:\ttrunc.w.s\t$f18,$f16\n 13c:\tmfc1\tt5,$f18\n 140:\tnop\n 144:\tsra\tt4,t5,0x10\n 148:\tsh\tt4,18(a1)\n 14c:\tsh\tt5,18(v1)\n 150:\tlwc1\t$f4,40(a0)\n 154:\tmul.s\t$f6,$f4,$f0\n 158:\ttrunc.w.s\t$f8,$f6\n 15c:\tmfc1\tt8,$f8\n 160:\tnop\n 164:\tsra\tt7,t8,0x10\n 168:\tsh\tt7,20(a1)\n 16c:\tsh\tt8,20(v1)\n 170:\tlwc1\t$f10,44(a0)\n 174:\tmul.s\t$f16,$f10,$f0\n 178:\ttrunc.w.s\t$f18,$f16\n 17c:\tmfc1\tt1,$f18\n 180:\tnop\n 184:\tsra\tt0,t1,0x10\n 188:\tsh\tt0,22(a1)\n 18c:\tsh\tt1,22(v1)\n 190:\tlwc1\t$f4,48(a0)\n 194:\tmul.s\t$f6,$f4,$f0\n 198:\ttrunc.w.s\t$f8,$f6\n 19c:\tmfc1\tt4,$f8\n 1a0:\tnop\n 1a4:\tsra\tt3,t4,0x10\n 1a8:\tsh\tt3,24(a1)\n 1ac:\tsh\tt4,24(v1)\n 1b0:\tlwc1\t$f10,52(a0)\n 1b4:\tmul.s\t$f16,$f10,$f0\n 1b8:\ttrunc.w.s\t$f18,$f16\n 1bc:\tmfc1\tt7,$f18\n 1c0:\tnop\n 1c4:\tsra\tt6,t7,0x10\n 1c8:\tsh\tt6,26(a1)\n 1cc:\tsh\tt7,26(v1)\n 1d0:\tlwc1\t$f4,56(a0)\n 1d4:\tmul.s\t$f6,$f4,$f0\n 1d8:\ttrunc.w.s\t$f8,$f6\n 1dc:\tmfc1\tt0,$f8\n 1e0:\tnop\n 1e4:\tsra\tt9,t0,0x10\n 1e8:\tsh\tt9,28(a1)\n 1ec:\tsh\tt0,28(v1)\n 1f0:\tlwc1\t$f10,60(a0)\n 1f4:\tmul.s\t$f16,$f10,$f0\n 1f8:\ttrunc.w.s\t$f18,$f16\n 1fc:\tmfc1\tt3,$f18\n 200:\tnop\n 204:\tsra\tt2,t3,0x10\n 208:\tsh\tt2,30(a1)\n 20c:\tjr\tra\n 210:\tsh\tt3,30(v1)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000220 .text\n00000000 g F .text\t00000214 _MtxF_to_Mtx\n\n\nContents of section .text:\n 0000 3c014780 44810000 c4840000 24a30020 <.G.D.......$.. \n 0010 00a01025 46002182 4600320d 44184000 ...%F.!.F.2.D.@.\n 0020 00000000 00187c03 a4af0000 a4b80020 ......|........ \n 0030 c48a0004 46005402 4600848d 44099000 ....F.T.F...D...\n 0040 00000000 00094403 a4a80002 a4a90022 ......D........\"\n 0050 c4840008 46002182 4600320d 440c4000 ....F.!.F.2.D.@.\n 0060 00000000 000c5c03 a4ab0004 a4ac0024 ......\\........$\n 0070 c48a000c 46005402 4600848d 440f9000 ....F.T.F...D...\n 0080 00000000 000f7403 a4ae0006 a4af0026 ......t........&\n 0090 c4840010 46002182 4600320d 44084000 ....F.!.F.2.D.@.\n 00a0 00000000 0008cc03 a4b90008 a4a80028 ...............(\n 00b0 c48a0014 46005402 4600848d 440b9000 ....F.T.F...D...\n 00c0 00000000 000b5403 a4aa000a a4ab002a ......T........*\n 00d0 c4840018 46002182 4600320d 440e4000 ....F.!.F.2.D.@.\n 00e0 00000000 000e6c03 a4ad000c a4ae002c ......l........,\n 00f0 c48a001c 46005402 4600848d 44199000 ....F.T.F...D...\n 0100 00000000 0019c403 a4b8000e a4b9002e ................\n 0110 c4840020 46002182 4600320d 440a4000 ... F.!.F.2.D.@.\n 0120 00000000 000a4c03 a4a90010 a4aa0030 ......L........0\n 0130 c48a0024 46005402 4600848d 440d9000 ...$F.T.F...D...\n 0140 00000000 000d6403 a4ac0012 a46d0012 ......d......m..\n 0150 c4840028 46002182 4600320d 44184000 ...(F.!.F.2.D.@.\n 0160 00000000 00187c03 a4af0014 a4780014 ......|......x..\n 0170 c48a002c 46005402 4600848d 44099000 ...,F.T.F...D...\n 0180 00000000 00094403 a4a80016 a4690016 ......D......i..\n 0190 c4840030 46002182 4600320d 440c4000 ...0F.!.F.2.D.@.\n 01a0 00000000 000c5c03 a4ab0018 a46c0018 ......\\......l..\n 01b0 c48a0034 46005402 4600848d 440f9000 ...4F.T.F...D...\n 01c0 00000000 000f7403 a4ae001a a46f001a ......t......o..\n 01d0 c4840038 46002182 4600320d 44084000 ...8F.!.F.2.D.@.\n 01e0 00000000 0008cc03 a4b9001c a468001c .............h..\n 01f0 c48a003c 46005402 4600848d 440b9000 .......\n 0010 000f07d1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff3e 00000000 000f07d1 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000085 0000003c 00000398 p..........<....\n 0010 00000005 0000051c 00000001 000003d4 ................\n 0020 00000004 00000408 00000000 00000000 ................\n 0030 00000011 00000438 00000038 0000047c .......8...8...|\n 0040 00000010 000004b4 00000001 000004c4 ................\n 0050 00000000 00000000 00000001 0000050c ................\n 0060 01408000 1d800013 82ffd012 10131210 .@..............\n 0070 13121013 12101312 10131210 13121013 ................\n 0080 12101312 10131210 13121013 12101312 ................\n 0090 10131210 13121013 1220f000 00000000 ......... ......\n 00a0 00000001 00000000 00000000 00000000 ................\n 00b0 ffffffff 00000000 00000000 00000000 ................\n 00c0 001d001f 0000001b 0000004f 00000000 ...........O....\n 00d0 00000001 00000000 2c200004 0000002a ........, .....*\n 00e0 00000000 1820000f 0000002a 00000214 ..... .....*....\n 00f0 20200001 00000001 00000000 20200000 .......... ..\n 0100 02000000 03000000 04000000 05000000 ................\n 0110 06000000 07000000 08000000 09000000 ................\n 0120 20000000 21000000 0a000000 0b000000 ...!...........\n 0130 0b000000 1a000000 00000000 00000003 ................\n 0140 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0150 7265616c 2d69646f 2d643330 33633630 real-ido-d303c60\n 0160 30313864 30656135 312f752e 69005f4d 018d0ea51/u.i._M\n 0170 7478465f 746f5f4d 74780000 5f4d7478 txF_to_Mtx.._Mtx\n 0180 465f746f 5f4d7478 00000000 00000000 F_to_Mtx........\n 0190 00000001 00000000 00000037 00000000 ...........7....\n 01a0 00000004 00000000 00000085 00000000 ................\n 01b0 00000000 00000001 00000000 00000011 ................\n 01c0 00000000 00000000 01800000 00000000 ................\n 01d0 0000003b 00000000 00000000 00000000 ...;............\n 01e0 18200001 00000000 00000000 00000000 . ..............\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile '_MtxF_to_Mtx' — lift: cannot lift '_MtxF_to_Mtx @0x8': 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 <_MtxF_to_Mtx>: */\n/* 0:\tlui\tat,0x4780 */\n/* 4:\tmtc1\tat,$f0 */\n/* 8:\tlwc1\t$f4,0(a0) */\n/* c:\taddiu\tv1,a1,32 */\n/* 10:\tmove\tv0,a1 */\n/* 14:\tmul.s\t$f6,$f4,$f0 */\n/* 18:\ttrunc.w.s\t$f8,$f6 */\n/* 1c:\tmfc1\tt8,$f8 */\n/* 20:\tnop */\n/* 24:\tsra\tt7,t8,0x10 */\n/* 28:\tsh\tt7,0(a1) */\n/* 2c:\tsh\tt8,32(a1) */\n/* 30:\tlwc1\t$f10,4(a0) */\n/* 34:\tmul.s\t$f16,$f10,$f0 */\n/* 38:\ttrunc.w.s\t$f18,$f16 */\n/* 3c:\tmfc1\tt1,$f18 */\n/* 40:\tnop */\n/* 44:\tsra\tt0,t1,0x10 */\n/* 48:\tsh\tt0,2(a1) */\n/* 4c:\tsh\tt1,34(a1) */\n/* 50:\tlwc1\t$f4,8(a0) */\n/* 54:\tmul.s\t$f6,$f4,$f0 */\n/* 58:\ttrunc.w.s\t$f8,$f6 */\n/* 5c:\tmfc1\tt4,$f8 */\n/* 60:\tnop */\n/* 64:\tsra\tt3,t4,0x10 */\n/* 68:\tsh\tt3,4(a1) */\n/* 6c:\tsh\tt4,36(a1) */\n/* 70:\tlwc1\t$f10,12(a0) */\n/* 74:\tmul.s\t$f16,$f10,$f0 */\n/* 78:\ttrunc.w.s\t$f18,$f16 */\n/* 7c:\tmfc1\tt7,$f18 */\n/* 80:\tnop */\n/* 84:\tsra\tt6,t7,0x10 */\n/* 88:\tsh\tt6,6(a1) */\n/* 8c:\tsh\tt7,38(a1) */\n/* 90:\tlwc1\t$f4,16(a0) */\n/* 94:\tmul.s\t$f6,$f4,$f0 */\n/* 98:\ttrunc.w.s\t$f8,$f6 */\n/* 9c:\tmfc1\tt0,$f8 */\n/* a0:\tnop */\n/* a4:\tsra\tt9,t0,0x10 */\n/* a8:\tsh\tt9,8(a1) */\n/* ac:\tsh\tt0,40(a1) */\n/* b0:\tlwc1\t$f10,20(a0) */\n/* b4:\tmul.s\t$f16,$f10,$f0 */\n/* b8:\ttrunc.w.s\t$f18,$f16 */\n/* bc:\tmfc1\tt3,$f18 */\n/* c0:\tnop */\n/* c4:\tsra\tt2,t3,0x10 */\n/* c8:\tsh\tt2,10(a1) */\n/* cc:\tsh\tt3,42(a1) */\n/* d0:\tlwc1\t$f4,24(a0) */\n/* d4:\tmul.s\t$f6,$f4,$f0 */\n/* d8:\ttrunc.w.s\t$f8,$f6 */\n/* dc:\tmfc1\tt6,$f8 */\n/* e0:\tnop */\n/* e4:\tsra\tt5,t6,0x10 */\n/* e8:\tsh\tt5,12(a1) */\n/* ec:\tsh\tt6,44(a1) */\n/* f0:\tlwc1\t$f10,28(a0) */\n/* f4:\tmul.s\t$f16,$f10,$f0 */\n/* f8:\ttrunc.w.s\t$f18,$f16 */\n/* fc:\tmfc1\tt9,$f18 */\n/* 100:\tnop */\n/* 104:\tsra\tt8,t9,0x10 */\n/* 108:\tsh\tt8,14(a1) */\n/* 10c:\tsh\tt9,46(a1) */\n/* 110:\tlwc1\t$f4,32(a0) */\n/* 114:\tmul.s\t$f6,$f4,$f0 */\n/* 118:\ttrunc.w.s\t$f8,$f6 */\n/* 11c:\tmfc1\tt2,$f8 */\n/* 120:\tnop */\n/* 124:\tsra\tt1,t2,0x10 */\n/* 128:\tsh\tt1,16(a1) */\n/* 12c:\tsh\tt2,48(a1) */\n/* 130:\tlwc1\t$f10,36(a0) */\n/* 134:\tmul.s\t$f16,$f10,$f0 */\n/* 138:\ttrunc.w.s\t$f18,$f16 */\n/* 13c:\tmfc1\tt5,$f18 */\n/* 140:\tnop */\n/* 144:\tsra\tt4,t5,0x10 */\n/* 148:\tsh\tt4,18(a1) */\n/* 14c:\tsh\tt5,18(v1) */\n/* 150:\tlwc1\t$f4,40(a0) */\n/* 154:\tmul.s\t$f6,$f4,$f0 */\n/* 158:\ttrunc.w.s\t$f8,$f6 */\n/* 15c:\tmfc1\tt8,$f8 */\n/* 160:\tnop */\n/* 164:\tsra\tt7,t8,0x10 */\n/* 168:\tsh\tt7,20(a1) */\n/* 16c:\tsh\tt8,20(v1) */\n/* 170:\tlwc1\t$f10,44(a0) */\n/* 174:\tmul.s\t$f16,$f10,$f0 */\n/* 178:\ttrunc.w.s\t$f18,$f16 */\n/* 17c:\tmfc1\tt1,$f18 */\n/* 180:\tnop */\n/* 184:\tsra\tt0,t1,0x10 */\n/* 188:\tsh\tt0,22(a1) */\n/* 18c:\tsh\tt1,22(v1) */\n/* 190:\tlwc1\t$f4,48(a0) */\n/* 194:\tmul.s\t$f6,$f4,$f0 */\n/* 198:\ttrunc.w.s\t$f8,$f6 */\n/* 19c:\tmfc1\tt4,$f8 */\n/* 1a0:\tnop */\n/* 1a4:\tsra\tt3,t4,0x10 */\n/* 1a8:\tsh\tt3,24(a1) */\n/* 1ac:\tsh\tt4,24(v1) */\n/* 1b0:\tlwc1\t$f10,52(a0) */\n/* 1b4:\tmul.s\t$f16,$f10,$f0 */\n/* 1b8:\ttrunc.w.s\t$f18,$f16 */\n/* 1bc:\tmfc1\tt7,$f18 */\n/* 1c0:\tnop */\n/* 1c4:\tsra\tt6,t7,0x10 */\n/* 1c8:\tsh\tt6,26(a1) */\n/* 1cc:\tsh\tt7,26(v1) */\n/* 1d0:\tlwc1\t$f4,56(a0) */\n/* 1d4:\tmul.s\t$f6,$f4,$f0 */\n/* 1d8:\ttrunc.w.s\t$f8,$f6 */\n/* 1dc:\tmfc1\tt0,$f8 */\n/* 1e0:\tnop */\n/* 1e4:\tsra\tt9,t0,0x10 */\n/* 1e8:\tsh\tt9,28(a1) */\n/* 1ec:\tsh\tt0,28(v1) */\n/* 1f0:\tlwc1\t$f10,60(a0) */\n/* 1f4:\tmul.s\t$f16,$f10,$f0 */\n/* 1f8:\ttrunc.w.s\t$f18,$f16 */\n/* 1fc:\tmfc1\tt3,$f18 */\n/* 200:\tnop */\n/* 204:\tsra\tt2,t3,0x10 */\n/* 208:\tsh\tt2,30(a1) */\n/* 20c:\tjr\tra */\n/* 210:\tsh\tt3,30(v1) */\n/* \t... */\nvoid _MtxF_to_Mtx(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift '_MtxF_to_Mtx @0x8': 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":142,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift '_MtxF_to_Mtx @0x8': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *_MtxF_to_Mtx(void *arg0, void *arg1) {\n s32 temp_f18;\n s32 temp_f18_2;\n s32 temp_f18_3;\n s32 temp_f18_4;\n s32 temp_f18_5;\n s32 temp_f18_6;\n s32 temp_f18_7;\n s32 temp_f18_8;\n s32 temp_f8;\n s32 temp_f8_2;\n s32 temp_f8_3;\n s32 temp_f8_4;\n s32 temp_f8_5;\n s32 temp_f8_6;\n s32 temp_f8_7;\n s32 temp_f8_8;\n void *temp_v1;\n\n temp_v1 = arg1 + 0x20;\n temp_f8 = (s32) (arg0->unk0 * 65536.0f);\n arg1->unk0 = (s16) (temp_f8 >> 0x10);\n arg1->unk20 = (s16) temp_f8;\n temp_f18 = (s32) (arg0->unk4 * 65536.0f);\n arg1->unk2 = (s16) (temp_f18 >> 0x10);\n arg1->unk22 = (s16) temp_f18;\n temp_f8_2 = (s32) (arg0->unk8 * 65536.0f);\n arg1->unk4 = (s16) (temp_f8_2 >> 0x10);\n arg1->unk24 = (s16) temp_f8_2;\n temp_f18_2 = (s32) (arg0->unkC * 65536.0f);\n arg1->unk6 = (s16) (temp_f18_2 >> 0x10);\n arg1->unk26 = (s16) temp_f18_2;\n temp_f8_3 = (s32) (arg0->unk10 * 65536.0f);\n arg1->unk8 = (s16) (temp_f8_3 >> 0x10);\n arg1->unk28 = (s16) temp_f8_3;\n temp_f18_3 = (s32) (arg0->unk14 * 65536.0f);\n arg1->unkA = (s16) (temp_f18_3 >> 0x10);\n arg1->unk2A = (s16) temp_f18_3;\n temp_f8_4 = (s32) (arg0->unk18 * 65536.0f);\n arg1->unkC = (s16) (temp_f8_4 >> 0x10);\n arg1->unk2C = (s16) temp_f8_4;\n temp_f18_4 = (s32) (arg0->unk1C * 65536.0f);\n arg1->unkE = (s16) (temp_f18_4 >> 0x10);\n arg1->unk2E = (s16) temp_f18_4;\n temp_f8_5 = (s32) (arg0->unk20 * 65536.0f);\n arg1->unk10 = (s16) (temp_f8_5 >> 0x10);\n arg1->unk30 = (s16) temp_f8_5;\n temp_f18_5 = (s32) (arg0->unk24 * 65536.0f);\n arg1->unk12 = (s16) (temp_f18_5 >> 0x10);\n temp_v1->unk12 = (s16) temp_f18_5;\n temp_f8_6 = (s32) (arg0->unk28 * 65536.0f);\n arg1->unk14 = (s16) (temp_f8_6 >> 0x10);\n temp_v1->unk14 = (s16) temp_f8_6;\n temp_f18_6 = (s32) (arg0->unk2C * 65536.0f);\n arg1->unk16 = (s16) (temp_f18_6 >> 0x10);\n temp_v1->unk16 = (s16) temp_f18_6;\n temp_f8_7 = (s32) (arg0->unk30 * 65536.0f);\n arg1->unk18 = (s16) (temp_f8_7 >> 0x10);\n temp_v1->unk18 = (s16) temp_f8_7;\n temp_f18_7 = (s32) (arg0->unk34 * 65536.0f);\n arg1->unk1A = (s16) (temp_f18_7 >> 0x10);\n temp_v1->unk1A = (s16) temp_f18_7;\n temp_f8_8 = (s32) (arg0->unk38 * 65536.0f);\n arg1->unk1C = (s16) (temp_f8_8 >> 0x10);\n temp_v1->unk1C = (s16) temp_f8_8;\n temp_f18_8 = (s32) (arg0->unk3C * 65536.0f);\n arg1->unk1E = (s16) (temp_f18_8 >> 0x10);\n temp_v1->unk1E = (s16) temp_f18_8;\n return arg1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":69,"gotos":0,"casts":48,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 45: Unacceptable operand of '+'.","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side","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 `_MtxF_to_Mtx` — benchmark function af:_MtxF_to_Mtx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel _MtxF_to_Mtx\n lui\t$at, 0x4780\n mtc1\t$at, $f0\n lwc1\t$f4, 0($a0)\n addiu\t$v1, $a1, 32\n move\t$v0, $a1\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t8, $f8\n nop\n sra\t$t7, $t8, 0x10\n sh\t$t7, 0($a1)\n sh\t$t8, 32($a1)\n lwc1\t$f10, 4($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t1, $f18\n nop\n sra\t$t0, $t1, 0x10\n sh\t$t0, 2($a1)\n sh\t$t1, 34($a1)\n lwc1\t$f4, 8($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t4, $f8\n nop\n sra\t$t3, $t4, 0x10\n sh\t$t3, 4($a1)\n sh\t$t4, 36($a1)\n lwc1\t$f10, 12($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t7, $f18\n nop\n sra\t$t6, $t7, 0x10\n sh\t$t6, 6($a1)\n sh\t$t7, 38($a1)\n lwc1\t$f4, 16($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t0, $f8\n nop\n sra\t$t9, $t0, 0x10\n sh\t$t9, 8($a1)\n sh\t$t0, 40($a1)\n lwc1\t$f10, 20($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t3, $f18\n nop\n sra\t$t2, $t3, 0x10\n sh\t$t2, 10($a1)\n sh\t$t3, 42($a1)\n lwc1\t$f4, 24($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t6, $f8\n nop\n sra\t$t5, $t6, 0x10\n sh\t$t5, 12($a1)\n sh\t$t6, 44($a1)\n lwc1\t$f10, 28($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t9, $f18\n nop\n sra\t$t8, $t9, 0x10\n sh\t$t8, 14($a1)\n sh\t$t9, 46($a1)\n lwc1\t$f4, 32($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t2, $f8\n nop\n sra\t$t1, $t2, 0x10\n sh\t$t1, 16($a1)\n sh\t$t2, 48($a1)\n lwc1\t$f10, 36($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t5, $f18\n nop\n sra\t$t4, $t5, 0x10\n sh\t$t4, 18($a1)\n sh\t$t5, 18($v1)\n lwc1\t$f4, 40($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t8, $f8\n nop\n sra\t$t7, $t8, 0x10\n sh\t$t7, 20($a1)\n sh\t$t8, 20($v1)\n lwc1\t$f10, 44($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t1, $f18\n nop\n sra\t$t0, $t1, 0x10\n sh\t$t0, 22($a1)\n sh\t$t1, 22($v1)\n lwc1\t$f4, 48($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t4, $f8\n nop\n sra\t$t3, $t4, 0x10\n sh\t$t3, 24($a1)\n sh\t$t4, 24($v1)\n lwc1\t$f10, 52($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t7, $f18\n nop\n sra\t$t6, $t7, 0x10\n sh\t$t6, 26($a1)\n sh\t$t7, 26($v1)\n lwc1\t$f4, 56($a0)\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t0, $f8\n nop\n sra\t$t9, $t0, 0x10\n sh\t$t9, 28($a1)\n sh\t$t0, 28($v1)\n lwc1\t$f10, 60($a0)\n mul.s\t$f16, $f10, $f0\n trunc.w.s\t$f18, $f16\n mfc1\t$t3, $f18\n nop\n sra\t$t2, $t3, 0x10\n sh\t$t2, 30($a1)\n jr\t$ra\n sh\t$t3, 30($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 _MtxF_to_Mtx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `_MtxF_to_Mtx` — benchmark function af:_MtxF_to_Mtx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:_MtxF_to_Mtx: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 <_MtxF_to_Mtx>:\n 0:\tlui\tat,0x4780\n 4:\tmtc1\tat,$f0\n 8:\tlwc1\t$f4,0(a0)\n c:\taddiu\tv1,a1,32\n 10:\tmove\tv0,a1\n 14:\tmul.s\t$f6,$f4,$f0\n 18:\ttrunc.w.s\t$f8,$f6\n 1c:\tmfc1\tt8,$f8\n 20:\tnop\n 24:\tsra\tt7,t8,0x10\n 28:\tsh\tt7,0(a1)\n 2c:\tsh\tt8,32(a1)\n 30:\tlwc1\t$f10,4(a0)\n 34:\tmul.s\t$f16,$f10,$f0\n 38:\ttrunc.w.s\t$f18,$f16\n 3c:\tmfc1\tt1,$f18\n 40:\tnop\n 44:\tsra\tt0,t1,0x10\n 48:\tsh\tt0,2(a1)\n 4c:\tsh\tt1,34(a1)\n 50:\tlwc1\t$f4,8(a0)\n 54:\tmul.s\t$f6,$f4,$f0\n 58:\ttrunc.w.s\t$f8,$f6\n 5c:\tmfc1\tt4,$f8\n 60:\tnop\n 64:\tsra\tt3,t4,0x10\n 68:\tsh\tt3,4(a1)\n 6c:\tsh\tt4,36(a1)\n 70:\tlwc1\t$f10,12(a0)\n 74:\tmul.s\t$f16,$f10,$f0\n 78:\ttrunc.w.s\t$f18,$f16\n 7c:\tmfc1\tt7,$f18\n 80:\tnop\n 84:\tsra\tt6,t7,0x10\n 88:\tsh\tt6,6(a1)\n 8c:\tsh\tt7,38(a1)\n 90:\tlwc1\t$f4,16(a0)\n 94:\tmul.s\t$f6,$f4,$f0\n 98:\ttrunc.w.s\t$f8,$f6\n 9c:\tmfc1\tt0,$f8\n a0:\tnop\n a4:\tsra\tt9,t0,0x10\n a8:\tsh\tt9,8(a1)\n ac:\tsh\tt0,40(a1)\n b0:\tlwc1\t$f10,20(a0)\n b4:\tmul.s\t$f16,$f10,$f0\n b8:\ttrunc.w.s\t$f18,$f16\n bc:\tmfc1\tt3,$f18\n c0:\tnop\n c4:\tsra\tt2,t3,0x10\n c8:\tsh\tt2,10(a1)\n cc:\tsh\tt3,42(a1)\n d0:\tlwc1\t$f4,24(a0)\n d4:\tmul.s\t$f6,$f4,$f0\n d8:\ttrunc.w.s\t$f8,$f6\n dc:\tmfc1\tt6,$f8\n e0:\tnop\n e4:\tsra\tt5,t6,0x10\n e8:\tsh\tt5,12(a1)\n ec:\tsh\tt6,44(a1)\n f0:\tlwc1\t$f10,28(a0)\n f4:\tmul.s\t$f16,$f10,$f0\n f8:\ttrunc.w.s\t$f18,$f16\n fc:\tmfc1\tt9,$f18\n 100:\tnop\n 104:\tsra\tt8,t9,0x10\n 108:\tsh\tt8,14(a1)\n 10c:\tsh\tt9,46(a1)\n 110:\tlwc1\t$f4,32(a0)\n 114:\tmul.s\t$f6,$f4,$f0\n 118:\ttrunc.w.s\t$f8,$f6\n 11c:\tmfc1\tt2,$f8\n 120:\tnop\n 124:\tsra\tt1,t2,0x10\n 128:\tsh\tt1,16(a1)\n 12c:\tsh\tt2,48(a1)\n 130:\tlwc1\t$f10,36(a0)\n 134:\tmul.s\t$f16,$f10,$f0\n 138:\ttrunc.w.s\t$f18,$f16\n 13c:\tmfc1\tt5,$f18\n 140:\tnop\n 144:\tsra\tt4,t5,0x10\n 148:\tsh\tt4,18(a1)\n 14c:\tsh\tt5,18(v1)\n 150:\tlwc1\t$f4,40(a0)\n 154:\tmul.s\t$f6,$f4,$f0\n 158:\ttrunc.w.s\t$f8,$f6\n 15c:\tmfc1\tt8,$f8\n 160:\tnop\n 164:\tsra\tt7,t8,0x10\n 168:\tsh\tt7,20(a1)\n 16c:\tsh\tt8,20(v1)\n 170:\tlwc1\t$f10,44(a0)\n 174:\tmul.s\t$f16,$f10,$f0\n 178:\ttrunc.w.s\t$f18,$f16\n 17c:\tmfc1\tt1,$f18\n 180:\tnop\n 184:\tsra\tt0,t1,0x10\n 188:\tsh\tt0,22(a1)\n 18c:\tsh\tt1,22(v1)\n 190:\tlwc1\t$f4,48(a0)\n 194:\tmul.s\t$f6,$f4,$f0\n 198:\ttrunc.w.s\t$f8,$f6\n 19c:\tmfc1\tt4,$f8\n 1a0:\tnop\n 1a4:\tsra\tt3,t4,0x10\n 1a8:\tsh\tt3,24(a1)\n 1ac:\tsh\tt4,24(v1)\n 1b0:\tlwc1\t$f10,52(a0)\n 1b4:\tmul.s\t$f16,$f10,$f0\n 1b8:\ttrunc.w.s\t$f18,$f16\n 1bc:\tmfc1\tt7,$f18\n 1c0:\tnop\n 1c4:\tsra\tt6,t7,0x10\n 1c8:\tsh\tt6,26(a1)\n 1cc:\tsh\tt7,26(v1)\n 1d0:\tlwc1\t$f4,56(a0)\n 1d4:\tmul.s\t$f6,$f4,$f0\n 1d8:\ttrunc.w.s\t$f8,$f6\n 1dc:\tmfc1\tt0,$f8\n 1e0:\tnop\n 1e4:\tsra\tt9,t0,0x10\n 1e8:\tsh\tt9,28(a1)\n 1ec:\tsh\tt0,28(v1)\n 1f0:\tlwc1\t$f10,60(a0)\n 1f4:\tmul.s\t$f16,$f10,$f0\n 1f8:\ttrunc.w.s\t$f18,$f16\n 1fc:\tmfc1\tt3,$f18\n 200:\tnop\n 204:\tsra\tt2,t3,0x10\n 208:\tsh\tt2,30(a1)\n 20c:\tjr\tra\n 210:\tsh\tt3,30(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\t00000220 .text\n00000000 g F .text\t00000214 _MtxF_to_Mtx\n\n\nContents of section .text:\n 0000 3c014780 44810000 c4840000 24a30020 <.G.D.......$.. \n 0010 00a01025 46002182 4600320d 44184000 ...%F.!.F.2.D.@.\n 0020 00000000 00187c03 a4af0000 a4b80020 ......|........ \n 0030 c48a0004 46005402 4600848d 44099000 ....F.T.F...D...\n 0040 00000000 00094403 a4a80002 a4a90022 ......D........\"\n 0050 c4840008 46002182 4600320d 440c4000 ....F.!.F.2.D.@.\n 0060 00000000 000c5c03 a4ab0004 a4ac0024 ......\\........$\n 0070 c48a000c 46005402 4600848d 440f9000 ....F.T.F...D...\n 0080 00000000 000f7403 a4ae0006 a4af0026 ......t........&\n 0090 c4840010 46002182 4600320d 44084000 ....F.!.F.2.D.@.\n 00a0 00000000 0008cc03 a4b90008 a4a80028 ...............(\n 00b0 c48a0014 46005402 4600848d 440b9000 ....F.T.F...D...\n 00c0 00000000 000b5403 a4aa000a a4ab002a ......T........*\n 00d0 c4840018 46002182 4600320d 440e4000 ....F.!.F.2.D.@.\n 00e0 00000000 000e6c03 a4ad000c a4ae002c ......l........,\n 00f0 c48a001c 46005402 4600848d 44199000 ....F.T.F...D...\n 0100 00000000 0019c403 a4b8000e a4b9002e ................\n 0110 c4840020 46002182 4600320d 440a4000 ... F.!.F.2.D.@.\n 0120 00000000 000a4c03 a4a90010 a4aa0030 ......L........0\n 0130 c48a0024 46005402 4600848d 440d9000 ...$F.T.F...D...\n 0140 00000000 000d6403 a4ac0012 a46d0012 ......d......m..\n 0150 c4840028 46002182 4600320d 44184000 ...(F.!.F.2.D.@.\n 0160 00000000 00187c03 a4af0014 a4780014 ......|......x..\n 0170 c48a002c 46005402 4600848d 44099000 ...,F.T.F...D...\n 0180 00000000 00094403 a4a80016 a4690016 ......D......i..\n 0190 c4840030 46002182 4600320d 440c4000 ...0F.!.F.2.D.@.\n 01a0 00000000 000c5c03 a4ab0018 a46c0018 ......\\......l..\n 01b0 c48a0034 46005402 4600848d 440f9000 ...4F.T.F...D...\n 01c0 00000000 000f7403 a4ae001a a46f001a ......t......o..\n 01d0 c4840038 46002182 4600320d 44084000 ...8F.!.F.2.D.@.\n 01e0 00000000 0008cc03 a4b9001c a468001c .............h..\n 01f0 c48a003c 46005402 4600848d 440b9000 .......\n 0010 000f07d1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff3e 00000000 000f07d1 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000085 0000003c 00000398 p..........<....\n 0010 00000005 0000051c 00000001 000003d4 ................\n 0020 00000004 00000408 00000000 00000000 ................\n 0030 00000011 00000438 00000038 0000047c .......8...8...|\n 0040 00000010 000004b4 00000001 000004c4 ................\n 0050 00000000 00000000 00000001 0000050c ................\n 0060 01408000 1d800013 82ffd012 10131210 .@..............\n 0070 13121013 12101312 10131210 13121013 ................\n 0080 12101312 10131210 13121013 12101312 ................\n 0090 10131210 13121013 1220f000 00000000 ......... ......\n 00a0 00000001 00000000 00000000 00000000 ................\n 00b0 ffffffff 00000000 00000000 00000000 ................\n 00c0 001d001f 0000001b 0000004f 00000000 ...........O....\n 00d0 00000001 00000000 2c200004 0000002a ........, .....*\n 00e0 00000000 1820000f 0000002a 00000214 ..... .....*....\n 00f0 20200001 00000001 00000000 20200000 .......... ..\n 0100 02000000 03000000 04000000 05000000 ................\n 0110 06000000 07000000 08000000 09000000 ................\n 0120 20000000 21000000 0a000000 0b000000 ...!...........\n 0130 0b000000 1a000000 00000000 00000003 ................\n 0140 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0150 7265616c 2d69646f 2d643330 33633630 real-ido-d303c60\n 0160 30313864 30656135 312f752e 69005f4d 018d0ea51/u.i._M\n 0170 7478465f 746f5f4d 74780000 5f4d7478 txF_to_Mtx.._Mtx\n 0180 465f746f 5f4d7478 00000000 00000000 F_to_Mtx........\n 0190 00000001 00000000 00000037 00000000 ...........7....\n 01a0 00000004 00000000 00000085 00000000 ................\n 01b0 00000000 00000001 00000000 00000011 ................\n 01c0 00000000 00000000 01800000 00000000 ................\n 01d0 0000003b 00000000 00000000 00000000 ...;............\n 01e0 18200001 00000000 00000000 00000000 . ..............\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 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 _MtxF_to_Mtx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_calc_a:ido7.1","sym":"add_calc_a","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer","arithmetic"],"loc":53,"refSource":"f32 add_calc_a(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep) {\n f32 stepSize = 0.0f;\n f32 diff = target - *pValue;\n\n if (target != *pValue) {\n if (diff > 180.0f) {\n diff = -(360.0f - diff);\n } else if (diff < -180.0f) {\n diff = 360.0f + diff;\n }\n\n stepSize = diff * fraction;\n\n if ((stepSize >= minStep) || (stepSize <= -minStep)) {\n if (step < stepSize) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n\n if (stepSize > 0.0f) {\n if (target < *pValue) {\n *pValue = target;\n }\n } else if (*pValue < target) {\n *pValue = target;\n }\n } else {\n if (stepSize > 0.0f) {\n stepSize = minStep;\n *pValue += stepSize;\n if (target < *pValue) {\n *pValue = target;\n }\n } else {\n stepSize = -minStep;\n *pValue += -minStep;\n if (*pValue < target) {\n *pValue = target;\n }\n }\n }\n }\n if (*pValue >= 360.0f) {\n *pValue -= 360.0f;\n }\n if (*pValue < 0.0f) {\n *pValue += 360.0f;\n }\n return stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L437-L489","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-16\n 4:\tsw\ta2,24(sp)\n 8:\tmtc1\ta1,$f12\n c:\tlwc1\t$f0,0(a0)\n 10:\tmtc1\tzero,$f2\n 14:\tmtc1\ta3,$f14\n 18:\tc.eq.s\t$f12,$f0\n 1c:\tlui\tat,0x4334\n 20:\tsub.s\t$f18,$f12,$f0\n 24:\tmov.s\t$f16,$f2\n 28:\tbc1tl\t1a0 \n 2c:\tlui\tat,0x43b4\n 30:\tmtc1\tat,$f4\n 34:\tlui\tat,0xc334\n 38:\tc.lt.s\t$f4,$f18\n 3c:\tlwc1\t$f4,24(sp)\n 40:\tbc1fl\t64 \n 44:\tmtc1\tat,$f8\n 48:\tlui\tat,0x43b4\n 4c:\tmtc1\tat,$f6\n 50:\tnop\n 54:\tsub.s\t$f18,$f6,$f18\n 58:\tb\t84 \n 5c:\tneg.s\t$f18,$f18\n 60:\tmtc1\tat,$f8\n 64:\tlui\tat,0x43b4\n 68:\tc.lt.s\t$f18,$f8\n 6c:\tnop\n 70:\tbc1fl\t88 \n 74:\tmul.s\t$f6,$f18,$f4\n 78:\tmtc1\tat,$f10\n 7c:\tnop\n 80:\tadd.s\t$f18,$f10,$f18\n 84:\tmul.s\t$f6,$f18,$f4\n 88:\tlwc1\t$f10,32(sp)\n 8c:\tswc1\t$f6,0(sp)\n 90:\tlwc1\t$f8,0(sp)\n 94:\tlwc1\t$f4,0(sp)\n 98:\tc.le.s\t$f10,$f8\n 9c:\tmov.s\t$f16,$f8\n a0:\tbc1tl\tc0 \n a4:\tc.lt.s\t$f14,$f4\n a8:\tneg.s\t$f18,$f10\n ac:\tc.le.s\t$f8,$f18\n b0:\tlwc1\t$f8,0(sp)\n b4:\tbc1fl\t140 \n b8:\tc.lt.s\t$f2,$f8\n bc:\tc.lt.s\t$f14,$f4\n c0:\tlwc1\t$f6,0(sp)\n c4:\tbc1fl\td8 \n c8:\tneg.s\t$f18,$f14\n cc:\tb\tec \n d0:\tmov.s\t$f16,$f14\n d4:\tneg.s\t$f18,$f14\n d8:\tc.lt.s\t$f6,$f18\n dc:\tnop\n e0:\tbc1fl\tf0 \n e4:\tc.lt.s\t$f2,$f16\n e8:\tmov.s\t$f16,$f18\n ec:\tc.lt.s\t$f2,$f16\n f0:\tadd.s\t$f10,$f0,$f16\n f4:\tbc1f\t11c \n f8:\tswc1\t$f10,0(a0)\n fc:\tlwc1\t$f0,0(a0)\n 100:\tc.lt.s\t$f12,$f0\n 104:\tnop\n 108:\tbc1fl\t1a0 \n 10c:\tlui\tat,0x43b4\n 110:\tswc1\t$f12,0(a0)\n 114:\tb\t19c \n 118:\tlwc1\t$f0,0(a0)\n 11c:\tlwc1\t$f0,0(a0)\n 120:\tc.lt.s\t$f0,$f12\n 124:\tnop\n 128:\tbc1fl\t1a0 \n 12c:\tlui\tat,0x43b4\n 130:\tswc1\t$f12,0(a0)\n 134:\tb\t19c \n 138:\tlwc1\t$f0,0(a0)\n 13c:\tc.lt.s\t$f2,$f8\n 140:\tlwc1\t$f16,32(sp)\n 144:\tbc1fl\t178 \n 148:\tadd.s\t$f10,$f0,$f18\n 14c:\tadd.s\t$f6,$f0,$f16\n 150:\tswc1\t$f6,0(a0)\n 154:\tlwc1\t$f0,0(a0)\n 158:\tc.lt.s\t$f12,$f0\n 15c:\tnop\n 160:\tbc1fl\t1a0 \n 164:\tlui\tat,0x43b4\n 168:\tswc1\t$f12,0(a0)\n 16c:\tb\t19c \n 170:\tlwc1\t$f0,0(a0)\n 174:\tadd.s\t$f10,$f0,$f18\n 178:\tmov.s\t$f16,$f18\n 17c:\tswc1\t$f10,0(a0)\n 180:\tlwc1\t$f0,0(a0)\n 184:\tc.lt.s\t$f0,$f12\n 188:\tnop\n 18c:\tbc1fl\t1a0 \n 190:\tlui\tat,0x43b4\n 194:\tswc1\t$f12,0(a0)\n 198:\tlwc1\t$f0,0(a0)\n 19c:\tlui\tat,0x43b4\n 1a0:\tmtc1\tat,$f8\n 1a4:\tlui\tat,0x43b4\n 1a8:\tc.le.s\t$f8,$f0\n 1ac:\tnop\n 1b0:\tbc1fl\t1d0 \n 1b4:\tc.lt.s\t$f0,$f2\n 1b8:\tmtc1\tat,$f4\n 1bc:\tnop\n 1c0:\tsub.s\t$f6,$f0,$f4\n 1c4:\tswc1\t$f6,0(a0)\n 1c8:\tlwc1\t$f0,0(a0)\n 1cc:\tc.lt.s\t$f0,$f2\n 1d0:\tlui\tat,0x43b4\n 1d4:\tbc1fl\t1f0 \n 1d8:\tmov.s\t$f0,$f16\n 1dc:\tmtc1\tat,$f10\n 1e0:\tnop\n 1e4:\tadd.s\t$f8,$f0,$f10\n 1e8:\tswc1\t$f8,0(a0)\n 1ec:\tmov.s\t$f0,$f16\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,16\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000200 .text\n00000000 g F .text\t000001f8 add_calc_a\n\n\nContents of section .text:\n 0000 27bdfff0 afa60018 44856000 c4800000 '.......D.`.....\n 0010 44801000 44877000 46006032 3c014334 D...D.p.F.`2<.C4\n 0020 46006481 46001406 4503005d 3c0143b4 F.d.F...E..]<.C.\n 0030 44812000 3c01c334 4612203c c7a40018 D. .<..4F. <....\n 0040 45020008 44814000 3c0143b4 44813000 E...D.@.<.C.D.0.\n 0050 00000000 46123481 1000000a 46009487 ....F.4.....F...\n 0060 44814000 3c0143b4 4608903c 00000000 D.@.<.C.F..<....\n 0070 45020005 46049182 44815000 00000000 E...F...D.P.....\n 0080 46125480 46049182 c7aa0020 e7a60000 F.T.F...... ....\n 0090 c7a80000 c7a40000 4608503e 46004406 ........F.P>F.D.\n 00a0 45030007 4604703c 46005487 4612403e E...F.p\n 00b0 c7a80000 45020022 4608103c 4604703c ....E..\"F......\n 01b0 45020007 4602003c 44812000 00000000 E...F..: */\n/* 0:\taddiu\tsp,sp,-16 */\n/* 4:\tsw\ta2,24(sp) */\n/* 8:\tmtc1\ta1,$f12 */\n/* c:\tlwc1\t$f0,0(a0) */\n/* 10:\tmtc1\tzero,$f2 */\n/* 14:\tmtc1\ta3,$f14 */\n/* 18:\tc.eq.s\t$f12,$f0 */\n/* 1c:\tlui\tat,0x4334 */\n/* 20:\tsub.s\t$f18,$f12,$f0 */\n/* 24:\tmov.s\t$f16,$f2 */\n/* 28:\tbc1tl\t1a0 */\n/* 2c:\tlui\tat,0x43b4 */\n/* 30:\tmtc1\tat,$f4 */\n/* 34:\tlui\tat,0xc334 */\n/* 38:\tc.lt.s\t$f4,$f18 */\n/* 3c:\tlwc1\t$f4,24(sp) */\n/* 40:\tbc1fl\t64 */\n/* 44:\tmtc1\tat,$f8 */\n/* 48:\tlui\tat,0x43b4 */\n/* 4c:\tmtc1\tat,$f6 */\n/* 50:\tnop */\n/* 54:\tsub.s\t$f18,$f6,$f18 */\n/* 58:\tb\t84 */\n/* 5c:\tneg.s\t$f18,$f18 */\n/* 60:\tmtc1\tat,$f8 */\n/* 64:\tlui\tat,0x43b4 */\n/* 68:\tc.lt.s\t$f18,$f8 */\n/* 6c:\tnop */\n/* 70:\tbc1fl\t88 */\n/* 74:\tmul.s\t$f6,$f18,$f4 */\n/* 78:\tmtc1\tat,$f10 */\n/* 7c:\tnop */\n/* 80:\tadd.s\t$f18,$f10,$f18 */\n/* 84:\tmul.s\t$f6,$f18,$f4 */\n/* 88:\tlwc1\t$f10,32(sp) */\n/* 8c:\tswc1\t$f6,0(sp) */\n/* 90:\tlwc1\t$f8,0(sp) */\n/* 94:\tlwc1\t$f4,0(sp) */\n/* 98:\tc.le.s\t$f10,$f8 */\n/* 9c:\tmov.s\t$f16,$f8 */\n/* a0:\tbc1tl\tc0 */\n/* a4:\tc.lt.s\t$f14,$f4 */\n/* a8:\tneg.s\t$f18,$f10 */\n/* ac:\tc.le.s\t$f8,$f18 */\n/* b0:\tlwc1\t$f8,0(sp) */\n/* b4:\tbc1fl\t140 */\n/* b8:\tc.lt.s\t$f2,$f8 */\n/* bc:\tc.lt.s\t$f14,$f4 */\n/* c0:\tlwc1\t$f6,0(sp) */\n/* c4:\tbc1fl\td8 */\n/* c8:\tneg.s\t$f18,$f14 */\n/* cc:\tb\tec */\n/* d0:\tmov.s\t$f16,$f14 */\n/* d4:\tneg.s\t$f18,$f14 */\n/* d8:\tc.lt.s\t$f6,$f18 */\n/* dc:\tnop */\n/* e0:\tbc1fl\tf0 */\n/* e4:\tc.lt.s\t$f2,$f16 */\n/* e8:\tmov.s\t$f16,$f18 */\n/* ec:\tc.lt.s\t$f2,$f16 */\n/* f0:\tadd.s\t$f10,$f0,$f16 */\n/* f4:\tbc1f\t11c */\n/* f8:\tswc1\t$f10,0(a0) */\n/* fc:\tlwc1\t$f0,0(a0) */\n/* 100:\tc.lt.s\t$f12,$f0 */\n/* 104:\tnop */\n/* 108:\tbc1fl\t1a0 */\n/* 10c:\tlui\tat,0x43b4 */\n/* 110:\tswc1\t$f12,0(a0) */\n/* 114:\tb\t19c */\n/* 118:\tlwc1\t$f0,0(a0) */\n/* 11c:\tlwc1\t$f0,0(a0) */\n/* 120:\tc.lt.s\t$f0,$f12 */\n/* 124:\tnop */\n/* 128:\tbc1fl\t1a0 */\n/* 12c:\tlui\tat,0x43b4 */\n/* 130:\tswc1\t$f12,0(a0) */\n/* 134:\tb\t19c */\n/* 138:\tlwc1\t$f0,0(a0) */\n/* 13c:\tc.lt.s\t$f2,$f8 */\n/* 140:\tlwc1\t$f16,32(sp) */\n/* 144:\tbc1fl\t178 */\n/* 148:\tadd.s\t$f10,$f0,$f18 */\n/* 14c:\tadd.s\t$f6,$f0,$f16 */\n/* 150:\tswc1\t$f6,0(a0) */\n/* 154:\tlwc1\t$f0,0(a0) */\n/* 158:\tc.lt.s\t$f12,$f0 */\n/* 15c:\tnop */\n/* 160:\tbc1fl\t1a0 */\n/* 164:\tlui\tat,0x43b4 */\n/* 168:\tswc1\t$f12,0(a0) */\n/* 16c:\tb\t19c */\n/* 170:\tlwc1\t$f0,0(a0) */\n/* 174:\tadd.s\t$f10,$f0,$f18 */\n/* 178:\tmov.s\t$f16,$f18 */\n/* 17c:\tswc1\t$f10,0(a0) */\n/* 180:\tlwc1\t$f0,0(a0) */\n/* 184:\tc.lt.s\t$f0,$f12 */\n/* 188:\tnop */\n/* 18c:\tbc1fl\t1a0 */\n/* 190:\tlui\tat,0x43b4 */\n/* 194:\tswc1\t$f12,0(a0) */\n/* 198:\tlwc1\t$f0,0(a0) */\n/* 19c:\tlui\tat,0x43b4 */\n/* 1a0:\tmtc1\tat,$f8 */\n/* 1a4:\tlui\tat,0x43b4 */\n/* 1a8:\tc.le.s\t$f8,$f0 */\n/* 1ac:\tnop */\n/* 1b0:\tbc1fl\t1d0 */\n/* 1b4:\tc.lt.s\t$f0,$f2 */\n/* 1b8:\tmtc1\tat,$f4 */\n/* 1bc:\tnop */\n/* 1c0:\tsub.s\t$f6,$f0,$f4 */\n/* 1c4:\tswc1\t$f6,0(a0) */\n/* 1c8:\tlwc1\t$f0,0(a0) */\n/* 1cc:\tc.lt.s\t$f0,$f2 */\n/* 1d0:\tlui\tat,0x43b4 */\n/* 1d4:\tbc1fl\t1f0 */\n/* 1d8:\tmov.s\t$f0,$f16 */\n/* 1dc:\tmtc1\tat,$f10 */\n/* 1e0:\tnop */\n/* 1e4:\tadd.s\t$f8,$f0,$f10 */\n/* 1e8:\tswc1\t$f8,0(a0) */\n/* 1ec:\tmov.s\t$f0,$f16 */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,16 */\n/* \t... */\nvoid add_calc_a(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc_a': unmodelled control transfer 'bc1tl' at 0x28 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc_a': unmodelled control transfer 'bc1tl' at 0x28 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 add_calc_a(f32 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {\n f32 sp0;\n f32 temp_f0;\n f32 temp_f18;\n f32 temp_f18_2;\n f32 var_f16;\n f32 var_f18;\n\n temp_f0 = *arg0;\n var_f18 = arg1 - temp_f0;\n var_f16 = 0.0f;\n if (arg1 != temp_f0) {\n if (var_f18 > 180.0f) {\n var_f18 = -(360.0f - var_f18);\n } else if (var_f18 < -180.0f) {\n var_f18 += 360.0f;\n }\n sp0 = var_f18 * arg2;\n var_f16 = sp0;\n if ((arg4 <= sp0) || (temp_f18 = -arg4, (sp0 <= temp_f18))) {\n if (arg3 < sp0) {\n var_f16 = arg3;\n } else {\n temp_f18_2 = -arg3;\n if (sp0 < temp_f18_2) {\n var_f16 = temp_f18_2;\n }\n }\n *arg0 = temp_f0 + var_f16;\n if (var_f16 > 0.0f) {\n if (arg1 < *arg0) {\n *arg0 = arg1;\n }\n } else if (*arg0 < arg1) {\n *arg0 = arg1;\n }\n } else {\n var_f16 = arg4;\n if (sp0 > 0.0f) {\n *arg0 = temp_f0 + var_f16;\n if (arg1 < *arg0) {\n *arg0 = arg1;\n }\n } else {\n var_f16 = temp_f18;\n *arg0 = temp_f0 + temp_f18;\n if (*arg0 < arg1) {\n *arg0 = arg1;\n }\n }\n }\n }\n if (*arg0 >= 360.0f) {\n *arg0 -= 360.0f;\n }\n if (*arg0 < 0.0f) {\n *arg0 += 360.0f;\n }\n return var_f16;\n}\n","score":98,"maxScore":137,"compileErrors":null,"breakdown":{"insert":11,"delete":14,"replace":9,"opMismatch":0,"argMismatch":64},"quality":{"score":100,"lines":59,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":98,"maxScore":137,"ratio":0.7153284671532847,"kinds":{"insert":11,"delete":14,"replace":9,"opMismatch":0,"argMismatch":64}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc_a` — benchmark function af:add_calc_a:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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_a\n addiu\t$sp, $sp, -16\n sw\t$a2, 24($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$zero, $f2\n mtc1\t$a3, $f14\n c.eq.s\t$f12, $f0\n lui\t$at, 0x4334\n sub.s\t$f18, $f12, $f0\n mov.s\t$f16, $f2\n bc1tl\t.L1a0\n lui\t$at, 0x43b4\n mtc1\t$at, $f4\n lui\t$at, 0xc334\n c.lt.s\t$f4, $f18\n lwc1\t$f4, 24($sp)\n bc1fl\t.L64\n mtc1\t$at, $f8\n lui\t$at, 0x43b4\n mtc1\t$at, $f6\n nop\n sub.s\t$f18, $f6, $f18\n b\t.L84\n neg.s\t$f18, $f18\n mtc1\t$at, $f8\n.L64:\n lui\t$at, 0x43b4\n c.lt.s\t$f18, $f8\n nop\n bc1fl\t.L88\n mul.s\t$f6, $f18, $f4\n mtc1\t$at, $f10\n nop\n add.s\t$f18, $f10, $f18\n.L84:\n mul.s\t$f6, $f18, $f4\n.L88:\n lwc1\t$f10, 32($sp)\n swc1\t$f6, 0($sp)\n lwc1\t$f8, 0($sp)\n lwc1\t$f4, 0($sp)\n c.le.s\t$f10, $f8\n mov.s\t$f16, $f8\n bc1tl\t.Lc0\n c.lt.s\t$f14, $f4\n neg.s\t$f18, $f10\n c.le.s\t$f8, $f18\n lwc1\t$f8, 0($sp)\n bc1fl\t.L140\n c.lt.s\t$f2, $f8\n c.lt.s\t$f14, $f4\n.Lc0:\n lwc1\t$f6, 0($sp)\n bc1fl\t.Ld8\n neg.s\t$f18, $f14\n b\t.Lec\n mov.s\t$f16, $f14\n neg.s\t$f18, $f14\n.Ld8:\n c.lt.s\t$f6, $f18\n nop\n bc1fl\t.Lf0\n c.lt.s\t$f2, $f16\n mov.s\t$f16, $f18\n.Lec:\n c.lt.s\t$f2, $f16\n.Lf0:\n add.s\t$f10, $f0, $f16\n bc1f\t.L11c\n swc1\t$f10, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n.L11c:\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f2, $f8\n.L140:\n lwc1\t$f16, 32($sp)\n bc1fl\t.L178\n add.s\t$f10, $f0, $f18\n add.s\t$f6, $f0, $f16\n swc1\t$f6, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n b\t.L19c\n lwc1\t$f0, 0($a0)\n add.s\t$f10, $f0, $f18\n.L178:\n mov.s\t$f16, $f18\n swc1\t$f10, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L1a0\n lui\t$at, 0x43b4\n swc1\t$f12, 0($a0)\n lwc1\t$f0, 0($a0)\n.L19c:\n lui\t$at, 0x43b4\n.L1a0:\n mtc1\t$at, $f8\n lui\t$at, 0x43b4\n c.le.s\t$f8, $f0\n nop\n bc1fl\t.L1d0\n c.lt.s\t$f0, $f2\n mtc1\t$at, $f4\n nop\n sub.s\t$f6, $f0, $f4\n swc1\t$f6, 0($a0)\n lwc1\t$f0, 0($a0)\n c.lt.s\t$f0, $f2\n.L1d0:\n lui\t$at, 0x43b4\n bc1fl\t.L1f0\n mov.s\t$f0, $f16\n mtc1\t$at, $f10\n nop\n add.s\t$f8, $f0, $f10\n swc1\t$f8, 0($a0)\n mov.s\t$f0, $f16\n.L1f0:\n jr\t$ra\n addiu\t$sp, $sp, 16\nASM_INPUT\n\n# (This function ran with NO context header — the 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_a # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk 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_a` — benchmark function af:add_calc_a:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_a: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,-16\n 4:\tsw\ta2,24(sp)\n 8:\tmtc1\ta1,$f12\n c:\tlwc1\t$f0,0(a0)\n 10:\tmtc1\tzero,$f2\n 14:\tmtc1\ta3,$f14\n 18:\tc.eq.s\t$f12,$f0\n 1c:\tlui\tat,0x4334\n 20:\tsub.s\t$f18,$f12,$f0\n 24:\tmov.s\t$f16,$f2\n 28:\tbc1tl\t1a0 \n 2c:\tlui\tat,0x43b4\n 30:\tmtc1\tat,$f4\n 34:\tlui\tat,0xc334\n 38:\tc.lt.s\t$f4,$f18\n 3c:\tlwc1\t$f4,24(sp)\n 40:\tbc1fl\t64 \n 44:\tmtc1\tat,$f8\n 48:\tlui\tat,0x43b4\n 4c:\tmtc1\tat,$f6\n 50:\tnop\n 54:\tsub.s\t$f18,$f6,$f18\n 58:\tb\t84 \n 5c:\tneg.s\t$f18,$f18\n 60:\tmtc1\tat,$f8\n 64:\tlui\tat,0x43b4\n 68:\tc.lt.s\t$f18,$f8\n 6c:\tnop\n 70:\tbc1fl\t88 \n 74:\tmul.s\t$f6,$f18,$f4\n 78:\tmtc1\tat,$f10\n 7c:\tnop\n 80:\tadd.s\t$f18,$f10,$f18\n 84:\tmul.s\t$f6,$f18,$f4\n 88:\tlwc1\t$f10,32(sp)\n 8c:\tswc1\t$f6,0(sp)\n 90:\tlwc1\t$f8,0(sp)\n 94:\tlwc1\t$f4,0(sp)\n 98:\tc.le.s\t$f10,$f8\n 9c:\tmov.s\t$f16,$f8\n a0:\tbc1tl\tc0 \n a4:\tc.lt.s\t$f14,$f4\n a8:\tneg.s\t$f18,$f10\n ac:\tc.le.s\t$f8,$f18\n b0:\tlwc1\t$f8,0(sp)\n b4:\tbc1fl\t140 \n b8:\tc.lt.s\t$f2,$f8\n bc:\tc.lt.s\t$f14,$f4\n c0:\tlwc1\t$f6,0(sp)\n c4:\tbc1fl\td8 \n c8:\tneg.s\t$f18,$f14\n cc:\tb\tec \n d0:\tmov.s\t$f16,$f14\n d4:\tneg.s\t$f18,$f14\n d8:\tc.lt.s\t$f6,$f18\n dc:\tnop\n e0:\tbc1fl\tf0 \n e4:\tc.lt.s\t$f2,$f16\n e8:\tmov.s\t$f16,$f18\n ec:\tc.lt.s\t$f2,$f16\n f0:\tadd.s\t$f10,$f0,$f16\n f4:\tbc1f\t11c \n f8:\tswc1\t$f10,0(a0)\n fc:\tlwc1\t$f0,0(a0)\n 100:\tc.lt.s\t$f12,$f0\n 104:\tnop\n 108:\tbc1fl\t1a0 \n 10c:\tlui\tat,0x43b4\n 110:\tswc1\t$f12,0(a0)\n 114:\tb\t19c \n 118:\tlwc1\t$f0,0(a0)\n 11c:\tlwc1\t$f0,0(a0)\n 120:\tc.lt.s\t$f0,$f12\n 124:\tnop\n 128:\tbc1fl\t1a0 \n 12c:\tlui\tat,0x43b4\n 130:\tswc1\t$f12,0(a0)\n 134:\tb\t19c \n 138:\tlwc1\t$f0,0(a0)\n 13c:\tc.lt.s\t$f2,$f8\n 140:\tlwc1\t$f16,32(sp)\n 144:\tbc1fl\t178 \n 148:\tadd.s\t$f10,$f0,$f18\n 14c:\tadd.s\t$f6,$f0,$f16\n 150:\tswc1\t$f6,0(a0)\n 154:\tlwc1\t$f0,0(a0)\n 158:\tc.lt.s\t$f12,$f0\n 15c:\tnop\n 160:\tbc1fl\t1a0 \n 164:\tlui\tat,0x43b4\n 168:\tswc1\t$f12,0(a0)\n 16c:\tb\t19c \n 170:\tlwc1\t$f0,0(a0)\n 174:\tadd.s\t$f10,$f0,$f18\n 178:\tmov.s\t$f16,$f18\n 17c:\tswc1\t$f10,0(a0)\n 180:\tlwc1\t$f0,0(a0)\n 184:\tc.lt.s\t$f0,$f12\n 188:\tnop\n 18c:\tbc1fl\t1a0 \n 190:\tlui\tat,0x43b4\n 194:\tswc1\t$f12,0(a0)\n 198:\tlwc1\t$f0,0(a0)\n 19c:\tlui\tat,0x43b4\n 1a0:\tmtc1\tat,$f8\n 1a4:\tlui\tat,0x43b4\n 1a8:\tc.le.s\t$f8,$f0\n 1ac:\tnop\n 1b0:\tbc1fl\t1d0 \n 1b4:\tc.lt.s\t$f0,$f2\n 1b8:\tmtc1\tat,$f4\n 1bc:\tnop\n 1c0:\tsub.s\t$f6,$f0,$f4\n 1c4:\tswc1\t$f6,0(a0)\n 1c8:\tlwc1\t$f0,0(a0)\n 1cc:\tc.lt.s\t$f0,$f2\n 1d0:\tlui\tat,0x43b4\n 1d4:\tbc1fl\t1f0 \n 1d8:\tmov.s\t$f0,$f16\n 1dc:\tmtc1\tat,$f10\n 1e0:\tnop\n 1e4:\tadd.s\t$f8,$f0,$f10\n 1e8:\tswc1\t$f8,0(a0)\n 1ec:\tmov.s\t$f0,$f16\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,16\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000200 .text\n00000000 g F .text\t000001f8 add_calc_a\n\n\nContents of section .text:\n 0000 27bdfff0 afa60018 44856000 c4800000 '.......D.`.....\n 0010 44801000 44877000 46006032 3c014334 D...D.p.F.`2<.C4\n 0020 46006481 46001406 4503005d 3c0143b4 F.d.F...E..]<.C.\n 0030 44812000 3c01c334 4612203c c7a40018 D. .<..4F. <....\n 0040 45020008 44814000 3c0143b4 44813000 E...D.@.<.C.D.0.\n 0050 00000000 46123481 1000000a 46009487 ....F.4.....F...\n 0060 44814000 3c0143b4 4608903c 00000000 D.@.<.C.F..<....\n 0070 45020005 46049182 44815000 00000000 E...F...D.P.....\n 0080 46125480 46049182 c7aa0020 e7a60000 F.T.F...... ....\n 0090 c7a80000 c7a40000 4608503e 46004406 ........F.P>F.D.\n 00a0 45030007 4604703c 46005487 4612403e E...F.p\n 00b0 c7a80000 45020022 4608103c 4604703c ....E..\"F......\n 01b0 45020007 4602003c 44812000 00000000 E...F.. 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc_short_angle3\n sw\t$a1, 4($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n mtc1\t$a2, $f12\n beq\t$a1, $v1, .Lbc\n andi\t$v0, $v1, 0xffff\n andi\t$a3, $a1, 0xffff\n slt\t$at, $a3, $v0\n beqz\t$at, .L38\n move\t$a2, $a3\n lui\t$at, 0x1\n addu\t$a2, $a3, $at\n.L38:\n subu\t$t6, $a2, $v0\n mtc1\t$t6, $f4\n lh\t$t7, 14($sp)\n lh\t$t8, 18($sp)\n cvt.s.w\t$f6, $f4\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f14, $f8\n mul.s\t$f2, $f6, $f12\n c.lt.s\t$f14, $f2\n mov.s\t$f0, $f2\n bc1fl\t.L78\n mtc1\t$t8, $f10\n b\t.L94\n mov.s\t$f0, $f14\n mtc1\t$t8, $f10\n.L78:\n nop\n cvt.s.w\t$f12, $f10\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L98\n trunc.w.s\t$f16, $f0\n mov.s\t$f0, $f12\n.L94:\n trunc.w.s\t$f16, $f0\n.L98:\n mfc1\t$t0, $f16\n nop\n addu\t$a3, $t0, $v0\n slt\t$at, $a2, $a3\n beqzl\t$at, .Lb8\n sh\t$a3, 0($a0)\n move\t$a3, $a2\n sh\t$a3, 0($a0)\n.Lb8:\n lh\t$v1, 0($a0)\n.Lbc:\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc_short_angle3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc0:ido7.1","sym":"add_calc0","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":11,"refSource":"void add_calc0(f32* pValue, f32 fraction, f32 step) {\n f32 stepSize = *pValue * fraction;\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue -= stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\n","proto":{"add_calc0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc0' — lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f2,0(a0) */\n/* 8:\tmtc1\ta2,$f14 */\n/* c:\tmul.s\t$f0,$f2,$f12 */\n/* 10:\tc.lt.s\t$f14,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1fl\t2c */\n/* 1c:\tneg.s\t$f12,$f14 */\n/* 20:\tb\t40 */\n/* 24:\tmov.s\t$f0,$f14 */\n/* 28:\tneg.s\t$f12,$f14 */\n/* 2c:\tc.lt.s\t$f0,$f12 */\n/* 30:\tnop */\n/* 34:\tbc1fl\t44 */\n/* 38:\tsub.s\t$f4,$f2,$f0 */\n/* 3c:\tmov.s\t$f0,$f12 */\n/* 40:\tsub.s\t$f4,$f2,$f0 */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f4,0(a0) */\n/* 4c:\tnop */\nvoid add_calc0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc0(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f12;\n f32 temp_f2;\n f32 var_f0;\n\n temp_f2 = *arg0;\n var_f0 = temp_f2 * arg1;\n if (arg2 < var_f0) {\n var_f0 = arg2;\n } else {\n temp_f12 = -arg2;\n if (var_f0 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n *arg0 = temp_f2 - var_f0;\n}\n","score":15,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":21,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc0\n mtc1\t$a1, $f12\n lwc1\t$f2, 0($a0)\n mtc1\t$a2, $f14\n mul.s\t$f0, $f2, $f12\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L2c\n neg.s\t$f12, $f14\n b\t.L40\n mov.s\t$f0, $f14\n neg.s\t$f12, $f14\n.L2c:\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L44\n sub.s\t$f4, $f2, $f0\n mov.s\t$f0, $f12\n.L40:\n sub.s\t$f4, $f2, $f0\n.L44:\n jr\t$ra\n swc1\t$f4, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc2:ido7.1","sym":"add_calc2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":14,"refSource":"void add_calc2(f32* pValue, f32 target, f32 fraction, f32 step) {\n f32 stepSize;\n if (*pValue != target) {\n stepSize = fraction * (target - *pValue);\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\n","proto":{"add_calc2":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc2' — lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tc.eq.s\t$f12,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1t\t68 */\n/* 1c:\tnop */\n/* 20:\tsub.s\t$f4,$f12,$f0 */\n/* 24:\tlwc1\t$f6,12(sp) */\n/* 28:\tlwc1\t$f12,12(sp) */\n/* 2c:\tmul.s\t$f2,$f4,$f14 */\n/* 30:\tc.lt.s\t$f6,$f2 */\n/* 34:\tnop */\n/* 38:\tbc1fl\t4c */\n/* 3c:\tneg.s\t$f12,$f12 */\n/* 40:\tb\t60 */\n/* 44:\tmov.s\t$f2,$f6 */\n/* 48:\tneg.s\t$f12,$f12 */\n/* 4c:\tc.lt.s\t$f2,$f12 */\n/* 50:\tnop */\n/* 54:\tbc1fl\t64 */\n/* 58:\tadd.s\t$f8,$f0,$f2 */\n/* 5c:\tmov.s\t$f2,$f12 */\n/* 60:\tadd.s\t$f8,$f0,$f2 */\n/* 64:\tswc1\t$f8,0(a0) */\n/* 68:\tjr\tra */\n/* 6c:\tnop */\nvoid add_calc2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc2(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 temp_f12;\n f32 var_f2;\n\n temp_f0 = *arg0;\n if (arg1 != temp_f0) {\n var_f2 = (arg1 - temp_f0) * arg2;\n if (arg3 < var_f2) {\n var_f2 = arg3;\n } else {\n temp_f12 = -arg3;\n if (var_f2 < temp_f12) {\n var_f2 = temp_f12;\n }\n }\n *arg0 = temp_f0 + var_f2;\n }\n}\n","score":4,"maxScore":28,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":28,"ratio":0.14285714285714285,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc2\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n c.eq.s\t$f12, $f0\n nop\n bc1t\t.L68\n nop\n sub.s\t$f4, $f12, $f0\n lwc1\t$f6, 12($sp)\n lwc1\t$f12, 12($sp)\n mul.s\t$f2, $f4, $f14\n c.lt.s\t$f6, $f2\n nop\n bc1fl\t.L4c\n neg.s\t$f12, $f12\n b\t.L60\n mov.s\t$f2, $f6\n neg.s\t$f12, $f12\n.L4c:\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L64\n add.s\t$f8, $f0, $f2\n mov.s\t$f2, $f12\n.L60:\n add.s\t$f8, $f0, $f2\n.L64:\n swc1\t$f8, 0($a0)\n.L68:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:adds:ido7.1","sym":"adds","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","branch","pointer","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel adds\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n div\t$zero, $v0, $a2\n sll\t$a3, $a3, 0x10\n sra\t$a3, $a3, 0x10\n bnez\t$a2, .L44\n nop\n break\t0x7\n.L44:\n li\t$at, -1\n bne\t$a2, $at, .L5c\n lui\t$at, 0x8000\n bne\t$v0, $at, .L5c\n nop\n break\t0x6\n.L5c:\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$at, $a3, $v0\n beqz\t$at, .L80\n negu\t$t7, $a3\n addu\t$t6, $v1, $a3\n jr\t$ra\n sh\t$t6, 0($a0)\n.L80:\n slt\t$at, $v0, $t7\n beqz\t$at, .L98\n addu\t$t9, $v1, $v0\n subu\t$t8, $v1, $a3\n jr\t$ra\n sh\t$t8, 0($a0)\n.L98:\n sh\t$t9, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function adds # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:atans_table:ido7.1","sym":"atans_table","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":36,"refSource":"s16 atans_table(f32 x, f32 y) {\n s32 tbl;\n\n if (y >= 0.0f) {\n if (x >= 0.0f) {\n if (y <= x) {\n if (y != 0.0f) {\n tbl = U_GetAtanTable(y, x);\n } else {\n tbl = 0;\n }\n } else {\n tbl = 0x4000 - U_GetAtanTable(x, y);\n }\n } else {\n if (-x < y) {\n tbl = U_GetAtanTable(-x, y) + 0x4000;\n } else {\n tbl = 0x8000 - U_GetAtanTable(y, -x);\n }\n }\n } else if (x < 0.0f) {\n if (-y <= -x) {\n tbl = U_GetAtanTable(-y, -x) + 0x8000;\n } else {\n tbl = 0xC000 - U_GetAtanTable(-x, -y);\n }\n } else {\n if (x < -y) {\n tbl = U_GetAtanTable(x, -y) + 0xC000;\n } else {\n tbl = -U_GetAtanTable(-y, x);\n }\n }\n return tbl;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_math_atan.c#L101-L136","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f0\n 4:\taddiu\tsp,sp,-40\n 8:\tsdc1\t$f22,24(sp)\n c:\tc.le.s\t$f0,$f14\n 10:\tsdc1\t$f20,16(sp)\n 14:\tmov.s\t$f20,$f14\n 18:\tmov.s\t$f22,$f12\n 1c:\tbc1f\tc8 \n 20:\tsw\tra,36(sp)\n 24:\tc.le.s\t$f0,$f12\n 28:\tnop\n 2c:\tbc1fl\t8c \n 30:\tneg.s\t$f0,$f22\n 34:\tc.le.s\t$f14,$f12\n 38:\tnop\n 3c:\tbc1fl\t74 \n 40:\tcvt.d.s\t$f12,$f22\n 44:\tc.eq.s\t$f14,$f0\n 48:\tnop\n 4c:\tbc1t\t68 \n 50:\tnop\n 54:\tcvt.d.s\t$f12,$f14\n 58:\tjal\t0 \n 5c:\tcvt.d.s\t$f14,$f22\n 60:\tb\t15c \n 64:\tmove\tv1,v0\n 68:\tb\t15c \n 6c:\tmove\tv1,zero\n 70:\tcvt.d.s\t$f12,$f22\n 74:\tjal\t0 \n 78:\tcvt.d.s\t$f14,$f20\n 7c:\tli\tt6,16384\n 80:\tb\t15c \n 84:\tsubu\tv1,t6,v0\n 88:\tneg.s\t$f0,$f22\n 8c:\tc.lt.s\t$f0,$f20\n 90:\tnop\n 94:\tbc1fl\tb4 \n 98:\tcvt.d.s\t$f12,$f20\n 9c:\tcvt.d.s\t$f12,$f0\n a0:\tjal\t0 \n a4:\tcvt.d.s\t$f14,$f20\n a8:\tb\t15c \n ac:\taddiu\tv1,v0,16384\n b0:\tcvt.d.s\t$f12,$f20\n b4:\tjal\t0 \n b8:\tcvt.d.s\t$f14,$f0\n bc:\tli\tt7,0x8000\n c0:\tb\t15c \n c4:\tsubu\tv1,t7,v0\n c8:\tc.lt.s\t$f22,$f0\n cc:\tnop\n d0:\tbc1fl\t124 \n d4:\tneg.s\t$f2,$f20\n d8:\tneg.s\t$f0,$f22\n dc:\tneg.s\t$f2,$f20\n e0:\tc.le.s\t$f2,$f0\n e4:\tnop\n e8:\tbc1fl\t10c \n ec:\tcvt.d.s\t$f12,$f0\n f0:\tcvt.d.s\t$f12,$f2\n f4:\tjal\t0 \n f8:\tcvt.d.s\t$f14,$f0\n fc:\tli\tat,0x8000\n 100:\tb\t15c \n 104:\taddu\tv1,v0,at\n 108:\tcvt.d.s\t$f12,$f0\n 10c:\tjal\t0 \n 110:\tcvt.d.s\t$f14,$f2\n 114:\tli\tt8,0xc000\n 118:\tb\t15c \n 11c:\tsubu\tv1,t8,v0\n 120:\tneg.s\t$f2,$f20\n 124:\tc.lt.s\t$f22,$f2\n 128:\tnop\n 12c:\tbc1fl\t150 \n 130:\tcvt.d.s\t$f12,$f2\n 134:\tcvt.d.s\t$f12,$f22\n 138:\tjal\t0 \n 13c:\tcvt.d.s\t$f14,$f2\n 140:\tli\tat,0xc000\n 144:\tb\t15c \n 148:\taddu\tv1,v0,at\n 14c:\tcvt.d.s\t$f12,$f2\n 150:\tjal\t0 \n 154:\tcvt.d.s\t$f14,$f22\n 158:\tnegu\tv1,v0\n 15c:\tlw\tra,36(sp)\n 160:\tsll\tv0,v1,0x10\n 164:\tldc1\t$f20,16(sp)\n 168:\tldc1\t$f22,24(sp)\n 16c:\taddiu\tsp,sp,40\n 170:\tjr\tra\n 174:\tsra\tv0,v0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000180 .text\n00000000 g F .text\t00000178 atans_table\n00000000 F *UND*\t00000000 U_GetAtanTable\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000058 R_MIPS_26 U_GetAtanTable\n00000074 R_MIPS_26 U_GetAtanTable\n000000a0 R_MIPS_26 U_GetAtanTable\n000000b4 R_MIPS_26 U_GetAtanTable\n000000f4 R_MIPS_26 U_GetAtanTable\n0000010c R_MIPS_26 U_GetAtanTable\n00000138 R_MIPS_26 U_GetAtanTable\n00000150 R_MIPS_26 U_GetAtanTable\n\n\nContents of section .text:\n 0000 44800000 27bdffd8 f7b60018 460e003e D...'.......F..>\n 0010 f7b40010 46007506 46006586 4500002a ....F.u.F.e.E..*\n 0020 afbf0024 460c003e 00000000 45020017 ...$F..>....E...\n 0030 4600b007 460c703e 00000000 4502000d F...F.p>....E...\n 0040 4600b321 46007032 00000000 45010006 F..!F.p2....E...\n 0050 00000000 46007321 0c000000 4600b3a1 ....F.s!....F...\n 0060 1000003e 00401825 1000003c 00001825 ...>.@.%...<...%\n 0070 4600b321 0c000000 4600a3a1 240e4000 F..!....F...$.@.\n 0080 10000036 01c21823 4600b007 4614003c ...6...#F...F..<\n 0090 00000000 45020007 4600a321 46000321 ....E...F..!F..!\n 00a0 0c000000 4600a3a1 1000002c 24434000 ....F......,$C@.\n 00b0 4600a321 0c000000 460003a1 340f8000 F..!....F...4...\n 00c0 10000026 01e21823 4600b03c 00000000 ...&...#F..<....\n 00d0 45020014 4600a087 4600b007 4600a087 E...F...F...F...\n 00e0 4600103e 00000000 45020008 46000321 F..>....E...F..!\n 00f0 46001321 0c000000 460003a1 34018000 F..!....F...4...\n 0100 10000016 00411821 46000321 0c000000 .....A.!F..!....\n 0110 460013a1 3418c000 10000010 03021823 F...4..........#\n 0120 4600a087 4602b03c 00000000 45020008 F...F..<....E...\n 0130 46001321 4600b321 0c000000 460013a1 F..!F..!....F...\n 0140 3401c000 10000005 00411821 46001321 4........A.!F..!\n 0150 0c000000 4600b3a1 00021823 8fbf0024 ....F......#...$\n 0160 00031400 d7b40010 d7b60018 27bd0028 ............'..(\n 0170 03e00008 00021403 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c00e 00000000 . ..............\n 0010 00f0f00f 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c00e 00000000 00f0f00f 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000005e 00000018 00000358 p......^.......X\n 0010 00000006 000004d4 00000001 00000370 ...............p\n 0020 00000004 000003a4 00000000 00000000 ................\n 0030 00000011 000003d4 00000038 00000418 ...........8....\n 0040 0000001c 00000450 00000001 0000046c .......P.......l\n 0050 00000000 00000000 00000002 000004b4 ................\n 0060 0220e220 e0331313 14213534 14253315 . . .3...!54.%3.\n 0070 15253415 23360000 00000000 00000001 .%4.#6..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00f00000 fffffff0 00000028 001d001f ...........(....\n 00a0 0000001b 0000003c 00000000 00000001 .......<........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000178 20200001 . .....*...x ..\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 2d383437 63323165 31356433 -ido-847c21e15d3\n 0140 65666562 642f752e 69006174 616e735f efebd/u.i.atans_\n 0150 7461626c 65000000 6174616e 735f7461 table...atans_ta\n 0160 626c6500 555f4765 74417461 6e546162 ble.U_GetAtanTab\n 0170 6c650000 00000000 00000001 00000000 le..............\n 0180 00000036 00000000 00000004 00000000 ...6............\n 0190 0000005e 00000000 00000000 00000001 ...^............\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000016 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 0000000c 00000000 18cfffff 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 'atans_table' — lift: cannot lift 'atans_table': 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:\tmtc1\tzero,$f0 */\n/* 4:\taddiu\tsp,sp,-40 */\n/* 8:\tsdc1\t$f22,24(sp) */\n/* c:\tc.le.s\t$f0,$f14 */\n/* 10:\tsdc1\t$f20,16(sp) */\n/* 14:\tmov.s\t$f20,$f14 */\n/* 18:\tmov.s\t$f22,$f12 */\n/* 1c:\tbc1f\tc8 */\n/* 20:\tsw\tra,36(sp) */\n/* 24:\tc.le.s\t$f0,$f12 */\n/* 28:\tnop */\n/* 2c:\tbc1fl\t8c */\n/* 30:\tneg.s\t$f0,$f22 */\n/* 34:\tc.le.s\t$f14,$f12 */\n/* 38:\tnop */\n/* 3c:\tbc1fl\t74 */\n/* 40:\tcvt.d.s\t$f12,$f22 */\n/* 44:\tc.eq.s\t$f14,$f0 */\n/* 48:\tnop */\n/* 4c:\tbc1t\t68 */\n/* 50:\tnop */\n/* 54:\tcvt.d.s\t$f12,$f14 */\n/* 58:\tjal\t0 */\n/* 5c:\tcvt.d.s\t$f14,$f22 */\n/* 60:\tb\t15c */\n/* 64:\tmove\tv1,v0 */\n/* 68:\tb\t15c */\n/* 6c:\tmove\tv1,zero */\n/* 70:\tcvt.d.s\t$f12,$f22 */\n/* 74:\tjal\t0 */\n/* 78:\tcvt.d.s\t$f14,$f20 */\n/* 7c:\tli\tt6,16384 */\n/* 80:\tb\t15c */\n/* 84:\tsubu\tv1,t6,v0 */\n/* 88:\tneg.s\t$f0,$f22 */\n/* 8c:\tc.lt.s\t$f0,$f20 */\n/* 90:\tnop */\n/* 94:\tbc1fl\tb4 */\n/* 98:\tcvt.d.s\t$f12,$f20 */\n/* 9c:\tcvt.d.s\t$f12,$f0 */\n/* a0:\tjal\t0 */\n/* a4:\tcvt.d.s\t$f14,$f20 */\n/* a8:\tb\t15c */\n/* ac:\taddiu\tv1,v0,16384 */\n/* b0:\tcvt.d.s\t$f12,$f20 */\n/* b4:\tjal\t0 */\n/* b8:\tcvt.d.s\t$f14,$f0 */\n/* bc:\tli\tt7,0x8000 */\n/* c0:\tb\t15c */\n/* c4:\tsubu\tv1,t7,v0 */\n/* c8:\tc.lt.s\t$f22,$f0 */\n/* cc:\tnop */\n/* d0:\tbc1fl\t124 */\n/* d4:\tneg.s\t$f2,$f20 */\n/* d8:\tneg.s\t$f0,$f22 */\n/* dc:\tneg.s\t$f2,$f20 */\n/* e0:\tc.le.s\t$f2,$f0 */\n/* e4:\tnop */\n/* e8:\tbc1fl\t10c */\n/* ec:\tcvt.d.s\t$f12,$f0 */\n/* f0:\tcvt.d.s\t$f12,$f2 */\n/* f4:\tjal\t0 */\n/* f8:\tcvt.d.s\t$f14,$f0 */\n/* fc:\tli\tat,0x8000 */\n/* 100:\tb\t15c */\n/* 104:\taddu\tv1,v0,at */\n/* 108:\tcvt.d.s\t$f12,$f0 */\n/* 10c:\tjal\t0 */\n/* 110:\tcvt.d.s\t$f14,$f2 */\n/* 114:\tli\tt8,0xc000 */\n/* 118:\tb\t15c */\n/* 11c:\tsubu\tv1,t8,v0 */\n/* 120:\tneg.s\t$f2,$f20 */\n/* 124:\tc.lt.s\t$f22,$f2 */\n/* 128:\tnop */\n/* 12c:\tbc1fl\t150 */\n/* 130:\tcvt.d.s\t$f12,$f2 */\n/* 134:\tcvt.d.s\t$f12,$f22 */\n/* 138:\tjal\t0 */\n/* 13c:\tcvt.d.s\t$f14,$f2 */\n/* 140:\tli\tat,0xc000 */\n/* 144:\tb\t15c */\n/* 148:\taddu\tv1,v0,at */\n/* 14c:\tcvt.d.s\t$f12,$f2 */\n/* 150:\tjal\t0 */\n/* 154:\tcvt.d.s\t$f14,$f22 */\n/* 158:\tnegu\tv1,v0 */\n/* 15c:\tlw\tra,36(sp) */\n/* 160:\tsll\tv0,v1,0x10 */\n/* 164:\tldc1\t$f20,16(sp) */\n/* 168:\tldc1\t$f22,24(sp) */\n/* 16c:\taddiu\tsp,sp,40 */\n/* 170:\tjr\tra */\n/* 174:\tsra\tv0,v0,0x10 */\n/* \t... */\nvoid atans_table(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'atans_table': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":103,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'atans_table': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 U_GetAtanTable(f64, f64); /* extern */\n\ns16 atans_table(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 temp_f0_2;\n f32 temp_f2;\n f32 temp_f2_2;\n s16 var_v1;\n\n if (arg1 >= 0.0f) {\n if (arg0 >= 0.0f) {\n if (arg1 <= arg0) {\n if (arg1 != 0.0f) {\n var_v1 = U_GetAtanTable((f64) arg1, (f64) arg0);\n } else {\n var_v1 = 0;\n }\n } else {\n var_v1 = 0x4000 - U_GetAtanTable((f64) arg0, (f64) arg1);\n }\n } else {\n temp_f0 = -arg0;\n if (temp_f0 < arg1) {\n var_v1 = U_GetAtanTable((f64) temp_f0, (f64) arg1) + 0x4000;\n } else {\n var_v1 = 0x8000 - U_GetAtanTable((f64) arg1, (f64) temp_f0);\n }\n }\n } else if (arg0 < 0.0f) {\n temp_f0_2 = -arg0;\n temp_f2 = -arg1;\n if (temp_f2 <= temp_f0_2) {\n var_v1 = U_GetAtanTable((f64) temp_f2, (f64) temp_f0_2) + 0x8000;\n } else {\n var_v1 = 0xC000 - U_GetAtanTable((f64) temp_f0_2, (f64) temp_f2);\n }\n } else {\n temp_f2_2 = -arg1;\n if (arg0 < temp_f2_2) {\n var_v1 = U_GetAtanTable((f64) arg0, (f64) temp_f2_2) + 0xC000;\n } else {\n var_v1 = -U_GetAtanTable((f64) temp_f2_2, (f64) arg0);\n }\n }\n return var_v1;\n}\n","score":27,"maxScore":112,"compileErrors":null,"breakdown":{"insert":18,"delete":4,"replace":5,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":44,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":27,"maxScore":112,"ratio":0.24107142857142858,"kinds":{"insert":18,"delete":4,"replace":5,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `atans_table` — benchmark function af:atans_table:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel atans_table\n mtc1\t$zero, $f0\n addiu\t$sp, $sp, -40\n sdc1\t$f22, 24($sp)\n c.le.s\t$f0, $f14\n sdc1\t$f20, 16($sp)\n mov.s\t$f20, $f14\n mov.s\t$f22, $f12\n bc1f\t.Lc8\n sw\t$ra, 36($sp)\n c.le.s\t$f0, $f12\n nop\n bc1fl\t.L8c\n neg.s\t$f0, $f22\n c.le.s\t$f14, $f12\n nop\n bc1fl\t.L74\n cvt.d.s\t$f12, $f22\n c.eq.s\t$f14, $f0\n nop\n bc1t\t.L68\n nop\n cvt.d.s\t$f12, $f14\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f22\n b\t.L15c\n move\t$v1, $v0\n.L68:\n b\t.L15c\n move\t$v1, $zero\n cvt.d.s\t$f12, $f22\n.L74:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f20\n li\t$t6, 16384\n b\t.L15c\n subu\t$v1, $t6, $v0\n neg.s\t$f0, $f22\n.L8c:\n c.lt.s\t$f0, $f20\n nop\n bc1fl\t.Lb4\n cvt.d.s\t$f12, $f20\n cvt.d.s\t$f12, $f0\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f20\n b\t.L15c\n addiu\t$v1, $v0, 16384\n cvt.d.s\t$f12, $f20\n.Lb4:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f0\n li\t$t7, 0x8000\n b\t.L15c\n subu\t$v1, $t7, $v0\n.Lc8:\n c.lt.s\t$f22, $f0\n nop\n bc1fl\t.L124\n neg.s\t$f2, $f20\n neg.s\t$f0, $f22\n neg.s\t$f2, $f20\n c.le.s\t$f2, $f0\n nop\n bc1fl\t.L10c\n cvt.d.s\t$f12, $f0\n cvt.d.s\t$f12, $f2\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f0\n li\t$at, 0x8000\n b\t.L15c\n addu\t$v1, $v0, $at\n cvt.d.s\t$f12, $f0\n.L10c:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f2\n li\t$t8, 0xc000\n b\t.L15c\n subu\t$v1, $t8, $v0\n neg.s\t$f2, $f20\n.L124:\n c.lt.s\t$f22, $f2\n nop\n bc1fl\t.L150\n cvt.d.s\t$f12, $f2\n cvt.d.s\t$f12, $f22\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f2\n li\t$at, 0xc000\n b\t.L15c\n addu\t$v1, $v0, $at\n cvt.d.s\t$f12, $f2\n.L150:\n jal\tU_GetAtanTable\n cvt.d.s\t$f14, $f22\n negu\t$v1, $v0\n.L15c:\n lw\t$ra, 36($sp)\n sll\t$v0, $v1, 0x10\n ldc1\t$f20, 16($sp)\n ldc1\t$f22, 24($sp)\n addiu\t$sp, $sp, 40\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-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function atans_table # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `atans_table` — benchmark function af:atans_table:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:atans_table: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,$f0\n 4:\taddiu\tsp,sp,-40\n 8:\tsdc1\t$f22,24(sp)\n c:\tc.le.s\t$f0,$f14\n 10:\tsdc1\t$f20,16(sp)\n 14:\tmov.s\t$f20,$f14\n 18:\tmov.s\t$f22,$f12\n 1c:\tbc1f\tc8 \n 20:\tsw\tra,36(sp)\n 24:\tc.le.s\t$f0,$f12\n 28:\tnop\n 2c:\tbc1fl\t8c \n 30:\tneg.s\t$f0,$f22\n 34:\tc.le.s\t$f14,$f12\n 38:\tnop\n 3c:\tbc1fl\t74 \n 40:\tcvt.d.s\t$f12,$f22\n 44:\tc.eq.s\t$f14,$f0\n 48:\tnop\n 4c:\tbc1t\t68 \n 50:\tnop\n 54:\tcvt.d.s\t$f12,$f14\n 58:\tjal\t0 \n 5c:\tcvt.d.s\t$f14,$f22\n 60:\tb\t15c \n 64:\tmove\tv1,v0\n 68:\tb\t15c \n 6c:\tmove\tv1,zero\n 70:\tcvt.d.s\t$f12,$f22\n 74:\tjal\t0 \n 78:\tcvt.d.s\t$f14,$f20\n 7c:\tli\tt6,16384\n 80:\tb\t15c \n 84:\tsubu\tv1,t6,v0\n 88:\tneg.s\t$f0,$f22\n 8c:\tc.lt.s\t$f0,$f20\n 90:\tnop\n 94:\tbc1fl\tb4 \n 98:\tcvt.d.s\t$f12,$f20\n 9c:\tcvt.d.s\t$f12,$f0\n a0:\tjal\t0 \n a4:\tcvt.d.s\t$f14,$f20\n a8:\tb\t15c \n ac:\taddiu\tv1,v0,16384\n b0:\tcvt.d.s\t$f12,$f20\n b4:\tjal\t0 \n b8:\tcvt.d.s\t$f14,$f0\n bc:\tli\tt7,0x8000\n c0:\tb\t15c \n c4:\tsubu\tv1,t7,v0\n c8:\tc.lt.s\t$f22,$f0\n cc:\tnop\n d0:\tbc1fl\t124 \n d4:\tneg.s\t$f2,$f20\n d8:\tneg.s\t$f0,$f22\n dc:\tneg.s\t$f2,$f20\n e0:\tc.le.s\t$f2,$f0\n e4:\tnop\n e8:\tbc1fl\t10c \n ec:\tcvt.d.s\t$f12,$f0\n f0:\tcvt.d.s\t$f12,$f2\n f4:\tjal\t0 \n f8:\tcvt.d.s\t$f14,$f0\n fc:\tli\tat,0x8000\n 100:\tb\t15c \n 104:\taddu\tv1,v0,at\n 108:\tcvt.d.s\t$f12,$f0\n 10c:\tjal\t0 \n 110:\tcvt.d.s\t$f14,$f2\n 114:\tli\tt8,0xc000\n 118:\tb\t15c \n 11c:\tsubu\tv1,t8,v0\n 120:\tneg.s\t$f2,$f20\n 124:\tc.lt.s\t$f22,$f2\n 128:\tnop\n 12c:\tbc1fl\t150 \n 130:\tcvt.d.s\t$f12,$f2\n 134:\tcvt.d.s\t$f12,$f22\n 138:\tjal\t0 \n 13c:\tcvt.d.s\t$f14,$f2\n 140:\tli\tat,0xc000\n 144:\tb\t15c \n 148:\taddu\tv1,v0,at\n 14c:\tcvt.d.s\t$f12,$f2\n 150:\tjal\t0 \n 154:\tcvt.d.s\t$f14,$f22\n 158:\tnegu\tv1,v0\n 15c:\tlw\tra,36(sp)\n 160:\tsll\tv0,v1,0x10\n 164:\tldc1\t$f20,16(sp)\n 168:\tldc1\t$f22,24(sp)\n 16c:\taddiu\tsp,sp,40\n 170:\tjr\tra\n 174:\tsra\tv0,v0,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\t00000180 .text\n00000000 g F .text\t00000178 atans_table\n00000000 F *UND*\t00000000 U_GetAtanTable\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000058 R_MIPS_26 U_GetAtanTable\n00000074 R_MIPS_26 U_GetAtanTable\n000000a0 R_MIPS_26 U_GetAtanTable\n000000b4 R_MIPS_26 U_GetAtanTable\n000000f4 R_MIPS_26 U_GetAtanTable\n0000010c R_MIPS_26 U_GetAtanTable\n00000138 R_MIPS_26 U_GetAtanTable\n00000150 R_MIPS_26 U_GetAtanTable\n\n\nContents of section .text:\n 0000 44800000 27bdffd8 f7b60018 460e003e D...'.......F..>\n 0010 f7b40010 46007506 46006586 4500002a ....F.u.F.e.E..*\n 0020 afbf0024 460c003e 00000000 45020017 ...$F..>....E...\n 0030 4600b007 460c703e 00000000 4502000d F...F.p>....E...\n 0040 4600b321 46007032 00000000 45010006 F..!F.p2....E...\n 0050 00000000 46007321 0c000000 4600b3a1 ....F.s!....F...\n 0060 1000003e 00401825 1000003c 00001825 ...>.@.%...<...%\n 0070 4600b321 0c000000 4600a3a1 240e4000 F..!....F...$.@.\n 0080 10000036 01c21823 4600b007 4614003c ...6...#F...F..<\n 0090 00000000 45020007 4600a321 46000321 ....E...F..!F..!\n 00a0 0c000000 4600a3a1 1000002c 24434000 ....F......,$C@.\n 00b0 4600a321 0c000000 460003a1 340f8000 F..!....F...4...\n 00c0 10000026 01e21823 4600b03c 00000000 ...&...#F..<....\n 00d0 45020014 4600a087 4600b007 4600a087 E...F...F...F...\n 00e0 4600103e 00000000 45020008 46000321 F..>....E...F..!\n 00f0 46001321 0c000000 460003a1 34018000 F..!....F...4...\n 0100 10000016 00411821 46000321 0c000000 .....A.!F..!....\n 0110 460013a1 3418c000 10000010 03021823 F...4..........#\n 0120 4600a087 4602b03c 00000000 45020008 F...F..<....E...\n 0130 46001321 4600b321 0c000000 460013a1 F..!F..!....F...\n 0140 3401c000 10000005 00411821 46001321 4........A.!F..!\n 0150 0c000000 4600b3a1 00021823 8fbf0024 ....F......#...$\n 0160 00031400 d7b40010 d7b60018 27bd0028 ............'..(\n 0170 03e00008 00021403 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c00e 00000000 . ..............\n 0010 00f0f00f 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c00e 00000000 00f0f00f 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000005e 00000018 00000358 p......^.......X\n 0010 00000006 000004d4 00000001 00000370 ...............p\n 0020 00000004 000003a4 00000000 00000000 ................\n 0030 00000011 000003d4 00000038 00000418 ...........8....\n 0040 0000001c 00000450 00000001 0000046c .......P.......l\n 0050 00000000 00000000 00000002 000004b4 ................\n 0060 0220e220 e0331313 14213534 14253315 . . .3...!54.%3.\n 0070 15253415 23360000 00000000 00000001 .%4.#6..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00f00000 fffffff0 00000028 001d001f ...........(....\n 00a0 0000001b 0000003c 00000000 00000001 .......<........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000178 20200001 . .....*...x ..\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 2d383437 63323165 31356433 -ido-847c21e15d3\n 0140 65666562 642f752e 69006174 616e735f efebd/u.i.atans_\n 0150 7461626c 65000000 6174616e 735f7461 table...atans_ta\n 0160 626c6500 555f4765 74417461 6e546162 ble.U_GetAtanTab\n 0170 6c650000 00000000 00000001 00000000 le..............\n 0180 00000036 00000000 00000004 00000000 ...6............\n 0190 0000005e 00000000 00000000 00000001 ...^............\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000016 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 0000000c 00000000 18cfffff 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 atans_table # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_angle\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L98\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n lui\t$at, %hi(game_GameFrame_2F)\n lwc1\t$f0, %lo(game_GameFrame_2F)($at)\n subu\t$t6, $v0, $a1\n sll\t$t7, $t6, 0x10\n sra\t$t8, $t7, 0x10\n blezl\t$t8, .L4c\n mtc1\t$a2, $f4\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n mtc1\t$a2, $f4\n.L4c:\n nop\n cvt.s.w\t$f6, $f4\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t2, $f10\n nop\n addu\t$t3, $v0, $t2\n sh\t$t3, 0($a0)\n lh\t$t4, 0($a0)\n li\t$v0, 1\n subu\t$t5, $t4, $a1\n sll\t$t6, $t5, 0x10\n sra\t$t7, $t6, 0x10\n multu\t$t7, $a2\n mflo\t$t8\n bltzl\t$t8, .Lb0\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L98:\n lh\t$t9, 0($a0)\n bnel\t$a1, $t9, .Lb0\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lb0:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_angle # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f:ido7.1","sym":"chase_f","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f\n mtc1\t$a2, $f12\n mtc1\t$zero, $f4\n mtc1\t$a1, $f14\n c.eq.s\t$f12, $f4\n nop\n bc1tl\t.L6c\n lwc1\t$f4, 0($a0)\n lwc1\t$f0, 0($a0)\n li\t$v0, 1\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L3c\n add.s\t$f6, $f0, $f12\n neg.s\t$f12, $f12\n add.s\t$f6, $f0, $f12\n.L3c:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f14\n mul.s\t$f16, $f10, $f12\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f14, 0($a0)\n lwc1\t$f4, 0($a0)\n.L6c:\n c.eq.s\t$f14, $f4\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L88:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f3:ido7.1","sym":"chase_f3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","ternary"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f3\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n mtc1\t$zero, $f4\n c.le.s\t$f0, $f12\n lwc1\t$f2, 12($sp)\n bc1f\t.L2c\n nop\n b\t.L2c\n mov.s\t$f2, $f14\n.L2c:\n c.eq.s\t$f2, $f4\n nop\n bc1tl\t.L84\n c.eq.s\t$f12, $f0\n c.lt.s\t$f12, $f0\n li\t$v0, 1\n bc1fl\t.L54\n add.s\t$f6, $f0, $f2\n neg.s\t$f2, $f2\n add.s\t$f6, $f0, $f2\n.L54:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f12\n mul.s\t$f16, $f10, $f2\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f12, 0($a0)\n c.eq.s\t$f12, $f0\n.L84:\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L9c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s:ido7.1","sym":"chase_s","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"loc":19,"refSource":"s32 chase_s(s16* pValue, s16 target, s16 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s' — lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,64 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tslt\tat,a1,v0 */\n/* 24:\tbeqzl\tat,3c */\n/* 28:\taddu\tt6,v0,a2 */\n/* 2c:\tnegu\ta2,a2 */\n/* 30:\tsll\ta2,a2,0x10 */\n/* 34:\tsra\ta2,a2,0x10 */\n/* 38:\taddu\tt6,v0,a2 */\n/* 3c:\tsh\tt6,0(a0) */\n/* 40:\tlh\tt7,0(a0) */\n/* 44:\tli\tv0,1 */\n/* 48:\tsubu\tt8,t7,a1 */\n/* 4c:\tmultu\tt8,a2 */\n/* 50:\tmflo\tt9 */\n/* 54:\tbltzl\tt9,7c */\n/* 58:\tmove\tv0,zero */\n/* 5c:\tjr\tra */\n/* 60:\tsh\ta1,0(a0) */\n/* 64:\tlh\tt0,0(a0) */\n/* 68:\tbnel\ta1,t0,7c */\n/* 6c:\tmove\tv0,zero */\n/* 70:\tjr\tra */\n/* 74:\tli\tv0,1 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tnop */\n/* \t... */\nvoid chase_s(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if (arg1 < temp_v0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + var_a2;\n if (((*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":22,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":40,"ratio":0.55,"kinds":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L64\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n slt\t$at, $a1, $v0\n beqzl\t$at, .L3c\n addu\t$t6, $v0, $a2\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v0, $a2\n.L3c:\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n li\t$v0, 1\n subu\t$t8, $t7, $a1\n multu\t$t8, $a2\n mflo\t$t9\n bltzl\t$t9, .L7c\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L64:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .L7c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L7c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s2:ido7.1","sym":"chase_s2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","pointer","branch"],"loc":10,"refSource":"s32 chase_s2(s16* pValue, s16 limit, s16 step) {\n s16 prev = *pValue;\n\n *pValue += step;\n if ((*pValue - limit) * (prev - limit) <= 0) {\n *pValue = limit;\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 chase_s2(s16 * a0, s32 a1, s32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n","score":18,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":14},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s2(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = temp_v1 + arg2;\n if (((*arg0 - arg1) * (temp_v1 - arg1)) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n return 0;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s2\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n lh\t$v1, 0($a0)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v1, $a2\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$v0, $v1, 0x10\n sra\t$v0, $v0, 0x10\n subu\t$t9, $v0, $a1\n subu\t$t8, $t7, $a1\n multu\t$t8, $t9\n move\t$v0, $zero\n mflo\t$t0\n bgtz\t$t0, .L58\n nop\n sh\t$a1, 0($a0)\n jr\t$ra\n li\t$v0, 1\n.L58:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s3:ido7.1","sym":"chase_s3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s3\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .La4\n sra\t$a1, $a1, 0x10\n lh\t$v1, 0($a0)\n li\t$at, 0x8000\n lui\t$t7, 0xffff\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L40\n slt\t$at, $v0, $at\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n.L40:\n bnez\t$at, .L60\n negu\t$t6, $v0\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n ori\t$t7, $t7, 0x1\n sra\t$a2, $a2, 0x10\n b\t.L80\n subu\t$v0, $t7, $t6\n.L60:\n slti\t$at, $v0, -32767\n beqz\t$at, .L80\n nop\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n li\t$at, 0xffff\n sra\t$a2, $a2, 0x10\n addu\t$v0, $v0, $at\n.L80:\n multu\t$a2, $v0\n addu\t$t8, $v1, $a2\n sh\t$t8, 0($a0)\n li\t$v0, 1\n mflo\t$t9\n bgtzl\t$t9, .Lbc\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.La4:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .Lbc\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lbc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:check_percent_abs:ido7.1","sym":"check_percent_abs","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel check_percent_abs\n neg.s\t$f4, $f14\n sw\t$a2, 8($sp)\n c.le.s\t$f4, $f12\n sw\t$a3, 12($sp)\n lwc1\t$f6, 8($sp)\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n c.le.s\t$f12, $f14\n nop\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n mtc1\t$zero, $f0\n jr\t$ra\n nop\n c.le.s\t$f6, $f12\n.L3c:\n lui\t$at, 0x3f80\n lwc1\t$f8, 8($sp)\n bc1fl\t.L5c\n neg.s\t$f10, $f8\n mtc1\t$at, $f0\n jr\t$ra\n nop\n neg.s\t$f10, $f8\n.L5c:\n lui\t$at, 0xbf80\n c.le.s\t$f12, $f10\n lw\t$t6, 16($sp)\n bc1f\t.L7c\n nop\n mtc1\t$at, $f0\n jr\t$ra\n nop\n.L7c:\n beqz\t$t6, .Lbc\n lwc1\t$f10, 12($sp)\n mtc1\t$zero, $f16\n nop\n c.lt.s\t$f16, $f12\n nop\n bc1fl\t.Lb0\n add.s\t$f6, $f12, $f14\n sub.s\t$f18, $f12, $f14\n lwc1\t$f4, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f18, $f4\n add.s\t$f6, $f12, $f14\n.Lb0:\n lwc1\t$f8, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f6, $f8\n.Lbc:\n mul.s\t$f0, $f12, $f10\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function check_percent_abs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:get_percent_forAccelBrake:ido7.1","sym":"get_percent_forAccelBrake","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","arithmetic"],"loc":51,"refSource":"f32 get_percent_forAccelBrake(f32 x, f32 min, f32 max, f32 accelRange, f32 brakeRange) {\n f32 percent;\n f32 range;\n f32 cur;\n f32 scale;\n\n if (x >= max) {\n return 1.0f;\n }\n if (x <= min) {\n return 0.0f;\n }\n\n cur = x - min;\n range = max - min;\n\n if (range < accelRange + brakeRange) {\n return 0.0f;\n }\n\n scale = 1.0f / (2.0f * range - accelRange - brakeRange);\n\n if (accelRange != 0.0f) {\n if (cur <= accelRange) {\n percent = scale * cur * cur;\n percent /= accelRange;\n return percent;\n } else {\n percent = scale * accelRange;\n }\n } else {\n percent = 0.0f;\n }\n\n if (cur <= range - brakeRange) {\n percent += (scale * 2.0f) * (cur - accelRange);\n return percent;\n }\n\n percent += 2.0f * scale * (range - accelRange - brakeRange);\n\n if (brakeRange != 0.0f) {\n percent += scale * brakeRange;\n if (cur < range) {\n f32 left = range - cur;\n\n percent -= scale * left * left / brakeRange;\n }\n }\n return percent;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L673-L723","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ta2,40(sp)\n 8:\tlwc1\t$f4,40(sp)\n c:\tsdc1\t$f20,8(sp)\n 10:\tmtc1\ta3,$f20\n 14:\tc.le.s\t$f4,$f12\n 18:\tsdc1\t$f24,24(sp)\n 1c:\tsdc1\t$f22,16(sp)\n 20:\tlui\tat,0x3f80\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f12,$f14\n 2c:\tmtc1\tat,$f0\n 30:\tb\t154 \n 34:\tldc1\t$f20,8(sp)\n 38:\tc.le.s\t$f12,$f14\n 3c:\tlwc1\t$f6,40(sp)\n 40:\tbc1fl\t58 \n 44:\tlwc1\t$f2,48(sp)\n 48:\tmtc1\tzero,$f0\n 4c:\tb\t154 \n 50:\tldc1\t$f20,8(sp)\n 54:\tlwc1\t$f2,48(sp)\n 58:\tsub.s\t$f0,$f6,$f14\n 5c:\tadd.s\t$f8,$f20,$f2\n 60:\tc.lt.s\t$f0,$f8\n 64:\tnop\n 68:\tbc1fl\t80 \n 6c:\tadd.s\t$f4,$f0,$f0\n 70:\tmtc1\tzero,$f0\n 74:\tb\t154 \n 78:\tldc1\t$f20,8(sp)\n 7c:\tadd.s\t$f4,$f0,$f0\n 80:\tlui\tat,0x3f80\n 84:\tmtc1\tat,$f10\n 88:\tsub.s\t$f6,$f4,$f20\n 8c:\tmtc1\tzero,$f4\n 90:\tsub.s\t$f8,$f6,$f2\n 94:\tc.eq.s\t$f20,$f4\n 98:\tdiv.s\t$f24,$f10,$f8\n 9c:\tbc1t\td0 \n a0:\tmov.s\t$f18,$f24\n a4:\tsub.s\t$f16,$f12,$f14\n a8:\tc.le.s\t$f16,$f20\n ac:\tnop\n b0:\tbc1f\tc8 \n b4:\tnop\n b8:\tmul.s\t$f6,$f24,$f16\n bc:\tmul.s\t$f10,$f6,$f16\n c0:\tb\t150 \n c4:\tdiv.s\t$f0,$f10,$f20\n c8:\tb\td8 \n cc:\tmul.s\t$f22,$f24,$f20\n d0:\tmtc1\tzero,$f22\n d4:\tsub.s\t$f16,$f12,$f14\n d8:\tsub.s\t$f8,$f0,$f2\n dc:\tc.le.s\t$f16,$f8\n e0:\tnop\n e4:\tbc1fl\t104 \n e8:\tsub.s\t$f4,$f0,$f20\n ec:\tadd.s\t$f4,$f24,$f24\n f0:\tsub.s\t$f6,$f16,$f20\n f4:\tmul.s\t$f10,$f4,$f6\n f8:\tb\t150 \n fc:\tadd.s\t$f0,$f22,$f10\n 100:\tsub.s\t$f4,$f0,$f20\n 104:\tadd.s\t$f8,$f24,$f24\n 108:\tsub.s\t$f6,$f4,$f2\n 10c:\tmtc1\tzero,$f4\n 110:\tmul.s\t$f10,$f8,$f6\n 114:\tc.eq.s\t$f2,$f4\n 118:\tnop\n 11c:\tbc1t\t14c \n 120:\tadd.s\t$f22,$f22,$f10\n 124:\tmul.s\t$f8,$f24,$f2\n 128:\tc.lt.s\t$f16,$f0\n 12c:\tnop\n 130:\tbc1f\t14c \n 134:\tadd.s\t$f22,$f22,$f8\n 138:\tsub.s\t$f12,$f0,$f16\n 13c:\tmul.s\t$f6,$f18,$f12\n 140:\tmul.s\t$f10,$f6,$f12\n 144:\tdiv.s\t$f4,$f10,$f2\n 148:\tsub.s\t$f22,$f22,$f4\n 14c:\tmov.s\t$f0,$f22\n 150:\tldc1\t$f20,8(sp)\n 154:\tldc1\t$f22,16(sp)\n 158:\tldc1\t$f24,24(sp)\n 15c:\tjr\tra\n 160:\taddiu\tsp,sp,32\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000170 .text\n00000000 g F .text\t00000164 get_percent_forAccelBrake\n\n\nContents of section .text:\n 0000 27bdffe0 afa60028 c7a40028 f7b40008 '......(...(....\n 0010 4487a000 460c203e f7b80018 f7b60010 D...F. >........\n 0020 3c013f80 45020005 460e603e 44810000 <.?.E...F.`>D...\n 0030 10000048 d7b40008 460e603e c7a60028 ...H....F.`>...(\n 0040 45020005 c7a20030 44800000 10000041 E......0D......A\n 0050 d7b40008 c7a20030 460e3001 4602a200 .......0F.0.F...\n 0060 4608003c 00000000 45020005 46000100 F..<....E...F...\n 0070 44800000 10000037 d7b40008 46000100 D......7....F...\n 0080 3c013f80 44815000 46142181 44802000 <.?.D.P.F.!.D. .\n 0090 46023201 4604a032 46085603 4501000c F.2.F..2F.V.E...\n 00a0 4600c486 460e6401 4614803e 00000000 F...F.d.F..>....\n 00b0 45000005 00000000 4610c182 46103282 E.......F...F.2.\n 00c0 10000023 46145003 10000003 4614c582 ...#F.P.....F...\n 00d0 4480b000 460e6401 46020201 4608803e D...F.d.F...F..>\n 00e0 00000000 45020007 46140101 4618c100 ....E...F...F...\n 00f0 46148181 46062282 10000015 460ab000 F...F.\".....F...\n 0100 46140101 4618c200 46022181 44802000 F...F...F.!.D. .\n 0110 46064282 46041032 00000000 4501000b F.B.F..2....E...\n 0120 460ab580 4602c202 4600803c 00000000 F...F...F..<....\n 0130 45000006 4608b580 46100301 460c9182 E...F...F...F...\n 0140 460c3282 46025103 4604b581 4600b006 F.2.F.Q.F...F...\n 0150 d7b40008 d7b60010 d7b80018 03e00008 ................\n 0160 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .options:\n 0000 01200000 00000000 a00000c2 00000000 . ..............\n 0010 03ff7ff7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000c2 00000000 03ff7ff7 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000059 00000028 000002e8 p......Y...(....\n 0010 00000005 00000470 00000001 00000310 .......p........\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000044 000003b8 .......t...D....\n 0040 0000001c 000003fc 00000001 00000418 ................\n 0050 00000000 00000000 00000001 00000460 ...............`\n 0060 0150b150 b160f112 2050b113 45122310 .P.P.`.. P..E.#.\n 0070 f010f010 f0243321 31241210 f03210f0 .....$3!1$...2..\n 0080 12f02012 f0343500 00000000 00000001 .. ..45.........\n 0090 00000000 00000000 00000000 ffffffff ................\n 00a0 03f00000 fffffff8 00000020 001d001f ........... ....\n 00b0 0000001b 00000043 00000000 00000001 .......C........\n 00c0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00d0 1820000f 0000002a 00000164 20200001 . .....*...d ..\n 00e0 00000001 00000000 20200000 02000000 ........ ......\n 00f0 03000000 04000000 05000000 06000000 ................\n 0100 07000000 08000000 09000000 20000000 ............ ...\n 0110 21000000 0a000000 0b000000 0b000000 !...............\n 0120 1a000000 00000000 00000003 06000000 ................\n 0130 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0140 2d69646f 2d333330 63613265 65353238 -ido-330ca2ee528\n 0150 65386162 302f752e 69006765 745f7065 e8ab0/u.i.get_pe\n 0160 7263656e 745f666f 72416363 656c4272 rcent_forAccelBr\n 0170 616b6500 6765745f 70657263 656e745f ake.get_percent_\n 0180 666f7241 6363656c 4272616b 65000000 forAccelBrake...\n 0190 00000000 00000001 00000000 00000044 ...............D\n 01a0 00000000 00000004 00000000 00000059 ...............Y\n 01b0 00000000 00000000 00000001 00000000 ................\n 01c0 00000011 00000000 00000000 01800000 ................\n 01d0 00000000 00000027 00000000 00000000 .......'........\n 01e0 00000000 18200001 00000000 00000000 ..... ..........\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'get_percent_forAccelBrake' — lift: cannot lift 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' 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:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ta2,40(sp) */\n/* 8:\tlwc1\t$f4,40(sp) */\n/* c:\tsdc1\t$f20,8(sp) */\n/* 10:\tmtc1\ta3,$f20 */\n/* 14:\tc.le.s\t$f4,$f12 */\n/* 18:\tsdc1\t$f24,24(sp) */\n/* 1c:\tsdc1\t$f22,16(sp) */\n/* 20:\tlui\tat,0x3f80 */\n/* 24:\tbc1fl\t3c */\n/* 28:\tc.le.s\t$f12,$f14 */\n/* 2c:\tmtc1\tat,$f0 */\n/* 30:\tb\t154 */\n/* 34:\tldc1\t$f20,8(sp) */\n/* 38:\tc.le.s\t$f12,$f14 */\n/* 3c:\tlwc1\t$f6,40(sp) */\n/* 40:\tbc1fl\t58 */\n/* 44:\tlwc1\t$f2,48(sp) */\n/* 48:\tmtc1\tzero,$f0 */\n/* 4c:\tb\t154 */\n/* 50:\tldc1\t$f20,8(sp) */\n/* 54:\tlwc1\t$f2,48(sp) */\n/* 58:\tsub.s\t$f0,$f6,$f14 */\n/* 5c:\tadd.s\t$f8,$f20,$f2 */\n/* 60:\tc.lt.s\t$f0,$f8 */\n/* 64:\tnop */\n/* 68:\tbc1fl\t80 */\n/* 6c:\tadd.s\t$f4,$f0,$f0 */\n/* 70:\tmtc1\tzero,$f0 */\n/* 74:\tb\t154 */\n/* 78:\tldc1\t$f20,8(sp) */\n/* 7c:\tadd.s\t$f4,$f0,$f0 */\n/* 80:\tlui\tat,0x3f80 */\n/* 84:\tmtc1\tat,$f10 */\n/* 88:\tsub.s\t$f6,$f4,$f20 */\n/* 8c:\tmtc1\tzero,$f4 */\n/* 90:\tsub.s\t$f8,$f6,$f2 */\n/* 94:\tc.eq.s\t$f20,$f4 */\n/* 98:\tdiv.s\t$f24,$f10,$f8 */\n/* 9c:\tbc1t\td0 */\n/* a0:\tmov.s\t$f18,$f24 */\n/* a4:\tsub.s\t$f16,$f12,$f14 */\n/* a8:\tc.le.s\t$f16,$f20 */\n/* ac:\tnop */\n/* b0:\tbc1f\tc8 */\n/* b4:\tnop */\n/* b8:\tmul.s\t$f6,$f24,$f16 */\n/* bc:\tmul.s\t$f10,$f6,$f16 */\n/* c0:\tb\t150 */\n/* c4:\tdiv.s\t$f0,$f10,$f20 */\n/* c8:\tb\td8 */\n/* cc:\tmul.s\t$f22,$f24,$f20 */\n/* d0:\tmtc1\tzero,$f22 */\n/* d4:\tsub.s\t$f16,$f12,$f14 */\n/* d8:\tsub.s\t$f8,$f0,$f2 */\n/* dc:\tc.le.s\t$f16,$f8 */\n/* e0:\tnop */\n/* e4:\tbc1fl\t104 */\n/* e8:\tsub.s\t$f4,$f0,$f20 */\n/* ec:\tadd.s\t$f4,$f24,$f24 */\n/* f0:\tsub.s\t$f6,$f16,$f20 */\n/* f4:\tmul.s\t$f10,$f4,$f6 */\n/* f8:\tb\t150 */\n/* fc:\tadd.s\t$f0,$f22,$f10 */\n/* 100:\tsub.s\t$f4,$f0,$f20 */\n/* 104:\tadd.s\t$f8,$f24,$f24 */\n/* 108:\tsub.s\t$f6,$f4,$f2 */\n/* 10c:\tmtc1\tzero,$f4 */\n/* 110:\tmul.s\t$f10,$f8,$f6 */\n/* 114:\tc.eq.s\t$f2,$f4 */\n/* 118:\tnop */\n/* 11c:\tbc1t\t14c */\n/* 120:\tadd.s\t$f22,$f22,$f10 */\n/* 124:\tmul.s\t$f8,$f24,$f2 */\n/* 128:\tc.lt.s\t$f16,$f0 */\n/* 12c:\tnop */\n/* 130:\tbc1f\t14c */\n/* 134:\tadd.s\t$f22,$f22,$f8 */\n/* 138:\tsub.s\t$f12,$f0,$f16 */\n/* 13c:\tmul.s\t$f6,$f18,$f12 */\n/* 140:\tmul.s\t$f10,$f6,$f12 */\n/* 144:\tdiv.s\t$f4,$f10,$f2 */\n/* 148:\tsub.s\t$f22,$f22,$f4 */\n/* 14c:\tmov.s\t$f0,$f22 */\n/* 150:\tldc1\t$f20,8(sp) */\n/* 154:\tldc1\t$f22,16(sp) */\n/* 158:\tldc1\t$f24,24(sp) */\n/* 15c:\tjr\tra */\n/* 160:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid get_percent_forAccelBrake(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' at 0x24 — branch-likely / coprocessor branch not supported\");\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 'get_percent_forAccelBrake': unmodelled control transfer 'bc1fl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 get_percent_forAccelBrake(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {\n f32 temp_f0;\n f32 temp_f12;\n f32 temp_f24;\n f32 var_f16;\n f32 var_f22;\n f32 var_f22_2;\n\n if (arg2 <= arg0) {\n return 1.0f;\n }\n if (arg0 <= arg1) {\n return 0.0f;\n }\n temp_f0 = arg2 - arg1;\n if (temp_f0 < (arg3 + arg4)) {\n return 0.0f;\n }\n temp_f24 = 1.0f / (((2.0f * temp_f0) - arg3) - arg4);\n if (arg3 != 0.0f) {\n var_f16 = arg0 - arg1;\n if (var_f16 <= arg3) {\n return (temp_f24 * var_f16 * var_f16) / arg3;\n }\n var_f22_2 = temp_f24 * arg3;\n goto block_11;\n }\n var_f22_2 = 0.0f;\n var_f16 = arg0 - arg1;\nblock_11:\n if (var_f16 <= (temp_f0 - arg4)) {\n return var_f22_2 + (2.0f * temp_f24 * (var_f16 - arg3));\n }\n var_f22 = var_f22_2 + (2.0f * temp_f24 * ((temp_f0 - arg3) - arg4));\n if (arg4 != 0.0f) {\n var_f22 += temp_f24 * arg4;\n if (var_f16 < temp_f0) {\n temp_f12 = temp_f0 - var_f16;\n var_f22 -= (temp_f24 * temp_f12 * temp_f12) / arg4;\n }\n }\n return var_f22;\n}\n","score":78,"maxScore":106,"compileErrors":null,"breakdown":{"insert":17,"delete":7,"replace":8,"opMismatch":0,"argMismatch":46},"quality":{"score":88,"lines":42,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":78,"maxScore":106,"ratio":0.7358490566037735,"kinds":{"insert":17,"delete":7,"replace":8,"opMismatch":0,"argMismatch":46}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `get_percent_forAccelBrake` — benchmark function af:get_percent_forAccelBrake:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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_forAccelBrake\n addiu\t$sp, $sp, -32\n sw\t$a2, 40($sp)\n lwc1\t$f4, 40($sp)\n sdc1\t$f20, 8($sp)\n mtc1\t$a3, $f20\n c.le.s\t$f4, $f12\n sdc1\t$f24, 24($sp)\n sdc1\t$f22, 16($sp)\n lui\t$at, 0x3f80\n bc1fl\t.L3c\n c.le.s\t$f12, $f14\n mtc1\t$at, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n c.le.s\t$f12, $f14\n.L3c:\n lwc1\t$f6, 40($sp)\n bc1fl\t.L58\n lwc1\t$f2, 48($sp)\n mtc1\t$zero, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n lwc1\t$f2, 48($sp)\n.L58:\n sub.s\t$f0, $f6, $f14\n add.s\t$f8, $f20, $f2\n c.lt.s\t$f0, $f8\n nop\n bc1fl\t.L80\n add.s\t$f4, $f0, $f0\n mtc1\t$zero, $f0\n b\t.L154\n ldc1\t$f20, 8($sp)\n add.s\t$f4, $f0, $f0\n.L80:\n lui\t$at, 0x3f80\n mtc1\t$at, $f10\n sub.s\t$f6, $f4, $f20\n mtc1\t$zero, $f4\n sub.s\t$f8, $f6, $f2\n c.eq.s\t$f20, $f4\n div.s\t$f24, $f10, $f8\n bc1t\t.Ld0\n mov.s\t$f18, $f24\n sub.s\t$f16, $f12, $f14\n c.le.s\t$f16, $f20\n nop\n bc1f\t.Lc8\n nop\n mul.s\t$f6, $f24, $f16\n mul.s\t$f10, $f6, $f16\n b\t.L150\n div.s\t$f0, $f10, $f20\n.Lc8:\n b\t.Ld8\n mul.s\t$f22, $f24, $f20\n.Ld0:\n mtc1\t$zero, $f22\n sub.s\t$f16, $f12, $f14\n.Ld8:\n sub.s\t$f8, $f0, $f2\n c.le.s\t$f16, $f8\n nop\n bc1fl\t.L104\n sub.s\t$f4, $f0, $f20\n add.s\t$f4, $f24, $f24\n sub.s\t$f6, $f16, $f20\n mul.s\t$f10, $f4, $f6\n b\t.L150\n add.s\t$f0, $f22, $f10\n sub.s\t$f4, $f0, $f20\n.L104:\n add.s\t$f8, $f24, $f24\n sub.s\t$f6, $f4, $f2\n mtc1\t$zero, $f4\n mul.s\t$f10, $f8, $f6\n c.eq.s\t$f2, $f4\n nop\n bc1t\t.L14c\n add.s\t$f22, $f22, $f10\n mul.s\t$f8, $f24, $f2\n c.lt.s\t$f16, $f0\n nop\n bc1f\t.L14c\n add.s\t$f22, $f22, $f8\n sub.s\t$f12, $f0, $f16\n mul.s\t$f6, $f18, $f12\n mul.s\t$f10, $f6, $f12\n div.s\t$f4, $f10, $f2\n sub.s\t$f22, $f22, $f4\n.L14c:\n mov.s\t$f0, $f22\n.L150:\n ldc1\t$f20, 8($sp)\n.L154:\n ldc1\t$f22, 16($sp)\n ldc1\t$f24, 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-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent_forAccelBrake # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk 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_forAccelBrake` — benchmark function af:get_percent_forAccelBrake:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent_forAccelBrake: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,-32\n 4:\tsw\ta2,40(sp)\n 8:\tlwc1\t$f4,40(sp)\n c:\tsdc1\t$f20,8(sp)\n 10:\tmtc1\ta3,$f20\n 14:\tc.le.s\t$f4,$f12\n 18:\tsdc1\t$f24,24(sp)\n 1c:\tsdc1\t$f22,16(sp)\n 20:\tlui\tat,0x3f80\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f12,$f14\n 2c:\tmtc1\tat,$f0\n 30:\tb\t154 \n 34:\tldc1\t$f20,8(sp)\n 38:\tc.le.s\t$f12,$f14\n 3c:\tlwc1\t$f6,40(sp)\n 40:\tbc1fl\t58 \n 44:\tlwc1\t$f2,48(sp)\n 48:\tmtc1\tzero,$f0\n 4c:\tb\t154 \n 50:\tldc1\t$f20,8(sp)\n 54:\tlwc1\t$f2,48(sp)\n 58:\tsub.s\t$f0,$f6,$f14\n 5c:\tadd.s\t$f8,$f20,$f2\n 60:\tc.lt.s\t$f0,$f8\n 64:\tnop\n 68:\tbc1fl\t80 \n 6c:\tadd.s\t$f4,$f0,$f0\n 70:\tmtc1\tzero,$f0\n 74:\tb\t154 \n 78:\tldc1\t$f20,8(sp)\n 7c:\tadd.s\t$f4,$f0,$f0\n 80:\tlui\tat,0x3f80\n 84:\tmtc1\tat,$f10\n 88:\tsub.s\t$f6,$f4,$f20\n 8c:\tmtc1\tzero,$f4\n 90:\tsub.s\t$f8,$f6,$f2\n 94:\tc.eq.s\t$f20,$f4\n 98:\tdiv.s\t$f24,$f10,$f8\n 9c:\tbc1t\td0 \n a0:\tmov.s\t$f18,$f24\n a4:\tsub.s\t$f16,$f12,$f14\n a8:\tc.le.s\t$f16,$f20\n ac:\tnop\n b0:\tbc1f\tc8 \n b4:\tnop\n b8:\tmul.s\t$f6,$f24,$f16\n bc:\tmul.s\t$f10,$f6,$f16\n c0:\tb\t150 \n c4:\tdiv.s\t$f0,$f10,$f20\n c8:\tb\td8 \n cc:\tmul.s\t$f22,$f24,$f20\n d0:\tmtc1\tzero,$f22\n d4:\tsub.s\t$f16,$f12,$f14\n d8:\tsub.s\t$f8,$f0,$f2\n dc:\tc.le.s\t$f16,$f8\n e0:\tnop\n e4:\tbc1fl\t104 \n e8:\tsub.s\t$f4,$f0,$f20\n ec:\tadd.s\t$f4,$f24,$f24\n f0:\tsub.s\t$f6,$f16,$f20\n f4:\tmul.s\t$f10,$f4,$f6\n f8:\tb\t150 \n fc:\tadd.s\t$f0,$f22,$f10\n 100:\tsub.s\t$f4,$f0,$f20\n 104:\tadd.s\t$f8,$f24,$f24\n 108:\tsub.s\t$f6,$f4,$f2\n 10c:\tmtc1\tzero,$f4\n 110:\tmul.s\t$f10,$f8,$f6\n 114:\tc.eq.s\t$f2,$f4\n 118:\tnop\n 11c:\tbc1t\t14c \n 120:\tadd.s\t$f22,$f22,$f10\n 124:\tmul.s\t$f8,$f24,$f2\n 128:\tc.lt.s\t$f16,$f0\n 12c:\tnop\n 130:\tbc1f\t14c \n 134:\tadd.s\t$f22,$f22,$f8\n 138:\tsub.s\t$f12,$f0,$f16\n 13c:\tmul.s\t$f6,$f18,$f12\n 140:\tmul.s\t$f10,$f6,$f12\n 144:\tdiv.s\t$f4,$f10,$f2\n 148:\tsub.s\t$f22,$f22,$f4\n 14c:\tmov.s\t$f0,$f22\n 150:\tldc1\t$f20,8(sp)\n 154:\tldc1\t$f22,16(sp)\n 158:\tldc1\t$f24,24(sp)\n 15c:\tjr\tra\n 160:\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 d .text\t00000170 .text\n00000000 g F .text\t00000164 get_percent_forAccelBrake\n\n\nContents of section .text:\n 0000 27bdffe0 afa60028 c7a40028 f7b40008 '......(...(....\n 0010 4487a000 460c203e f7b80018 f7b60010 D...F. >........\n 0020 3c013f80 45020005 460e603e 44810000 <.?.E...F.`>D...\n 0030 10000048 d7b40008 460e603e c7a60028 ...H....F.`>...(\n 0040 45020005 c7a20030 44800000 10000041 E......0D......A\n 0050 d7b40008 c7a20030 460e3001 4602a200 .......0F.0.F...\n 0060 4608003c 00000000 45020005 46000100 F..<....E...F...\n 0070 44800000 10000037 d7b40008 46000100 D......7....F...\n 0080 3c013f80 44815000 46142181 44802000 <.?.D.P.F.!.D. .\n 0090 46023201 4604a032 46085603 4501000c F.2.F..2F.V.E...\n 00a0 4600c486 460e6401 4614803e 00000000 F...F.d.F..>....\n 00b0 45000005 00000000 4610c182 46103282 E.......F...F.2.\n 00c0 10000023 46145003 10000003 4614c582 ...#F.P.....F...\n 00d0 4480b000 460e6401 46020201 4608803e D...F.d.F...F..>\n 00e0 00000000 45020007 46140101 4618c100 ....E...F...F...\n 00f0 46148181 46062282 10000015 460ab000 F...F.\".....F...\n 0100 46140101 4618c200 46022181 44802000 F...F...F.!.D. .\n 0110 46064282 46041032 00000000 4501000b F.B.F..2....E...\n 0120 460ab580 4602c202 4600803c 00000000 F...F...F..<....\n 0130 45000006 4608b580 46100301 460c9182 E...F...F...F...\n 0140 460c3282 46025103 4604b581 4600b006 F.2.F.Q.F...F...\n 0150 d7b40008 d7b60010 d7b80018 03e00008 ................\n 0160 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .options:\n 0000 01200000 00000000 a00000c2 00000000 . ..............\n 0010 03ff7ff7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000c2 00000000 03ff7ff7 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000059 00000028 000002e8 p......Y...(....\n 0010 00000005 00000470 00000001 00000310 .......p........\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000044 000003b8 .......t...D....\n 0040 0000001c 000003fc 00000001 00000418 ................\n 0050 00000000 00000000 00000001 00000460 ...............`\n 0060 0150b150 b160f112 2050b113 45122310 .P.P.`.. P..E.#.\n 0070 f010f010 f0243321 31241210 f03210f0 .....$3!1$...2..\n 0080 12f02012 f0343500 00000000 00000001 .. ..45.........\n 0090 00000000 00000000 00000000 ffffffff ................\n 00a0 03f00000 fffffff8 00000020 001d001f ........... ....\n 00b0 0000001b 00000043 00000000 00000001 .......C........\n 00c0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00d0 1820000f 0000002a 00000164 20200001 . .....*...d ..\n 00e0 00000001 00000000 20200000 02000000 ........ ......\n 00f0 03000000 04000000 05000000 06000000 ................\n 0100 07000000 08000000 09000000 20000000 ............ ...\n 0110 21000000 0a000000 0b000000 0b000000 !...............\n 0120 1a000000 00000000 00000003 06000000 ................\n 0130 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0140 2d69646f 2d333330 63613265 65353238 -ido-330ca2ee528\n 0150 65386162 302f752e 69006765 745f7065 e8ab0/u.i.get_pe\n 0160 7263656e 745f666f 72416363 656c4272 rcent_forAccelBr\n 0170 616b6500 6765745f 70657263 656e745f ake.get_percent_\n 0180 666f7241 6363656c 4272616b 65000000 forAccelBrake...\n 0190 00000000 00000001 00000000 00000044 ...............D\n 01a0 00000000 00000004 00000000 00000059 ...............Y\n 01b0 00000000 00000000 00000001 00000000 ................\n 01c0 00000011 00000000 00000000 01800000 ................\n 01d0 00000000 00000027 00000000 00000000 .......'........\n 01e0 00000000 18200001 00000000 00000000 ..... ..........\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 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_forAccelBrake # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel get_percent\n lui\t$at, 0x3f80\n mtc1\t$at, $f14\n slt\t$at, $a2, $a1\n beqz\t$at, .L20\n mov.s\t$f2, $f14\n mtc1\t$zero, $f2\n jr\t$ra\n mov.s\t$f0, $f2\n.L20:\n slt\t$at, $a2, $a0\n beqz\t$at, .L70\n subu\t$t6, $a0, $a1\n mtc1\t$t6, $f4\n mtc1\t$zero, $f6\n subu\t$t7, $a2, $a1\n cvt.s.w\t$f0, $f4\n c.eq.s\t$f6, $f0\n nop\n bc1t\t.L70\n nop\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f10, $f8\n div.s\t$f2, $f10, $f0\n c.lt.s\t$f14, $f2\n nop\n bc1f\t.L70\n nop\n mov.s\t$f2, $f14\n.L70:\n jr\t$ra\n mov.s\t$f0, $f2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:gfxopen:ido7.1","sym":"gfxopen","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","arithmetic"],"loc":3,"refSource":"Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 gfxopen(u32 a0) {\n return a0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gfxopen(s32 arg0) {\n return arg0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gfxopen\n jr\t$ra\n addiu\t$v0, $a0, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gfxopen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:inter_float:ido7.1","sym":"inter_float","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inter_float\n mtc1\t$a1, $f12\n bgtzl\t$a2, .L18\n mtc1\t$a2, $f4\n jr\t$ra\n swc1\t$f12, 0($a0)\n mtc1\t$a2, $f4\n.L18:\n lwc1\t$f2, 0($a0)\n cvt.s.w\t$f6, $f4\n sub.s\t$f0, $f12, $f2\n div.s\t$f8, $f0, $f6\n add.s\t$f10, $f2, $f8\n swc1\t$f10, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inter_float # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsKyuurekiLeapYear:ido7.1","sym":"lbRk_IsKyuurekiLeapYear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year - lbRk_YEAR_MIN] != 0) {\n return 1;\n };\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(u32 a0) {\n if (((s32 *)(0 + (a0 << 2)))[-2000] != 0) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year] != 0) {\n return 1;\n }\n return 0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsKyuurekiLeapYear\n sll\t$t6, $a0, 0x2\n lui\t$t7, %hi(l_lbRk_leapdays)\n addu\t$t7, $t7, $t6\n lw\t$t7, %lo(l_lbRk_leapdays)($t7)\n move\t$v0, $zero\n beqz\t$t7, .L24\n nop\n jr\t$ra\n li\t$v0, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_IsKyuurekiLeapYear(s32 year);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsKyuurekiLeapYear # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsLeapMonth:ido7.1","sym":"lbRk_IsLeapMonth","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsLeapMonth\n li\t$at, 13\n bne\t$a0, $at, .L14\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsLeapMonth # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_SeirekiDays:ido7.1","sym":"lbRk_SeirekiDays","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":9,"refSource":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 idx = 0;\n\n if ((year % 4) == 0) {\n idx = 1;\n }\n\n return t_seiyo_days_tbl[idx][month];\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'lbRk_SeirekiDays' — lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\tt6,a0,0x3 */\n/* 4:\tbnez\tt6,10 */\n/* 8:\tmove\tv1,zero */\n/* c:\tli\tv1,1 */\n/* 10:\tsll\tt7,v1,0x2 */\n/* 14:\tsubu\tt7,t7,v1 */\n/* 18:\tsll\tt7,t7,0x2 */\n/* 1c:\taddu\tt7,t7,v1 */\n/* 20:\taddu\tt8,t7,a1 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t8 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* \t... */\nvoid lbRk_SeirekiDays(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 var_v1;\n\n var_v1 = 0;\n if (!(year & 3)) {\n var_v1 = 1;\n }\n return (s32) (*t_seiyo_days_tbl)[(var_v1 * 0xD) + month];\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_SeirekiDays\n andi\t$t6, $a0, 0x3\n bnez\t$t6, .L10\n move\t$v1, $zero\n li\t$v1, 1\n.L10:\n sll\t$t7, $v1, 0x2\n subu\t$t7, $t7, $v1\n sll\t$t7, $t7, 0x2\n addu\t$t7, $t7, $v1\n addu\t$t8, $t7, $a1\n lui\t$v0, %hi(t_seiyo_days_tbl)\n addu\t$v0, $v0, $t8\n jr\t$ra\n lbu\t$v0, %lo(t_seiyo_days_tbl)($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_SeirekiDays(s32 year, s32 month);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_SeirekiDays # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:limiter:ido7.1","sym":"limiter","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 limiter(f32 val, f32 max) {\n if (val < 0.0f) {\n return CLAMP_MIN(val, -max);\n } else {\n return CLAMP_MAX(val, max);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f14,$f12 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f12,$f0 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f14,$f12 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid limiter(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 limiter(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (arg0 < temp_f0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg1 < arg0) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel limiter\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f14, $f12\n neg.s\t$f0, $f14\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f14, $f12\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function limiter # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:limiter:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.pprev = NULL;\n this->next = NULL;\n return this;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 * ListAlloc_Init(s32 * a0) {\n *a0 = 0;\n a0[1] = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *ListAlloc_Init(void *arg0) {\n arg0->unk0 = 0;\n arg0->unk4 = 0;\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ListAlloc_Init\n sw\t$zero, 0($a0)\n sw\t$zero, 4($a0)\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ListAlloc_Init # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_clear:ido7.1","sym":"mem_clear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","memory","loop"],"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":4,"quality":{"score":88,"lines":35,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 27: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 28: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 29: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 30: Selector requires struct/union pointer as left hand side"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_clear\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n beqz\t$a1, .L4c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L30\n move\t$v1, $a3\n.L1c:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($a0)\n bne\t$v1, $v0, .L1c\n addiu\t$a0, $a0, 1\n beq\t$v0, $a1, .L4c\n.L30:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($a0)\n sb\t$a2, 1($a0)\n sb\t$a2, 2($a0)\n sb\t$a2, 3($a0)\n bne\t$v0, $a1, .L30\n addiu\t$a0, $a0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_clear # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_cmp:ido7.1","sym":"mem_cmp","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","branch","loop"],"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 40: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Unacceptable operand of '+'.","cfe: Error: /c.i, line 49: Unacceptable operand of '+'.","cfe: Error: /c.i, line 50: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_cmp\n beqz\t$a2, .Lc8\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L44\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a0)\n lbu\t$t7, 0($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a2, $a2, -1\n beq\t$t6, $t7, .L34\n nop\n jr\t$ra\n move\t$v0, $zero\n.L34:\n bne\t$v0, $a2, .L14\n addiu\t$a1, $a1, 1\n beqzl\t$a2, .Lcc\n li\t$v0, 1\n.L44:\n lbu\t$t8, 0($a0)\n lbu\t$t9, 0($a1)\n addiu\t$a2, $a2, -4\n beql\t$t8, $t9, .L64\n lbu\t$t0, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t0, 1($a0)\n.L64:\n lbu\t$t1, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t0, $t1, .L84\n lbu\t$t2, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t2, 1($a0)\n.L84:\n lbu\t$t3, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t2, $t3, .La4\n lbu\t$t4, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t4, 1($a0)\n.La4:\n lbu\t$t5, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a0, $a0, 1\n beq\t$t4, $t5, .Lc0\n addiu\t$a1, $a1, 1\n jr\t$ra\n move\t$v0, $zero\n.Lc0:\n bnez\t$a2, .L44\n addiu\t$a1, $a1, 1\n.Lc8:\n li\t$v0, 1\n.Lcc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_cmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_copy:ido7.1","sym":"mem_copy","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","memory","loop"],"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":4,"quality":{"score":86,"lines":40,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 23: Syntax Error","cfe: Error: /c.i, line 36: Syntax Error","cfe: Error: /c.i, line 37: Syntax Error","cfe: Error: /c.i, line 38: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_copy\n beqz\t$a2, .L64\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L34\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a1)\n addiu\t$a2, $a2, -1\n addiu\t$a1, $a1, 1\n addiu\t$a0, $a0, 1\n bne\t$v0, $a2, .L14\n sb\t$t6, -1($a0)\n beqz\t$a2, .L64\n nop\n.L34:\n lbu\t$t7, 0($a1)\n addiu\t$a2, $a2, -4\n addiu\t$a1, $a1, 4\n sb\t$t7, 0($a0)\n lbu\t$t8, -3($a1)\n addiu\t$a0, $a0, 4\n sb\t$t8, -3($a0)\n lbu\t$t9, -2($a1)\n sb\t$t9, -2($a0)\n lbu\t$t0, -1($a1)\n bnez\t$a2, .L34\n sb\t$t0, -1($a0)\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_copy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mRmTp_ItemNo2FtrSize:ido7.1","sym":"mRmTp_ItemNo2FtrSize","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mRmTp_ItemNo2FtrSize\n sw\t$a0, 0($sp)\n andi\t$a0, $a0, 0xffff\n slti\t$at, $a0, 4096\n bnez\t$at, .L34\n move\t$v0, $zero\n slti\t$at, $a0, 7885\n beqz\t$at, .L34\n addiu\t$t6, $a0, -4096\n sra\t$t7, $t6, 0x2\n lui\t$v0, %hi(mRmTp_ftr_size)\n addu\t$v0, $v0, $t7\n jr\t$ra\n lbu\t$v0, %lo(mRmTp_ftr_size)($v0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 mRmTp_ItemNo2FtrSize(u16 name);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mRmTp_ItemNo2FtrSize # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:never_zero:ido7.1","sym":"never_zero","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 never_zero(f32 val, f32 min) {\n if (val < 0.0f) {\n return CLAMP_MAX(val, -min);\n } else {\n return CLAMP_MIN(val, min);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f12,$f14 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f0,$f12 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f12,$f14 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid never_zero(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 never_zero(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (temp_f0 < arg0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg0 < arg1) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel never_zero\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f12, $f14\n neg.s\t$f0, $f14\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f12, $f14\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function never_zero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:never_zero:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`r = src->r;\n dest->g = src->g;\n dest->b = src->b;\n dest->a = src->a;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\n","proto":{"rgba_t_move":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void rgba_t_move(u8 * a0, u8 * a1) {\n *a0 = *a1;\n a0[1] = a1[1];\n a0[2] = a1[2];\n a0[3] = a1[3];\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void rgba_t_move(void *arg0, void *arg1) {\n arg0->unk0 = (u8) arg1->unk0;\n arg0->unk1 = (u8) arg1->unk1;\n arg0->unk2 = (u8) arg1->unk2;\n arg0->unk3 = (u8) arg1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":96,"lines":6,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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","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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rgba_t_move\n lbu\t$t6, 0($a1)\n sb\t$t6, 0($a0)\n lbu\t$t7, 1($a1)\n sb\t$t7, 1($a0)\n lbu\t$t8, 2($a1)\n sb\t$t8, 2($a0)\n lbu\t$t9, 3($a1)\n jr\t$ra\n sb\t$t9, 3($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rgba_t_move # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:sAdo_Get_KokeruLabel:ido7.1","sym":"sAdo_Get_KokeruLabel","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","switch","call","jump-table"],"loc":43,"refSource":"s32 sAdo_Get_KokeruLabel(s32 type) {\n u16 label = sAdo_Get_WalkLabel(type);\n s32 ret;\n\n switch (label) {\n case 0x201:\n ret = 0xe;\n break;\n\n case 0x206:\n ret = 0x13;\n break;\n\n case 0x202:\n ret = 0xf;\n break;\n\n case 0x203:\n ret = 0x10;\n break;\n\n case 0x204:\n ret = 0x11;\n break;\n\n case 0x205:\n ret = 0x12;\n break;\n\n case 0x208:\n ret = 0x156;\n break;\n\n case 0x209:\n ret = 0x157;\n break;\n\n default:\n ret = 15;\n break;\n }\n return ret;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/audio.c#L382-L424","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:\tjal\t0 \n c:\tnop\n 10:\tandi\tt6,v0,0xffff\n 14:\taddiu\tt7,t6,-513\n 18:\tsltiu\tat,t7,9\n 1c:\tbeqz\tat,78 \n 20:\tsll\tt7,t7,0x2\n 24:\tlui\tat,0x0\n 28:\taddu\tat,at,t7\n 2c:\tlw\tt7,0(at)\n 30:\tjr\tt7\n 34:\tnop\n 38:\tb\t7c \n 3c:\tli\tv1,14\n 40:\tb\t7c \n 44:\tli\tv1,19\n 48:\tb\t7c \n 4c:\tli\tv1,15\n 50:\tb\t7c \n 54:\tli\tv1,16\n 58:\tb\t7c \n 5c:\tli\tv1,17\n 60:\tb\t7c \n 64:\tli\tv1,18\n 68:\tb\t7c \n 6c:\tli\tv1,342\n 70:\tb\t7c \n 74:\tli\tv1,343\n 78:\tli\tv1,15\n 7c:\tlw\tra,20(sp)\n 80:\taddiu\tsp,sp,24\n 84:\tmove\tv0,v1\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 l d .rodata\t00000030 .rodata\n00000000 g F .text\t00000090 sAdo_Get_KokeruLabel\n00000000 F *UND*\t00000000 sAdo_Get_WalkLabel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sAdo_Get_WalkLabel\n00000024 R_MIPS_HI16 .rodata\n0000002c 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\n00000020 R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 0c000000 00000000 '...............\n 0010 304effff 25cffdff 2de10009 10200016 0N..%...-.... ..\n 0020 000f7880 3c010000 002f0821 8c2f0000 ..x.<..../.!./..\n 0030 01e00008 00000000 10000010 2403000e ............$...\n 0040 1000000e 24030013 1000000c 2403000f ....$.......$...\n 0050 1000000a 24030010 10000008 24030011 ....$.......$...\n 0060 10000006 24030012 10000004 24030156 ....$.......$..V\n 0070 10000002 24030157 2403000f 8fbf0014 ....$..W$.......\n 0080 27bd0018 00601025 03e00008 00000000 '....`.%........\nContents of section .rodata:\n 0000 00000038 00000048 00000050 00000058 ...8...H...P...X\n 0010 00000060 00000040 00000078 00000068 ...`...@...x...h\n 0020 00000070 00000000 00000000 00000000 ...p............\nContents of section .options:\n 0000 01200000 00000000 a000c00e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c00e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000018 000002f8 p......$........\n 0010 00000006 00000488 00000001 00000310 ................\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000040 000003b8 .......t...@....\n 0040 00000028 000003f8 00000001 00000420 ...(........... \n 0050 00000000 00000000 00000002 00000468 ...............h\n 0060 01112800 30f040f0 40f040f0 40f040f0 ..(.0.@.@.@.@.@.\n 0070 40f040f0 30340000 00000000 00000001 @.@.04..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00000000 00000000 00000018 001d001f ................\n 00a0 0000001b 0000003b 00000000 00000001 .......;........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000090 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 2d313762 65373530 62643033 -ido-17be750bd03\n 0140 34333463 392f752e 69007341 646f5f47 434c9/u.i.sAdo_G\n 0150 65745f4b 6f6b6572 754c6162 656c0000 et_KokeruLabel..\n 0160 7341646f 5f476574 5f4b6f6b 6572754c sAdo_Get_KokeruL\n 0170 6162656c 00734164 6f5f4765 745f5761 abel.sAdo_Get_Wa\n 0180 6c6b4c61 62656c00 00000000 00000001 lkLabel.........\n 0190 00000000 0000003f 00000000 00000004 .......?........\n 01a0 00000000 00000024 00000000 00000000 .......$........\n 01b0 00000001 00000000 00000011 00000000 ................\n 01c0 00000000 01800000 00000000 00000016 ................\n 01d0 00000000 00000000 00000000 18200001 ............. ..\n 01e0 00000000 00000015 00000000 18cfffff ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 00000000 00000000 7fffffff 00000000 ................\n 0210 7fffffff 00000001 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sAdo_Get_KokeruLabel' — lift: cannot lift 'sAdo_Get_KokeruLabel': 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,20(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tandi\tt6,v0,0xffff */\n/* 14:\taddiu\tt7,t6,-513 */\n/* 18:\tsltiu\tat,t7,9 */\n/* 1c:\tbeqz\tat,78 */\n/* 20:\tsll\tt7,t7,0x2 */\n/* 24:\tlui\tat,0x0 */\n/* 28:\taddu\tat,at,t7 */\n/* 2c:\tlw\tt7,0(at) */\n/* 30:\tjr\tt7 */\n/* 34:\tnop */\n/* 38:\tb\t7c */\n/* 3c:\tli\tv1,14 */\n/* 40:\tb\t7c */\n/* 44:\tli\tv1,19 */\n/* 48:\tb\t7c */\n/* 4c:\tli\tv1,15 */\n/* 50:\tb\t7c */\n/* 54:\tli\tv1,16 */\n/* 58:\tb\t7c */\n/* 5c:\tli\tv1,17 */\n/* 60:\tb\t7c */\n/* 64:\tli\tv1,18 */\n/* 68:\tb\t7c */\n/* 6c:\tli\tv1,342 */\n/* 70:\tb\t7c */\n/* 74:\tli\tv1,343 */\n/* 78:\tli\tv1,15 */\n/* 7c:\tlw\tra,20(sp) */\n/* 80:\taddiu\tsp,sp,24 */\n/* 84:\tmove\tv0,v1 */\n/* 88:\tjr\tra */\n/* 8c:\tnop */\nvoid sAdo_Get_KokeruLabel(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sAdo_Get_KokeruLabel': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\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 'sAdo_Get_KokeruLabel': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sAdo_Get_WalkLabel(); /* extern */\n\ns32 sAdo_Get_KokeruLabel(void) {\n s32 temp_t6;\n s32 var_v1;\n\n temp_t6 = sAdo_Get_WalkLabel() & 0xFFFF;\n switch (temp_t6) {\n case 0x201:\n var_v1 = 0xE;\n break;\n case 0x206:\n var_v1 = 0x13;\n break;\n default:\n var_v1 = 0xF;\n break;\n case 0x203:\n var_v1 = 0x10;\n break;\n case 0x204:\n var_v1 = 0x11;\n break;\n case 0x205:\n var_v1 = 0x12;\n break;\n case 0x208:\n var_v1 = 0x156;\n break;\n case 0x209:\n var_v1 = 0x157;\n break;\n }\n return var_v1;\n}\n","score":4,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":36,"ratio":0.1111111111111111,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sAdo_Get_KokeruLabel` — benchmark function af:sAdo_Get_KokeruLabel:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sAdo_Get_KokeruLabel\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n jal\tsAdo_Get_WalkLabel\n nop\n andi\t$t6, $v0, 0xffff\n addiu\t$t7, $t6, -513\n sltiu\t$at, $t7, 9\n beqz\t$at, .L78\n sll\t$t7, $t7, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $t7\n lw\t$t7, %lo(jtbl_rodata_0)($at)\n jr\t$t7\n nop\n.L38:\n b\t.L7c\n li\t$v1, 14\n.L40:\n b\t.L7c\n li\t$v1, 19\n.L48:\n b\t.L7c\n li\t$v1, 15\n.L50:\n b\t.L7c\n li\t$v1, 16\n.L58:\n b\t.L7c\n li\t$v1, 17\n.L60:\n b\t.L7c\n li\t$v1, 18\n.L68:\n b\t.L7c\n li\t$v1, 342\n.L70:\n b\t.L7c\n li\t$v1, 343\n.L78:\n li\t$v1, 15\n.L7c:\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n move\t$v0, $v1\n jr\t$ra\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L38\n.word .L48\n.word .L50\n.word .L58\n.word .L60\n.word .L40\n.word .L78\n.word .L68\n.word .L70\n.word 0x0\n.word 0x0\n.word 0x0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sAdo_Get_KokeruLabel # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sAdo_Get_KokeruLabel` — benchmark function af:sAdo_Get_KokeruLabel:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:sAdo_Get_KokeruLabel: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:\tjal\t0 \n c:\tnop\n 10:\tandi\tt6,v0,0xffff\n 14:\taddiu\tt7,t6,-513\n 18:\tsltiu\tat,t7,9\n 1c:\tbeqz\tat,78 \n 20:\tsll\tt7,t7,0x2\n 24:\tlui\tat,0x0\n 28:\taddu\tat,at,t7\n 2c:\tlw\tt7,0(at)\n 30:\tjr\tt7\n 34:\tnop\n 38:\tb\t7c \n 3c:\tli\tv1,14\n 40:\tb\t7c \n 44:\tli\tv1,19\n 48:\tb\t7c \n 4c:\tli\tv1,15\n 50:\tb\t7c \n 54:\tli\tv1,16\n 58:\tb\t7c \n 5c:\tli\tv1,17\n 60:\tb\t7c \n 64:\tli\tv1,18\n 68:\tb\t7c \n 6c:\tli\tv1,342\n 70:\tb\t7c \n 74:\tli\tv1,343\n 78:\tli\tv1,15\n 7c:\tlw\tra,20(sp)\n 80:\taddiu\tsp,sp,24\n 84:\tmove\tv0,v1\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 l d .rodata\t00000030 .rodata\n00000000 g F .text\t00000090 sAdo_Get_KokeruLabel\n00000000 F *UND*\t00000000 sAdo_Get_WalkLabel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sAdo_Get_WalkLabel\n00000024 R_MIPS_HI16 .rodata\n0000002c 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\n00000020 R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 0c000000 00000000 '...............\n 0010 304effff 25cffdff 2de10009 10200016 0N..%...-.... ..\n 0020 000f7880 3c010000 002f0821 8c2f0000 ..x.<..../.!./..\n 0030 01e00008 00000000 10000010 2403000e ............$...\n 0040 1000000e 24030013 1000000c 2403000f ....$.......$...\n 0050 1000000a 24030010 10000008 24030011 ....$.......$...\n 0060 10000006 24030012 10000004 24030156 ....$.......$..V\n 0070 10000002 24030157 2403000f 8fbf0014 ....$..W$.......\n 0080 27bd0018 00601025 03e00008 00000000 '....`.%........\nContents of section .rodata:\n 0000 00000038 00000048 00000050 00000058 ...8...H...P...X\n 0010 00000060 00000040 00000078 00000068 ...`...@...x...h\n 0020 00000070 00000000 00000000 00000000 ...p............\nContents of section .options:\n 0000 01200000 00000000 a000c00e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c00e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000018 000002f8 p......$........\n 0010 00000006 00000488 00000001 00000310 ................\n 0020 00000004 00000344 00000000 00000000 .......D........\n 0030 00000011 00000374 00000040 000003b8 .......t...@....\n 0040 00000028 000003f8 00000001 00000420 ...(........... \n 0050 00000000 00000000 00000002 00000468 ...............h\n 0060 01112800 30f040f0 40f040f0 40f040f0 ..(.0.@.@.@.@.@.\n 0070 40f040f0 30340000 00000000 00000001 @.@.04..........\n 0080 00000000 80000000 fffffffc ffffffff ................\n 0090 00000000 00000000 00000018 001d001f ................\n 00a0 0000001b 0000003b 00000000 00000001 .......;........\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 00000090 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 2d313762 65373530 62643033 -ido-17be750bd03\n 0140 34333463 392f752e 69007341 646f5f47 434c9/u.i.sAdo_G\n 0150 65745f4b 6f6b6572 754c6162 656c0000 et_KokeruLabel..\n 0160 7341646f 5f476574 5f4b6f6b 6572754c sAdo_Get_KokeruL\n 0170 6162656c 00734164 6f5f4765 745f5761 abel.sAdo_Get_Wa\n 0180 6c6b4c61 62656c00 00000000 00000001 lkLabel.........\n 0190 00000000 0000003f 00000000 00000004 .......?........\n 01a0 00000000 00000024 00000000 00000000 .......$........\n 01b0 00000001 00000000 00000011 00000000 ................\n 01c0 00000000 01800000 00000000 00000016 ................\n 01d0 00000000 00000000 00000000 18200001 ............. ..\n 01e0 00000000 00000015 00000000 18cfffff ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 00000000 00000000 7fffffff 00000000 ................\n 0210 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 sAdo_Get_KokeruLabel # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel search_position_angleY\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n lwc1\t$f6, 0($a0)\n lwc1\t$f4, 0($a1)\n lwc1\t$f10, 8($a0)\n lwc1\t$f8, 8($a1)\n sub.s\t$f14, $f4, $f6\n jal\tatans_table\n sub.s\t$f12, $f8, $f10\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function search_position_angleY # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:Skin_Matrix_MulMatrix:ido7.1","sym":"Skin_Matrix_MulMatrix","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","matrix","arithmetic"],"loc":122,"refSource":"void Skin_Matrix_MulMatrix(MtxF* mfA, MtxF* mfB, MtxF* dest) {\n f32 cx;\n f32 cy;\n f32 cz;\n f32 cw;\n\n f32 rx = mfA->xx;\n f32 ry = mfA->xy;\n f32 rz = mfA->xz;\n f32 rw = mfA->xw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->xx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->xy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->xz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->xw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->yx;\n ry = mfA->yy;\n rz = mfA->yz;\n rw = mfA->yw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->yx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->yy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->yz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->yw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->zx;\n ry = mfA->zy;\n rz = mfA->zz;\n rw = mfA->zw;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->zx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->zy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->zz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->zw = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n rx = mfA->wx;\n ry = mfA->wy;\n rz = mfA->wz;\n rw = mfA->ww;\n\n cx = mfB->xx;\n cy = mfB->yx;\n cz = mfB->zx;\n cw = mfB->wx;\n dest->wx = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xy;\n cy = mfB->yy;\n cz = mfB->zy;\n cw = mfB->wy;\n dest->wy = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xz;\n cy = mfB->yz;\n cz = mfB->zz;\n cw = mfB->wz;\n dest->wz = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n\n cx = mfB->xw;\n cy = mfB->yw;\n cz = mfB->zw;\n cw = mfB->ww;\n dest->ww = (rx * cx) + (ry * cy) + (rz * cz) + (rw * cw);\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_skin_matrix.c#L32-L153","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsdc1\t$f22,16(sp)\n 8:\tsdc1\t$f20,8(sp)\n c:\tlwc1\t$f0,0(a0)\n 10:\tlwc1\t$f16,0(a1)\n 14:\tlwc1\t$f2,16(a0)\n 18:\tlwc1\t$f18,4(a1)\n 1c:\tmul.s\t$f4,$f0,$f16\n 20:\tlwc1\t$f12,32(a0)\n 24:\tlwc1\t$f20,8(a1)\n 28:\tmul.s\t$f6,$f2,$f18\n 2c:\tlwc1\t$f14,48(a0)\n 30:\tlwc1\t$f22,12(a1)\n 34:\tmul.s\t$f10,$f12,$f20\n 38:\tadd.s\t$f8,$f4,$f6\n 3c:\tmul.s\t$f6,$f14,$f22\n 40:\tadd.s\t$f4,$f8,$f10\n 44:\tadd.s\t$f8,$f4,$f6\n 48:\tswc1\t$f8,0(a2)\n 4c:\tlwc1\t$f16,16(a1)\n 50:\tlwc1\t$f18,20(a1)\n 54:\tlwc1\t$f20,24(a1)\n 58:\tmul.s\t$f10,$f0,$f16\n 5c:\tlwc1\t$f22,28(a1)\n 60:\tmul.s\t$f4,$f2,$f18\n 64:\tmul.s\t$f8,$f12,$f20\n 68:\tadd.s\t$f6,$f10,$f4\n 6c:\tmul.s\t$f4,$f14,$f22\n 70:\tadd.s\t$f10,$f6,$f8\n 74:\tadd.s\t$f6,$f10,$f4\n 78:\tswc1\t$f6,16(a2)\n 7c:\tlwc1\t$f16,32(a1)\n 80:\tlwc1\t$f18,36(a1)\n 84:\tlwc1\t$f20,40(a1)\n 88:\tmul.s\t$f8,$f0,$f16\n 8c:\tlwc1\t$f22,44(a1)\n 90:\tmul.s\t$f10,$f2,$f18\n 94:\tmul.s\t$f6,$f12,$f20\n 98:\tadd.s\t$f4,$f8,$f10\n 9c:\tmul.s\t$f10,$f14,$f22\n a0:\tadd.s\t$f8,$f4,$f6\n a4:\tadd.s\t$f4,$f8,$f10\n a8:\tswc1\t$f4,32(a2)\n ac:\tlwc1\t$f16,48(a1)\n b0:\tlwc1\t$f18,52(a1)\n b4:\tlwc1\t$f20,56(a1)\n b8:\tmul.s\t$f6,$f0,$f16\n bc:\tlwc1\t$f22,60(a1)\n c0:\tmul.s\t$f8,$f2,$f18\n c4:\tmul.s\t$f4,$f12,$f20\n c8:\tadd.s\t$f10,$f6,$f8\n cc:\tmul.s\t$f8,$f14,$f22\n d0:\tadd.s\t$f6,$f10,$f4\n d4:\tadd.s\t$f10,$f6,$f8\n d8:\tswc1\t$f10,48(a2)\n dc:\tlwc1\t$f0,4(a0)\n e0:\tlwc1\t$f16,0(a1)\n e4:\tlwc1\t$f2,20(a0)\n e8:\tlwc1\t$f18,4(a1)\n ec:\tmul.s\t$f4,$f0,$f16\n f0:\tlwc1\t$f12,36(a0)\n f4:\tlwc1\t$f20,8(a1)\n f8:\tmul.s\t$f6,$f2,$f18\n fc:\tlwc1\t$f14,52(a0)\n 100:\tlwc1\t$f22,12(a1)\n 104:\tmul.s\t$f10,$f12,$f20\n 108:\tadd.s\t$f8,$f4,$f6\n 10c:\tmul.s\t$f6,$f14,$f22\n 110:\tadd.s\t$f4,$f8,$f10\n 114:\tadd.s\t$f8,$f4,$f6\n 118:\tswc1\t$f8,4(a2)\n 11c:\tlwc1\t$f16,16(a1)\n 120:\tlwc1\t$f18,20(a1)\n 124:\tlwc1\t$f20,24(a1)\n 128:\tmul.s\t$f10,$f0,$f16\n 12c:\tlwc1\t$f22,28(a1)\n 130:\tmul.s\t$f4,$f2,$f18\n 134:\tmul.s\t$f8,$f12,$f20\n 138:\tadd.s\t$f6,$f10,$f4\n 13c:\tmul.s\t$f4,$f14,$f22\n 140:\tadd.s\t$f10,$f6,$f8\n 144:\tadd.s\t$f6,$f10,$f4\n 148:\tswc1\t$f6,20(a2)\n 14c:\tlwc1\t$f16,32(a1)\n 150:\tlwc1\t$f18,36(a1)\n 154:\tlwc1\t$f20,40(a1)\n 158:\tmul.s\t$f8,$f0,$f16\n 15c:\tlwc1\t$f22,44(a1)\n 160:\tmul.s\t$f10,$f2,$f18\n 164:\tmul.s\t$f6,$f12,$f20\n 168:\tadd.s\t$f4,$f8,$f10\n 16c:\tmul.s\t$f10,$f14,$f22\n 170:\tadd.s\t$f8,$f4,$f6\n 174:\tadd.s\t$f4,$f8,$f10\n 178:\tswc1\t$f4,36(a2)\n 17c:\tlwc1\t$f16,48(a1)\n 180:\tlwc1\t$f18,52(a1)\n 184:\tlwc1\t$f20,56(a1)\n 188:\tmul.s\t$f6,$f0,$f16\n 18c:\tlwc1\t$f22,60(a1)\n 190:\tmul.s\t$f8,$f2,$f18\n 194:\tmul.s\t$f4,$f12,$f20\n 198:\tadd.s\t$f10,$f6,$f8\n 19c:\tmul.s\t$f8,$f14,$f22\n 1a0:\tadd.s\t$f6,$f10,$f4\n 1a4:\tadd.s\t$f10,$f6,$f8\n 1a8:\tswc1\t$f10,52(a2)\n 1ac:\tlwc1\t$f0,8(a0)\n 1b0:\tlwc1\t$f16,0(a1)\n 1b4:\tlwc1\t$f2,24(a0)\n 1b8:\tlwc1\t$f18,4(a1)\n 1bc:\tmul.s\t$f4,$f0,$f16\n 1c0:\tlwc1\t$f12,40(a0)\n 1c4:\tlwc1\t$f20,8(a1)\n 1c8:\tmul.s\t$f6,$f2,$f18\n 1cc:\tlwc1\t$f14,56(a0)\n 1d0:\tlwc1\t$f22,12(a1)\n 1d4:\tmul.s\t$f10,$f12,$f20\n 1d8:\tadd.s\t$f8,$f4,$f6\n 1dc:\tmul.s\t$f6,$f14,$f22\n 1e0:\tadd.s\t$f4,$f8,$f10\n 1e4:\tadd.s\t$f8,$f4,$f6\n 1e8:\tswc1\t$f8,8(a2)\n 1ec:\tlwc1\t$f16,16(a1)\n 1f0:\tlwc1\t$f18,20(a1)\n 1f4:\tlwc1\t$f20,24(a1)\n 1f8:\tmul.s\t$f10,$f0,$f16\n 1fc:\tlwc1\t$f22,28(a1)\n 200:\tmul.s\t$f4,$f2,$f18\n 204:\tmul.s\t$f8,$f12,$f20\n 208:\tadd.s\t$f6,$f10,$f4\n 20c:\tmul.s\t$f4,$f14,$f22\n 210:\tadd.s\t$f10,$f6,$f8\n 214:\tadd.s\t$f6,$f10,$f4\n 218:\tswc1\t$f6,24(a2)\n 21c:\tlwc1\t$f16,32(a1)\n 220:\tlwc1\t$f18,36(a1)\n 224:\tlwc1\t$f20,40(a1)\n 228:\tmul.s\t$f8,$f0,$f16\n 22c:\tlwc1\t$f22,44(a1)\n 230:\tmul.s\t$f10,$f2,$f18\n 234:\tmul.s\t$f6,$f12,$f20\n 238:\tadd.s\t$f4,$f8,$f10\n 23c:\tmul.s\t$f10,$f14,$f22\n 240:\tadd.s\t$f8,$f4,$f6\n 244:\tadd.s\t$f4,$f8,$f10\n 248:\tswc1\t$f4,40(a2)\n 24c:\tlwc1\t$f16,48(a1)\n 250:\tlwc1\t$f18,52(a1)\n 254:\tlwc1\t$f20,56(a1)\n 258:\tmul.s\t$f6,$f0,$f16\n 25c:\tlwc1\t$f22,60(a1)\n 260:\tmul.s\t$f8,$f2,$f18\n 264:\tmul.s\t$f4,$f12,$f20\n 268:\tadd.s\t$f10,$f6,$f8\n 26c:\tmul.s\t$f8,$f14,$f22\n 270:\tadd.s\t$f6,$f10,$f4\n 274:\tadd.s\t$f10,$f6,$f8\n 278:\tswc1\t$f10,56(a2)\n 27c:\tlwc1\t$f0,12(a0)\n 280:\tlwc1\t$f16,0(a1)\n 284:\tlwc1\t$f2,28(a0)\n 288:\tlwc1\t$f18,4(a1)\n 28c:\tmul.s\t$f4,$f0,$f16\n 290:\tlwc1\t$f12,44(a0)\n 294:\tlwc1\t$f20,8(a1)\n 298:\tmul.s\t$f6,$f2,$f18\n 29c:\tlwc1\t$f14,60(a0)\n 2a0:\tlwc1\t$f22,12(a1)\n 2a4:\tmul.s\t$f10,$f12,$f20\n 2a8:\tadd.s\t$f8,$f4,$f6\n 2ac:\tmul.s\t$f6,$f14,$f22\n 2b0:\tadd.s\t$f4,$f8,$f10\n 2b4:\tadd.s\t$f8,$f4,$f6\n 2b8:\tswc1\t$f8,12(a2)\n 2bc:\tlwc1\t$f16,16(a1)\n 2c0:\tlwc1\t$f18,20(a1)\n 2c4:\tlwc1\t$f20,24(a1)\n 2c8:\tmul.s\t$f10,$f0,$f16\n 2cc:\tlwc1\t$f22,28(a1)\n 2d0:\tmul.s\t$f4,$f2,$f18\n 2d4:\tmul.s\t$f8,$f12,$f20\n 2d8:\tadd.s\t$f6,$f10,$f4\n 2dc:\tmul.s\t$f4,$f14,$f22\n 2e0:\tadd.s\t$f10,$f6,$f8\n 2e4:\tadd.s\t$f6,$f10,$f4\n 2e8:\tswc1\t$f6,28(a2)\n 2ec:\tlwc1\t$f16,32(a1)\n 2f0:\tlwc1\t$f18,36(a1)\n 2f4:\tlwc1\t$f20,40(a1)\n 2f8:\tmul.s\t$f8,$f0,$f16\n 2fc:\tlwc1\t$f22,44(a1)\n 300:\tmul.s\t$f10,$f2,$f18\n 304:\tmul.s\t$f6,$f12,$f20\n 308:\tadd.s\t$f4,$f8,$f10\n 30c:\tmul.s\t$f10,$f14,$f22\n 310:\tadd.s\t$f8,$f4,$f6\n 314:\tadd.s\t$f4,$f8,$f10\n 318:\tswc1\t$f4,44(a2)\n 31c:\tlwc1\t$f16,48(a1)\n 320:\tlwc1\t$f18,52(a1)\n 324:\tlwc1\t$f20,56(a1)\n 328:\tmul.s\t$f6,$f0,$f16\n 32c:\tlwc1\t$f22,60(a1)\n 330:\tmul.s\t$f8,$f2,$f18\n 334:\tmul.s\t$f4,$f12,$f20\n 338:\tadd.s\t$f10,$f6,$f8\n 33c:\tmul.s\t$f8,$f14,$f22\n 340:\tadd.s\t$f6,$f10,$f4\n 344:\tadd.s\t$f10,$f6,$f8\n 348:\tswc1\t$f10,60(a2)\n 34c:\tldc1\t$f22,16(sp)\n 350:\tldc1\t$f20,8(sp)\n 354:\tjr\tra\n 358:\taddiu\tsp,sp,24\n 35c:\tnop\n","proto":{"Skin_Matrix_MulMatrix":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000360 .text\n00000000 g F .text\t0000035c Skin_Matrix_MulMatrix\n\n\nContents of section .text:\n 0000 27bdffe8 f7b60010 f7b40008 c4800000 '...............\n 0010 c4b00000 c4820010 c4b20004 46100102 ............F...\n 0020 c48c0020 c4b40008 46121182 c48e0030 ... ....F......0\n 0030 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0040 460a4100 46062200 e4c80000 c4b00010 F.A.F.\".........\n 0050 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0060 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0070 46083280 46045180 e4c60010 c4b00020 F.2.F.Q........ \n 0080 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0090 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 00a0 46062200 460a4100 e4c40020 c4b00030 F.\".F.A.... ...0\n 00b0 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 00c0 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 00d0 46045180 46083280 e4ca0030 c4800004 F.Q.F.2....0....\n 00e0 c4b00000 c4820014 c4b20004 46100102 ............F...\n 00f0 c48c0024 c4b40008 46121182 c48e0034 ...$....F......4\n 0100 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0110 460a4100 46062200 e4c80004 c4b00010 F.A.F.\".........\n 0120 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0130 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0140 46083280 46045180 e4c60014 c4b00020 F.2.F.Q........ \n 0150 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0160 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0170 46062200 460a4100 e4c40024 c4b00030 F.\".F.A....$...0\n 0180 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0190 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 01a0 46045180 46083280 e4ca0034 c4800008 F.Q.F.2....4....\n 01b0 c4b00000 c4820018 c4b20004 46100102 ............F...\n 01c0 c48c0028 c4b40008 46121182 c48e0038 ...(....F......8\n 01d0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 01e0 460a4100 46062200 e4c80008 c4b00010 F.A.F.\".........\n 01f0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0200 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0210 46083280 46045180 e4c60018 c4b00020 F.2.F.Q........ \n 0220 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0230 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0240 46062200 460a4100 e4c40028 c4b00030 F.\".F.A....(...0\n 0250 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0260 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0270 46045180 46083280 e4ca0038 c480000c F.Q.F.2....8....\n 0280 c4b00000 c482001c c4b20004 46100102 ............F...\n 0290 c48c002c c4b40008 46121182 c48e003c ...,....F......<\n 02a0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 02b0 460a4100 46062200 e4c8000c c4b00010 F.A.F.\".........\n 02c0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 02d0 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 02e0 46083280 46045180 e4c6001c c4b00020 F.2.F.Q........ \n 02f0 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0300 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0310 46062200 460a4100 e4c4002c c4b00030 F.\".F.A....,...0\n 0320 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0330 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0340 46045180 46083280 e4ca003c d7b60010 F.Q.F.2....<....\n 0350 d7b40008 03e00008 27bd0018 00000000 ........'.......\nContents of section .options:\n 0000 01200000 00000000 a0000070 00000000 . .........p....\n 0010 00f55ff5 00000000 00000000 00007ff0 .._.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000070 00000000 00f55ff5 00000000 ...p......_.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000d7 00000078 000004d8 p..........x....\n 0010 00000005 000006a8 00000001 00000550 ...............P\n 0020 00000004 00000584 00000000 00000000 ................\n 0030 00000011 000005b4 00000040 000005f8 ...........@....\n 0040 00000018 00000638 00000001 00000650 .......8.......P\n 0050 00000000 00000000 00000001 00000698 ................\n 0060 025040d0 4030a040 20b04015 10101020 .P@.@0.@ .@.... \n 0070 f0161010 1020f016 10101020 f0161040 ..... ..... ...@\n 0080 d04030a0 4020b040 15101010 20f01610 .@0.@ .@.... ...\n 0090 101020f0 16101010 20f01610 40d04030 .. ..... ...@.@0\n 00a0 a04020b0 40151010 1020f016 10101020 .@ .@.... ..... \n 00b0 f0161010 1020f016 1040d040 30a04020 ..... ...@.@0.@ \n 00c0 b0401510 101020f0 16101010 20f01610 .@.... ..... ...\n 00d0 101020f0 16130000 00000000 00000001 .. .............\n 00e0 00000000 00000000 00000000 ffffffff ................\n 00f0 00f00000 fffffff8 00000018 001d001f ................\n 0100 0000001b 00000080 00000000 00000001 ................\n 0110 00000000 2c200004 0000002a 00000000 ...., .....*....\n 0120 1820000f 0000002a 0000035c 20200001 . .....*...\\ ..\n 0130 00000001 00000000 20200000 02000000 ........ ......\n 0140 03000000 04000000 05000000 06000000 ................\n 0150 07000000 08000000 09000000 20000000 ............ ...\n 0160 21000000 0a000000 0b000000 0b000000 !...............\n 0170 1a000000 00000000 00000003 06000000 ................\n 0180 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0190 2d69646f 2d393839 35333264 66373437 -ido-989532df747\n 01a0 65343033 612f752e 6900536b 696e5f4d e403a/u.i.Skin_M\n 01b0 61747269 785f4d75 6c4d6174 72697800 atrix_MulMatrix.\n 01c0 536b696e 5f4d6174 7269785f 4d756c4d Skin_Matrix_MulM\n 01d0 61747269 78000000 00000000 00000001 atrix...........\n 01e0 00000000 00000040 00000000 00000004 .......@........\n 01f0 00000000 000000d7 00000000 00000000 ................\n 0200 00000001 00000000 00000011 00000000 ................\n 0210 00000000 01800000 00000000 00000076 ...............v\n 0220 00000000 00000000 00000000 18200001 ............. ..\n 0230 00000000 00000000 00000000 00000000 ................\n 0240 00000000 00000000 7fffffff 00000000 ................\n 0250 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Skin_Matrix_MulMatrix' — lift: cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque */\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:\tsdc1\t$f22,16(sp) */\n/* 8:\tsdc1\t$f20,8(sp) */\n/* c:\tlwc1\t$f0,0(a0) */\n/* 10:\tlwc1\t$f16,0(a1) */\n/* 14:\tlwc1\t$f2,16(a0) */\n/* 18:\tlwc1\t$f18,4(a1) */\n/* 1c:\tmul.s\t$f4,$f0,$f16 */\n/* 20:\tlwc1\t$f12,32(a0) */\n/* 24:\tlwc1\t$f20,8(a1) */\n/* 28:\tmul.s\t$f6,$f2,$f18 */\n/* 2c:\tlwc1\t$f14,48(a0) */\n/* 30:\tlwc1\t$f22,12(a1) */\n/* 34:\tmul.s\t$f10,$f12,$f20 */\n/* 38:\tadd.s\t$f8,$f4,$f6 */\n/* 3c:\tmul.s\t$f6,$f14,$f22 */\n/* 40:\tadd.s\t$f4,$f8,$f10 */\n/* 44:\tadd.s\t$f8,$f4,$f6 */\n/* 48:\tswc1\t$f8,0(a2) */\n/* 4c:\tlwc1\t$f16,16(a1) */\n/* 50:\tlwc1\t$f18,20(a1) */\n/* 54:\tlwc1\t$f20,24(a1) */\n/* 58:\tmul.s\t$f10,$f0,$f16 */\n/* 5c:\tlwc1\t$f22,28(a1) */\n/* 60:\tmul.s\t$f4,$f2,$f18 */\n/* 64:\tmul.s\t$f8,$f12,$f20 */\n/* 68:\tadd.s\t$f6,$f10,$f4 */\n/* 6c:\tmul.s\t$f4,$f14,$f22 */\n/* 70:\tadd.s\t$f10,$f6,$f8 */\n/* 74:\tadd.s\t$f6,$f10,$f4 */\n/* 78:\tswc1\t$f6,16(a2) */\n/* 7c:\tlwc1\t$f16,32(a1) */\n/* 80:\tlwc1\t$f18,36(a1) */\n/* 84:\tlwc1\t$f20,40(a1) */\n/* 88:\tmul.s\t$f8,$f0,$f16 */\n/* 8c:\tlwc1\t$f22,44(a1) */\n/* 90:\tmul.s\t$f10,$f2,$f18 */\n/* 94:\tmul.s\t$f6,$f12,$f20 */\n/* 98:\tadd.s\t$f4,$f8,$f10 */\n/* 9c:\tmul.s\t$f10,$f14,$f22 */\n/* a0:\tadd.s\t$f8,$f4,$f6 */\n/* a4:\tadd.s\t$f4,$f8,$f10 */\n/* a8:\tswc1\t$f4,32(a2) */\n/* ac:\tlwc1\t$f16,48(a1) */\n/* b0:\tlwc1\t$f18,52(a1) */\n/* b4:\tlwc1\t$f20,56(a1) */\n/* b8:\tmul.s\t$f6,$f0,$f16 */\n/* bc:\tlwc1\t$f22,60(a1) */\n/* c0:\tmul.s\t$f8,$f2,$f18 */\n/* c4:\tmul.s\t$f4,$f12,$f20 */\n/* c8:\tadd.s\t$f10,$f6,$f8 */\n/* cc:\tmul.s\t$f8,$f14,$f22 */\n/* d0:\tadd.s\t$f6,$f10,$f4 */\n/* d4:\tadd.s\t$f10,$f6,$f8 */\n/* d8:\tswc1\t$f10,48(a2) */\n/* dc:\tlwc1\t$f0,4(a0) */\n/* e0:\tlwc1\t$f16,0(a1) */\n/* e4:\tlwc1\t$f2,20(a0) */\n/* e8:\tlwc1\t$f18,4(a1) */\n/* ec:\tmul.s\t$f4,$f0,$f16 */\n/* f0:\tlwc1\t$f12,36(a0) */\n/* f4:\tlwc1\t$f20,8(a1) */\n/* f8:\tmul.s\t$f6,$f2,$f18 */\n/* fc:\tlwc1\t$f14,52(a0) */\n/* 100:\tlwc1\t$f22,12(a1) */\n/* 104:\tmul.s\t$f10,$f12,$f20 */\n/* 108:\tadd.s\t$f8,$f4,$f6 */\n/* 10c:\tmul.s\t$f6,$f14,$f22 */\n/* 110:\tadd.s\t$f4,$f8,$f10 */\n/* 114:\tadd.s\t$f8,$f4,$f6 */\n/* 118:\tswc1\t$f8,4(a2) */\n/* 11c:\tlwc1\t$f16,16(a1) */\n/* 120:\tlwc1\t$f18,20(a1) */\n/* 124:\tlwc1\t$f20,24(a1) */\n/* 128:\tmul.s\t$f10,$f0,$f16 */\n/* 12c:\tlwc1\t$f22,28(a1) */\n/* 130:\tmul.s\t$f4,$f2,$f18 */\n/* 134:\tmul.s\t$f8,$f12,$f20 */\n/* 138:\tadd.s\t$f6,$f10,$f4 */\n/* 13c:\tmul.s\t$f4,$f14,$f22 */\n/* 140:\tadd.s\t$f10,$f6,$f8 */\n/* 144:\tadd.s\t$f6,$f10,$f4 */\n/* 148:\tswc1\t$f6,20(a2) */\n/* 14c:\tlwc1\t$f16,32(a1) */\n/* 150:\tlwc1\t$f18,36(a1) */\n/* 154:\tlwc1\t$f20,40(a1) */\n/* 158:\tmul.s\t$f8,$f0,$f16 */\n/* 15c:\tlwc1\t$f22,44(a1) */\n/* 160:\tmul.s\t$f10,$f2,$f18 */\n/* 164:\tmul.s\t$f6,$f12,$f20 */\n/* 168:\tadd.s\t$f4,$f8,$f10 */\n/* 16c:\tmul.s\t$f10,$f14,$f22 */\n/* 170:\tadd.s\t$f8,$f4,$f6 */\n/* 174:\tadd.s\t$f4,$f8,$f10 */\n/* 178:\tswc1\t$f4,36(a2) */\n/* 17c:\tlwc1\t$f16,48(a1) */\n/* 180:\tlwc1\t$f18,52(a1) */\n/* 184:\tlwc1\t$f20,56(a1) */\n/* 188:\tmul.s\t$f6,$f0,$f16 */\n/* 18c:\tlwc1\t$f22,60(a1) */\n/* 190:\tmul.s\t$f8,$f2,$f18 */\n/* 194:\tmul.s\t$f4,$f12,$f20 */\n/* 198:\tadd.s\t$f10,$f6,$f8 */\n/* 19c:\tmul.s\t$f8,$f14,$f22 */\n/* 1a0:\tadd.s\t$f6,$f10,$f4 */\n/* 1a4:\tadd.s\t$f10,$f6,$f8 */\n/* 1a8:\tswc1\t$f10,52(a2) */\n/* 1ac:\tlwc1\t$f0,8(a0) */\n/* 1b0:\tlwc1\t$f16,0(a1) */\n/* 1b4:\tlwc1\t$f2,24(a0) */\n/* 1b8:\tlwc1\t$f18,4(a1) */\n/* 1bc:\tmul.s\t$f4,$f0,$f16 */\n/* 1c0:\tlwc1\t$f12,40(a0) */\n/* 1c4:\tlwc1\t$f20,8(a1) */\n/* 1c8:\tmul.s\t$f6,$f2,$f18 */\n/* 1cc:\tlwc1\t$f14,56(a0) */\n/* 1d0:\tlwc1\t$f22,12(a1) */\n/* 1d4:\tmul.s\t$f10,$f12,$f20 */\n/* 1d8:\tadd.s\t$f8,$f4,$f6 */\n/* 1dc:\tmul.s\t$f6,$f14,$f22 */\n/* 1e0:\tadd.s\t$f4,$f8,$f10 */\n/* 1e4:\tadd.s\t$f8,$f4,$f6 */\n/* 1e8:\tswc1\t$f8,8(a2) */\n/* 1ec:\tlwc1\t$f16,16(a1) */\n/* 1f0:\tlwc1\t$f18,20(a1) */\n/* 1f4:\tlwc1\t$f20,24(a1) */\n/* 1f8:\tmul.s\t$f10,$f0,$f16 */\n/* 1fc:\tlwc1\t$f22,28(a1) */\n/* 200:\tmul.s\t$f4,$f2,$f18 */\n/* 204:\tmul.s\t$f8,$f12,$f20 */\n/* 208:\tadd.s\t$f6,$f10,$f4 */\n/* 20c:\tmul.s\t$f4,$f14,$f22 */\n/* 210:\tadd.s\t$f10,$f6,$f8 */\n/* 214:\tadd.s\t$f6,$f10,$f4 */\n/* 218:\tswc1\t$f6,24(a2) */\n/* 21c:\tlwc1\t$f16,32(a1) */\n/* 220:\tlwc1\t$f18,36(a1) */\n/* 224:\tlwc1\t$f20,40(a1) */\n/* 228:\tmul.s\t$f8,$f0,$f16 */\n/* 22c:\tlwc1\t$f22,44(a1) */\n/* 230:\tmul.s\t$f10,$f2,$f18 */\n/* 234:\tmul.s\t$f6,$f12,$f20 */\n/* 238:\tadd.s\t$f4,$f8,$f10 */\n/* 23c:\tmul.s\t$f10,$f14,$f22 */\n/* 240:\tadd.s\t$f8,$f4,$f6 */\n/* 244:\tadd.s\t$f4,$f8,$f10 */\n/* 248:\tswc1\t$f4,40(a2) */\n/* 24c:\tlwc1\t$f16,48(a1) */\n/* 250:\tlwc1\t$f18,52(a1) */\n/* 254:\tlwc1\t$f20,56(a1) */\n/* 258:\tmul.s\t$f6,$f0,$f16 */\n/* 25c:\tlwc1\t$f22,60(a1) */\n/* 260:\tmul.s\t$f8,$f2,$f18 */\n/* 264:\tmul.s\t$f4,$f12,$f20 */\n/* 268:\tadd.s\t$f10,$f6,$f8 */\n/* 26c:\tmul.s\t$f8,$f14,$f22 */\n/* 270:\tadd.s\t$f6,$f10,$f4 */\n/* 274:\tadd.s\t$f10,$f6,$f8 */\n/* 278:\tswc1\t$f10,56(a2) */\n/* 27c:\tlwc1\t$f0,12(a0) */\n/* 280:\tlwc1\t$f16,0(a1) */\n/* 284:\tlwc1\t$f2,28(a0) */\n/* 288:\tlwc1\t$f18,4(a1) */\n/* 28c:\tmul.s\t$f4,$f0,$f16 */\n/* 290:\tlwc1\t$f12,44(a0) */\n/* 294:\tlwc1\t$f20,8(a1) */\n/* 298:\tmul.s\t$f6,$f2,$f18 */\n/* 29c:\tlwc1\t$f14,60(a0) */\n/* 2a0:\tlwc1\t$f22,12(a1) */\n/* 2a4:\tmul.s\t$f10,$f12,$f20 */\n/* 2a8:\tadd.s\t$f8,$f4,$f6 */\n/* 2ac:\tmul.s\t$f6,$f14,$f22 */\n/* 2b0:\tadd.s\t$f4,$f8,$f10 */\n/* 2b4:\tadd.s\t$f8,$f4,$f6 */\n/* 2b8:\tswc1\t$f8,12(a2) */\n/* 2bc:\tlwc1\t$f16,16(a1) */\n/* 2c0:\tlwc1\t$f18,20(a1) */\n/* 2c4:\tlwc1\t$f20,24(a1) */\n/* 2c8:\tmul.s\t$f10,$f0,$f16 */\n/* 2cc:\tlwc1\t$f22,28(a1) */\n/* 2d0:\tmul.s\t$f4,$f2,$f18 */\n/* 2d4:\tmul.s\t$f8,$f12,$f20 */\n/* 2d8:\tadd.s\t$f6,$f10,$f4 */\n/* 2dc:\tmul.s\t$f4,$f14,$f22 */\n/* 2e0:\tadd.s\t$f10,$f6,$f8 */\n/* 2e4:\tadd.s\t$f6,$f10,$f4 */\n/* 2e8:\tswc1\t$f6,28(a2) */\n/* 2ec:\tlwc1\t$f16,32(a1) */\n/* 2f0:\tlwc1\t$f18,36(a1) */\n/* 2f4:\tlwc1\t$f20,40(a1) */\n/* 2f8:\tmul.s\t$f8,$f0,$f16 */\n/* 2fc:\tlwc1\t$f22,44(a1) */\n/* 300:\tmul.s\t$f10,$f2,$f18 */\n/* 304:\tmul.s\t$f6,$f12,$f20 */\n/* 308:\tadd.s\t$f4,$f8,$f10 */\n/* 30c:\tmul.s\t$f10,$f14,$f22 */\n/* 310:\tadd.s\t$f8,$f4,$f6 */\n/* 314:\tadd.s\t$f4,$f8,$f10 */\n/* 318:\tswc1\t$f4,44(a2) */\n/* 31c:\tlwc1\t$f16,48(a1) */\n/* 320:\tlwc1\t$f18,52(a1) */\n/* 324:\tlwc1\t$f20,56(a1) */\n/* 328:\tmul.s\t$f6,$f0,$f16 */\n/* 32c:\tlwc1\t$f22,60(a1) */\n/* 330:\tmul.s\t$f8,$f2,$f18 */\n/* 334:\tmul.s\t$f4,$f12,$f20 */\n/* 338:\tadd.s\t$f10,$f6,$f8 */\n/* 33c:\tmul.s\t$f8,$f14,$f22 */\n/* 340:\tadd.s\t$f6,$f10,$f4 */\n/* 344:\tadd.s\t$f10,$f6,$f8 */\n/* 348:\tswc1\t$f10,60(a2) */\n/* 34c:\tldc1\t$f22,16(sp) */\n/* 350:\tldc1\t$f20,8(sp) */\n/* 354:\tjr\tra */\n/* 358:\taddiu\tsp,sp,24 */\n/* 35c:\tnop */\nvoid Skin_Matrix_MulMatrix(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":224,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Skin_Matrix_MulMatrix @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Skin_Matrix_MulMatrix(void *arg0, void *arg1, void *arg2) {\n f32 temp_f0;\n f32 temp_f0_2;\n f32 temp_f0_3;\n f32 temp_f0_4;\n f32 temp_f12;\n f32 temp_f12_2;\n f32 temp_f12_3;\n f32 temp_f12_4;\n f32 temp_f14;\n f32 temp_f14_2;\n f32 temp_f14_3;\n f32 temp_f14_4;\n f32 temp_f2;\n f32 temp_f2_2;\n f32 temp_f2_3;\n f32 temp_f2_4;\n\n temp_f0 = arg0->unk0;\n temp_f2 = arg0->unk10;\n temp_f12 = arg0->unk20;\n temp_f14 = arg0->unk30;\n arg2->unk0 = (f32) ((temp_f0 * arg1->unk0) + (temp_f2 * arg1->unk4) + (temp_f12 * arg1->unk8) + (temp_f14 * arg1->unkC));\n arg2->unk10 = (f32) ((temp_f0 * arg1->unk10) + (temp_f2 * arg1->unk14) + (temp_f12 * arg1->unk18) + (temp_f14 * arg1->unk1C));\n arg2->unk20 = (f32) ((temp_f0 * arg1->unk20) + (temp_f2 * arg1->unk24) + (temp_f12 * arg1->unk28) + (temp_f14 * arg1->unk2C));\n arg2->unk30 = (f32) ((temp_f0 * arg1->unk30) + (temp_f2 * arg1->unk34) + (temp_f12 * arg1->unk38) + (temp_f14 * arg1->unk3C));\n temp_f0_2 = arg0->unk4;\n temp_f2_2 = arg0->unk14;\n temp_f12_2 = arg0->unk24;\n temp_f14_2 = arg0->unk34;\n arg2->unk4 = (f32) ((temp_f0_2 * arg1->unk0) + (temp_f2_2 * arg1->unk4) + (temp_f12_2 * arg1->unk8) + (temp_f14_2 * arg1->unkC));\n arg2->unk14 = (f32) ((temp_f0_2 * arg1->unk10) + (temp_f2_2 * arg1->unk14) + (temp_f12_2 * arg1->unk18) + (temp_f14_2 * arg1->unk1C));\n arg2->unk24 = (f32) ((temp_f0_2 * arg1->unk20) + (temp_f2_2 * arg1->unk24) + (temp_f12_2 * arg1->unk28) + (temp_f14_2 * arg1->unk2C));\n arg2->unk34 = (f32) ((temp_f0_2 * arg1->unk30) + (temp_f2_2 * arg1->unk34) + (temp_f12_2 * arg1->unk38) + (temp_f14_2 * arg1->unk3C));\n temp_f0_3 = arg0->unk8;\n temp_f2_3 = arg0->unk18;\n temp_f12_3 = arg0->unk28;\n temp_f14_3 = arg0->unk38;\n arg2->unk8 = (f32) ((temp_f0_3 * arg1->unk0) + (temp_f2_3 * arg1->unk4) + (temp_f12_3 * arg1->unk8) + (temp_f14_3 * arg1->unkC));\n arg2->unk18 = (f32) ((temp_f0_3 * arg1->unk10) + (temp_f2_3 * arg1->unk14) + (temp_f12_3 * arg1->unk18) + (temp_f14_3 * arg1->unk1C));\n arg2->unk28 = (f32) ((temp_f0_3 * arg1->unk20) + (temp_f2_3 * arg1->unk24) + (temp_f12_3 * arg1->unk28) + (temp_f14_3 * arg1->unk2C));\n arg2->unk38 = (f32) ((temp_f0_3 * arg1->unk30) + (temp_f2_3 * arg1->unk34) + (temp_f12_3 * arg1->unk38) + (temp_f14_3 * arg1->unk3C));\n temp_f0_4 = arg0->unkC;\n temp_f2_4 = arg0->unk1C;\n temp_f12_4 = arg0->unk2C;\n temp_f14_4 = arg0->unk3C;\n arg2->unkC = (f32) ((temp_f0_4 * arg1->unk0) + (temp_f2_4 * arg1->unk4) + (temp_f12_4 * arg1->unk8) + (temp_f14_4 * arg1->unkC));\n arg2->unk1C = (f32) ((temp_f0_4 * arg1->unk10) + (temp_f2_4 * arg1->unk14) + (temp_f12_4 * arg1->unk18) + (temp_f14_4 * arg1->unk1C));\n arg2->unk2C = (f32) ((temp_f0_4 * arg1->unk20) + (temp_f2_4 * arg1->unk24) + (temp_f12_4 * arg1->unk28) + (temp_f14_4 * arg1->unk2C));\n arg2->unk3C = (f32) ((temp_f0_4 * arg1->unk30) + (temp_f2_4 * arg1->unk34) + (temp_f12_4 * arg1->unk38) + (temp_f14_4 * arg1->unk3C));\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":50,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Skin_Matrix_MulMatrix` — benchmark function af:Skin_Matrix_MulMatrix:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Skin_Matrix_MulMatrix\n addiu\t$sp, $sp, -24\n sdc1\t$f22, 16($sp)\n sdc1\t$f20, 8($sp)\n lwc1\t$f0, 0($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 16($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 32($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 48($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 16($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 32($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 48($a2)\n lwc1\t$f0, 4($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 20($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 36($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 52($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 4($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 20($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 36($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 52($a2)\n lwc1\t$f0, 8($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 24($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 40($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 56($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 8($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 24($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 40($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 56($a2)\n lwc1\t$f0, 12($a0)\n lwc1\t$f16, 0($a1)\n lwc1\t$f2, 28($a0)\n lwc1\t$f18, 4($a1)\n mul.s\t$f4, $f0, $f16\n lwc1\t$f12, 44($a0)\n lwc1\t$f20, 8($a1)\n mul.s\t$f6, $f2, $f18\n lwc1\t$f14, 60($a0)\n lwc1\t$f22, 12($a1)\n mul.s\t$f10, $f12, $f20\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f14, $f22\n add.s\t$f4, $f8, $f10\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 12($a2)\n lwc1\t$f16, 16($a1)\n lwc1\t$f18, 20($a1)\n lwc1\t$f20, 24($a1)\n mul.s\t$f10, $f0, $f16\n lwc1\t$f22, 28($a1)\n mul.s\t$f4, $f2, $f18\n mul.s\t$f8, $f12, $f20\n add.s\t$f6, $f10, $f4\n mul.s\t$f4, $f14, $f22\n add.s\t$f10, $f6, $f8\n add.s\t$f6, $f10, $f4\n swc1\t$f6, 28($a2)\n lwc1\t$f16, 32($a1)\n lwc1\t$f18, 36($a1)\n lwc1\t$f20, 40($a1)\n mul.s\t$f8, $f0, $f16\n lwc1\t$f22, 44($a1)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f6, $f12, $f20\n add.s\t$f4, $f8, $f10\n mul.s\t$f10, $f14, $f22\n add.s\t$f8, $f4, $f6\n add.s\t$f4, $f8, $f10\n swc1\t$f4, 44($a2)\n lwc1\t$f16, 48($a1)\n lwc1\t$f18, 52($a1)\n lwc1\t$f20, 56($a1)\n mul.s\t$f6, $f0, $f16\n lwc1\t$f22, 60($a1)\n mul.s\t$f8, $f2, $f18\n mul.s\t$f4, $f12, $f20\n add.s\t$f10, $f6, $f8\n mul.s\t$f8, $f14, $f22\n add.s\t$f6, $f10, $f4\n add.s\t$f10, $f6, $f8\n swc1\t$f10, 60($a2)\n ldc1\t$f22, 16($sp)\n ldc1\t$f20, 8($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Skin_Matrix_MulMatrix # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Skin_Matrix_MulMatrix` — benchmark function af:Skin_Matrix_MulMatrix:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:Skin_Matrix_MulMatrix: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:\tsdc1\t$f22,16(sp)\n 8:\tsdc1\t$f20,8(sp)\n c:\tlwc1\t$f0,0(a0)\n 10:\tlwc1\t$f16,0(a1)\n 14:\tlwc1\t$f2,16(a0)\n 18:\tlwc1\t$f18,4(a1)\n 1c:\tmul.s\t$f4,$f0,$f16\n 20:\tlwc1\t$f12,32(a0)\n 24:\tlwc1\t$f20,8(a1)\n 28:\tmul.s\t$f6,$f2,$f18\n 2c:\tlwc1\t$f14,48(a0)\n 30:\tlwc1\t$f22,12(a1)\n 34:\tmul.s\t$f10,$f12,$f20\n 38:\tadd.s\t$f8,$f4,$f6\n 3c:\tmul.s\t$f6,$f14,$f22\n 40:\tadd.s\t$f4,$f8,$f10\n 44:\tadd.s\t$f8,$f4,$f6\n 48:\tswc1\t$f8,0(a2)\n 4c:\tlwc1\t$f16,16(a1)\n 50:\tlwc1\t$f18,20(a1)\n 54:\tlwc1\t$f20,24(a1)\n 58:\tmul.s\t$f10,$f0,$f16\n 5c:\tlwc1\t$f22,28(a1)\n 60:\tmul.s\t$f4,$f2,$f18\n 64:\tmul.s\t$f8,$f12,$f20\n 68:\tadd.s\t$f6,$f10,$f4\n 6c:\tmul.s\t$f4,$f14,$f22\n 70:\tadd.s\t$f10,$f6,$f8\n 74:\tadd.s\t$f6,$f10,$f4\n 78:\tswc1\t$f6,16(a2)\n 7c:\tlwc1\t$f16,32(a1)\n 80:\tlwc1\t$f18,36(a1)\n 84:\tlwc1\t$f20,40(a1)\n 88:\tmul.s\t$f8,$f0,$f16\n 8c:\tlwc1\t$f22,44(a1)\n 90:\tmul.s\t$f10,$f2,$f18\n 94:\tmul.s\t$f6,$f12,$f20\n 98:\tadd.s\t$f4,$f8,$f10\n 9c:\tmul.s\t$f10,$f14,$f22\n a0:\tadd.s\t$f8,$f4,$f6\n a4:\tadd.s\t$f4,$f8,$f10\n a8:\tswc1\t$f4,32(a2)\n ac:\tlwc1\t$f16,48(a1)\n b0:\tlwc1\t$f18,52(a1)\n b4:\tlwc1\t$f20,56(a1)\n b8:\tmul.s\t$f6,$f0,$f16\n bc:\tlwc1\t$f22,60(a1)\n c0:\tmul.s\t$f8,$f2,$f18\n c4:\tmul.s\t$f4,$f12,$f20\n c8:\tadd.s\t$f10,$f6,$f8\n cc:\tmul.s\t$f8,$f14,$f22\n d0:\tadd.s\t$f6,$f10,$f4\n d4:\tadd.s\t$f10,$f6,$f8\n d8:\tswc1\t$f10,48(a2)\n dc:\tlwc1\t$f0,4(a0)\n e0:\tlwc1\t$f16,0(a1)\n e4:\tlwc1\t$f2,20(a0)\n e8:\tlwc1\t$f18,4(a1)\n ec:\tmul.s\t$f4,$f0,$f16\n f0:\tlwc1\t$f12,36(a0)\n f4:\tlwc1\t$f20,8(a1)\n f8:\tmul.s\t$f6,$f2,$f18\n fc:\tlwc1\t$f14,52(a0)\n 100:\tlwc1\t$f22,12(a1)\n 104:\tmul.s\t$f10,$f12,$f20\n 108:\tadd.s\t$f8,$f4,$f6\n 10c:\tmul.s\t$f6,$f14,$f22\n 110:\tadd.s\t$f4,$f8,$f10\n 114:\tadd.s\t$f8,$f4,$f6\n 118:\tswc1\t$f8,4(a2)\n 11c:\tlwc1\t$f16,16(a1)\n 120:\tlwc1\t$f18,20(a1)\n 124:\tlwc1\t$f20,24(a1)\n 128:\tmul.s\t$f10,$f0,$f16\n 12c:\tlwc1\t$f22,28(a1)\n 130:\tmul.s\t$f4,$f2,$f18\n 134:\tmul.s\t$f8,$f12,$f20\n 138:\tadd.s\t$f6,$f10,$f4\n 13c:\tmul.s\t$f4,$f14,$f22\n 140:\tadd.s\t$f10,$f6,$f8\n 144:\tadd.s\t$f6,$f10,$f4\n 148:\tswc1\t$f6,20(a2)\n 14c:\tlwc1\t$f16,32(a1)\n 150:\tlwc1\t$f18,36(a1)\n 154:\tlwc1\t$f20,40(a1)\n 158:\tmul.s\t$f8,$f0,$f16\n 15c:\tlwc1\t$f22,44(a1)\n 160:\tmul.s\t$f10,$f2,$f18\n 164:\tmul.s\t$f6,$f12,$f20\n 168:\tadd.s\t$f4,$f8,$f10\n 16c:\tmul.s\t$f10,$f14,$f22\n 170:\tadd.s\t$f8,$f4,$f6\n 174:\tadd.s\t$f4,$f8,$f10\n 178:\tswc1\t$f4,36(a2)\n 17c:\tlwc1\t$f16,48(a1)\n 180:\tlwc1\t$f18,52(a1)\n 184:\tlwc1\t$f20,56(a1)\n 188:\tmul.s\t$f6,$f0,$f16\n 18c:\tlwc1\t$f22,60(a1)\n 190:\tmul.s\t$f8,$f2,$f18\n 194:\tmul.s\t$f4,$f12,$f20\n 198:\tadd.s\t$f10,$f6,$f8\n 19c:\tmul.s\t$f8,$f14,$f22\n 1a0:\tadd.s\t$f6,$f10,$f4\n 1a4:\tadd.s\t$f10,$f6,$f8\n 1a8:\tswc1\t$f10,52(a2)\n 1ac:\tlwc1\t$f0,8(a0)\n 1b0:\tlwc1\t$f16,0(a1)\n 1b4:\tlwc1\t$f2,24(a0)\n 1b8:\tlwc1\t$f18,4(a1)\n 1bc:\tmul.s\t$f4,$f0,$f16\n 1c0:\tlwc1\t$f12,40(a0)\n 1c4:\tlwc1\t$f20,8(a1)\n 1c8:\tmul.s\t$f6,$f2,$f18\n 1cc:\tlwc1\t$f14,56(a0)\n 1d0:\tlwc1\t$f22,12(a1)\n 1d4:\tmul.s\t$f10,$f12,$f20\n 1d8:\tadd.s\t$f8,$f4,$f6\n 1dc:\tmul.s\t$f6,$f14,$f22\n 1e0:\tadd.s\t$f4,$f8,$f10\n 1e4:\tadd.s\t$f8,$f4,$f6\n 1e8:\tswc1\t$f8,8(a2)\n 1ec:\tlwc1\t$f16,16(a1)\n 1f0:\tlwc1\t$f18,20(a1)\n 1f4:\tlwc1\t$f20,24(a1)\n 1f8:\tmul.s\t$f10,$f0,$f16\n 1fc:\tlwc1\t$f22,28(a1)\n 200:\tmul.s\t$f4,$f2,$f18\n 204:\tmul.s\t$f8,$f12,$f20\n 208:\tadd.s\t$f6,$f10,$f4\n 20c:\tmul.s\t$f4,$f14,$f22\n 210:\tadd.s\t$f10,$f6,$f8\n 214:\tadd.s\t$f6,$f10,$f4\n 218:\tswc1\t$f6,24(a2)\n 21c:\tlwc1\t$f16,32(a1)\n 220:\tlwc1\t$f18,36(a1)\n 224:\tlwc1\t$f20,40(a1)\n 228:\tmul.s\t$f8,$f0,$f16\n 22c:\tlwc1\t$f22,44(a1)\n 230:\tmul.s\t$f10,$f2,$f18\n 234:\tmul.s\t$f6,$f12,$f20\n 238:\tadd.s\t$f4,$f8,$f10\n 23c:\tmul.s\t$f10,$f14,$f22\n 240:\tadd.s\t$f8,$f4,$f6\n 244:\tadd.s\t$f4,$f8,$f10\n 248:\tswc1\t$f4,40(a2)\n 24c:\tlwc1\t$f16,48(a1)\n 250:\tlwc1\t$f18,52(a1)\n 254:\tlwc1\t$f20,56(a1)\n 258:\tmul.s\t$f6,$f0,$f16\n 25c:\tlwc1\t$f22,60(a1)\n 260:\tmul.s\t$f8,$f2,$f18\n 264:\tmul.s\t$f4,$f12,$f20\n 268:\tadd.s\t$f10,$f6,$f8\n 26c:\tmul.s\t$f8,$f14,$f22\n 270:\tadd.s\t$f6,$f10,$f4\n 274:\tadd.s\t$f10,$f6,$f8\n 278:\tswc1\t$f10,56(a2)\n 27c:\tlwc1\t$f0,12(a0)\n 280:\tlwc1\t$f16,0(a1)\n 284:\tlwc1\t$f2,28(a0)\n 288:\tlwc1\t$f18,4(a1)\n 28c:\tmul.s\t$f4,$f0,$f16\n 290:\tlwc1\t$f12,44(a0)\n 294:\tlwc1\t$f20,8(a1)\n 298:\tmul.s\t$f6,$f2,$f18\n 29c:\tlwc1\t$f14,60(a0)\n 2a0:\tlwc1\t$f22,12(a1)\n 2a4:\tmul.s\t$f10,$f12,$f20\n 2a8:\tadd.s\t$f8,$f4,$f6\n 2ac:\tmul.s\t$f6,$f14,$f22\n 2b0:\tadd.s\t$f4,$f8,$f10\n 2b4:\tadd.s\t$f8,$f4,$f6\n 2b8:\tswc1\t$f8,12(a2)\n 2bc:\tlwc1\t$f16,16(a1)\n 2c0:\tlwc1\t$f18,20(a1)\n 2c4:\tlwc1\t$f20,24(a1)\n 2c8:\tmul.s\t$f10,$f0,$f16\n 2cc:\tlwc1\t$f22,28(a1)\n 2d0:\tmul.s\t$f4,$f2,$f18\n 2d4:\tmul.s\t$f8,$f12,$f20\n 2d8:\tadd.s\t$f6,$f10,$f4\n 2dc:\tmul.s\t$f4,$f14,$f22\n 2e0:\tadd.s\t$f10,$f6,$f8\n 2e4:\tadd.s\t$f6,$f10,$f4\n 2e8:\tswc1\t$f6,28(a2)\n 2ec:\tlwc1\t$f16,32(a1)\n 2f0:\tlwc1\t$f18,36(a1)\n 2f4:\tlwc1\t$f20,40(a1)\n 2f8:\tmul.s\t$f8,$f0,$f16\n 2fc:\tlwc1\t$f22,44(a1)\n 300:\tmul.s\t$f10,$f2,$f18\n 304:\tmul.s\t$f6,$f12,$f20\n 308:\tadd.s\t$f4,$f8,$f10\n 30c:\tmul.s\t$f10,$f14,$f22\n 310:\tadd.s\t$f8,$f4,$f6\n 314:\tadd.s\t$f4,$f8,$f10\n 318:\tswc1\t$f4,44(a2)\n 31c:\tlwc1\t$f16,48(a1)\n 320:\tlwc1\t$f18,52(a1)\n 324:\tlwc1\t$f20,56(a1)\n 328:\tmul.s\t$f6,$f0,$f16\n 32c:\tlwc1\t$f22,60(a1)\n 330:\tmul.s\t$f8,$f2,$f18\n 334:\tmul.s\t$f4,$f12,$f20\n 338:\tadd.s\t$f10,$f6,$f8\n 33c:\tmul.s\t$f8,$f14,$f22\n 340:\tadd.s\t$f6,$f10,$f4\n 344:\tadd.s\t$f10,$f6,$f8\n 348:\tswc1\t$f10,60(a2)\n 34c:\tldc1\t$f22,16(sp)\n 350:\tldc1\t$f20,8(sp)\n 354:\tjr\tra\n 358:\taddiu\tsp,sp,24\n 35c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000360 .text\n00000000 g F .text\t0000035c Skin_Matrix_MulMatrix\n\n\nContents of section .text:\n 0000 27bdffe8 f7b60010 f7b40008 c4800000 '...............\n 0010 c4b00000 c4820010 c4b20004 46100102 ............F...\n 0020 c48c0020 c4b40008 46121182 c48e0030 ... ....F......0\n 0030 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0040 460a4100 46062200 e4c80000 c4b00010 F.A.F.\".........\n 0050 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0060 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0070 46083280 46045180 e4c60010 c4b00020 F.2.F.Q........ \n 0080 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0090 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 00a0 46062200 460a4100 e4c40020 c4b00030 F.\".F.A.... ...0\n 00b0 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 00c0 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 00d0 46045180 46083280 e4ca0030 c4800004 F.Q.F.2....0....\n 00e0 c4b00000 c4820014 c4b20004 46100102 ............F...\n 00f0 c48c0024 c4b40008 46121182 c48e0034 ...$....F......4\n 0100 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 0110 460a4100 46062200 e4c80004 c4b00010 F.A.F.\".........\n 0120 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0130 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0140 46083280 46045180 e4c60014 c4b00020 F.2.F.Q........ \n 0150 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0160 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0170 46062200 460a4100 e4c40024 c4b00030 F.\".F.A....$...0\n 0180 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0190 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 01a0 46045180 46083280 e4ca0034 c4800008 F.Q.F.2....4....\n 01b0 c4b00000 c4820018 c4b20004 46100102 ............F...\n 01c0 c48c0028 c4b40008 46121182 c48e0038 ...(....F......8\n 01d0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 01e0 460a4100 46062200 e4c80008 c4b00010 F.A.F.\".........\n 01f0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 0200 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 0210 46083280 46045180 e4c60018 c4b00020 F.2.F.Q........ \n 0220 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0230 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0240 46062200 460a4100 e4c40028 c4b00030 F.\".F.A....(...0\n 0250 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0260 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0270 46045180 46083280 e4ca0038 c480000c F.Q.F.2....8....\n 0280 c4b00000 c482001c c4b20004 46100102 ............F...\n 0290 c48c002c c4b40008 46121182 c48e003c ...,....F......<\n 02a0 c4b6000c 46146282 46062200 46167182 ....F.b.F.\".F.q.\n 02b0 460a4100 46062200 e4c8000c c4b00010 F.A.F.\".........\n 02c0 c4b20014 c4b40018 46100282 c4b6001c ........F.......\n 02d0 46121102 46146202 46045180 46167102 F...F.b.F.Q.F.q.\n 02e0 46083280 46045180 e4c6001c c4b00020 F.2.F.Q........ \n 02f0 c4b20024 c4b40028 46100202 c4b6002c ...$...(F......,\n 0300 46121282 46146182 460a4100 46167282 F...F.a.F.A.F.r.\n 0310 46062200 460a4100 e4c4002c c4b00030 F.\".F.A....,...0\n 0320 c4b20034 c4b40038 46100182 c4b6003c ...4...8F......<\n 0330 46121202 46146102 46083280 46167202 F...F.a.F.2.F.r.\n 0340 46045180 46083280 e4ca003c d7b60010 F.Q.F.2....<....\n 0350 d7b40008 03e00008 27bd0018 00000000 ........'.......\nContents of section .options:\n 0000 01200000 00000000 a0000070 00000000 . .........p....\n 0010 00f55ff5 00000000 00000000 00007ff0 .._.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000070 00000000 00f55ff5 00000000 ...p......_.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000d7 00000078 000004d8 p..........x....\n 0010 00000005 000006a8 00000001 00000550 ...............P\n 0020 00000004 00000584 00000000 00000000 ................\n 0030 00000011 000005b4 00000040 000005f8 ...........@....\n 0040 00000018 00000638 00000001 00000650 .......8.......P\n 0050 00000000 00000000 00000001 00000698 ................\n 0060 025040d0 4030a040 20b04015 10101020 .P@.@0.@ .@.... \n 0070 f0161010 1020f016 10101020 f0161040 ..... ..... ...@\n 0080 d04030a0 4020b040 15101010 20f01610 .@0.@ .@.... ...\n 0090 101020f0 16101010 20f01610 40d04030 .. ..... ...@.@0\n 00a0 a04020b0 40151010 1020f016 10101020 .@ .@.... ..... \n 00b0 f0161010 1020f016 1040d040 30a04020 ..... ...@.@0.@ \n 00c0 b0401510 101020f0 16101010 20f01610 .@.... ..... ...\n 00d0 101020f0 16130000 00000000 00000001 .. .............\n 00e0 00000000 00000000 00000000 ffffffff ................\n 00f0 00f00000 fffffff8 00000018 001d001f ................\n 0100 0000001b 00000080 00000000 00000001 ................\n 0110 00000000 2c200004 0000002a 00000000 ...., .....*....\n 0120 1820000f 0000002a 0000035c 20200001 . .....*...\\ ..\n 0130 00000001 00000000 20200000 02000000 ........ ......\n 0140 03000000 04000000 05000000 06000000 ................\n 0150 07000000 08000000 09000000 20000000 ............ ...\n 0160 21000000 0a000000 0b000000 0b000000 !...............\n 0170 1a000000 00000000 00000003 06000000 ................\n 0180 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0190 2d69646f 2d393839 35333264 66373437 -ido-989532df747\n 01a0 65343033 612f752e 6900536b 696e5f4d e403a/u.i.Skin_M\n 01b0 61747269 785f4d75 6c4d6174 72697800 atrix_MulMatrix.\n 01c0 536b696e 5f4d6174 7269785f 4d756c4d Skin_Matrix_MulM\n 01d0 61747269 78000000 00000000 00000001 atrix...........\n 01e0 00000000 00000040 00000000 00000004 .......@........\n 01f0 00000000 000000d7 00000000 00000000 ................\n 0200 00000001 00000000 00000011 00000000 ................\n 0210 00000000 01800000 00000000 00000076 ...............v\n 0220 00000000 00000000 00000000 18200001 ............. ..\n 0230 00000000 00000000 00000000 00000000 ................\n 0240 00000000 00000000 7fffffff 00000000 ................\n 0250 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Skin_Matrix_MulMatrix\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 Skin_Matrix_MulMatrix # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:Skin_Matrix_SetQuaternion:ido7.1","sym":"Skin_Matrix_SetQuaternion","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","matrix","arithmetic"],"loc":47,"refSource":"void Skin_Matrix_SetQuaternion(MtxF* mf, f32* q) {\n f32 n;\n f32 xNorm;\n f32 yNorm;\n f32 zNorm;\n f32 wxNorm;\n f32 wyNorm;\n f32 wzNorm;\n f32 xxNorm;\n f32 xyNorm;\n f32 xzNorm;\n f32 yyNorm;\n f32 yzNorm;\n f32 zzNorm;\n\n n = 2.0f / ((q[3] * q[3]) + ((q[2] * q[2]) + ((q[1] * q[1]) + (q[0] * q[0]))));\n xNorm = q[0] * n;\n yNorm = q[1] * n;\n zNorm = q[2] * n;\n\n wxNorm = q[3] * xNorm;\n wyNorm = q[3] * yNorm;\n wzNorm = q[3] * zNorm;\n xxNorm = q[0] * xNorm;\n xyNorm = q[0] * yNorm;\n xzNorm = q[0] * zNorm;\n yyNorm = q[1] * yNorm;\n yzNorm = q[1] * zNorm;\n zzNorm = q[2] * zNorm;\n\n mf->xx = (1.0f - (yyNorm + zzNorm));\n mf->yx = (xyNorm + wzNorm);\n mf->zx = (xzNorm - wyNorm);\n mf->wx = 0.0f;\n mf->xy = (xyNorm - wzNorm);\n mf->yy = (1.0f - (xxNorm + zzNorm));\n mf->zy = (yzNorm + wxNorm);\n mf->wy = 0.0f;\n mf->xz = (yzNorm + wyNorm);\n mf->yz = (yzNorm - wxNorm);\n mf->zz = (1.0f - (xxNorm + yyNorm));\n mf->wz = 0.0f;\n mf->xw = 0.0f;\n mf->yw = 0.0f;\n mf->ww = 1.0f;\n mf->zw = 0.0f;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_skin_matrix.c#L581-L627","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-72\n 4:\tsdc1\t$f20,8(sp)\n 8:\tlwc1\t$f0,0(a1)\n c:\tlwc1\t$f2,4(a1)\n 10:\tlwc1\t$f12,8(a1)\n 14:\tmul.s\t$f4,$f0,$f0\n 18:\tlwc1\t$f20,12(a1)\n 1c:\tlui\tat,0x4000\n 20:\tmul.s\t$f6,$f2,$f2\n 24:\tmul.s\t$f10,$f12,$f12\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tmul.s\t$f6,$f20,$f20\n 30:\tadd.s\t$f4,$f8,$f10\n 34:\tmtc1\tat,$f10\n 38:\tlui\tat,0x3f80\n 3c:\tadd.s\t$f8,$f4,$f6\n 40:\tdiv.s\t$f18,$f10,$f8\n 44:\tmul.s\t$f4,$f0,$f18\n 48:\tmul.s\t$f16,$f2,$f18\n 4c:\tmul.s\t$f14,$f12,$f18\n 50:\tswc1\t$f4,64(sp)\n 54:\tlwc1\t$f6,64(sp)\n 58:\tmul.s\t$f10,$f20,$f6\n 5c:\tmul.s\t$f8,$f20,$f16\n 60:\tmul.s\t$f4,$f20,$f14\n 64:\tswc1\t$f10,52(sp)\n 68:\tmul.s\t$f10,$f0,$f6\n 6c:\tswc1\t$f8,48(sp)\n 70:\tmul.s\t$f8,$f0,$f16\n 74:\tswc1\t$f4,44(sp)\n 78:\tmul.s\t$f18,$f0,$f14\n 7c:\tswc1\t$f10,40(sp)\n 80:\tmtc1\tzero,$f0\n 84:\tmul.s\t$f4,$f2,$f16\n 88:\tswc1\t$f8,36(sp)\n 8c:\tmtc1\tat,$f16\n 90:\tmul.s\t$f6,$f2,$f14\n 94:\tmul.s\t$f10,$f12,$f14\n 98:\tswc1\t$f4,28(sp)\n 9c:\tlwc1\t$f8,28(sp)\n a0:\tswc1\t$f6,24(sp)\n a4:\tswc1\t$f10,20(sp)\n a8:\tlwc1\t$f4,20(sp)\n ac:\tmtc1\tat,$f10\n b0:\tadd.s\t$f6,$f8,$f4\n b4:\tsub.s\t$f8,$f10,$f6\n b8:\tswc1\t$f8,0(a0)\n bc:\tlwc1\t$f10,44(sp)\n c0:\tlwc1\t$f4,36(sp)\n c4:\tadd.s\t$f6,$f4,$f10\n c8:\tswc1\t$f6,4(a0)\n cc:\tlwc1\t$f8,48(sp)\n d0:\tsub.s\t$f4,$f18,$f8\n d4:\tswc1\t$f4,8(a0)\n d8:\tlwc1\t$f14,40(sp)\n dc:\tlwc1\t$f12,52(sp)\n e0:\tlwc1\t$f2,24(sp)\n e4:\tswc1\t$f0,12(a0)\n e8:\tlwc1\t$f6,44(sp)\n ec:\tlwc1\t$f10,36(sp)\n f0:\tsub.s\t$f8,$f10,$f6\n f4:\tswc1\t$f8,16(a0)\n f8:\tlwc1\t$f4,20(sp)\n fc:\tadd.s\t$f8,$f2,$f12\n 100:\tswc1\t$f0,28(a0)\n 104:\tadd.s\t$f10,$f14,$f4\n 108:\tswc1\t$f8,24(a0)\n 10c:\tsub.s\t$f6,$f16,$f10\n 110:\tswc1\t$f6,20(a0)\n 114:\tlwc1\t$f4,48(sp)\n 118:\tsub.s\t$f6,$f2,$f12\n 11c:\tadd.s\t$f10,$f2,$f4\n 120:\tswc1\t$f6,36(a0)\n 124:\tswc1\t$f10,32(a0)\n 128:\tlwc1\t$f8,28(sp)\n 12c:\tswc1\t$f0,44(a0)\n 130:\tswc1\t$f0,48(a0)\n 134:\tadd.s\t$f4,$f14,$f8\n 138:\tswc1\t$f0,52(a0)\n 13c:\tswc1\t$f0,56(a0)\n 140:\tswc1\t$f16,60(a0)\n 144:\tsub.s\t$f10,$f16,$f4\n 148:\tswc1\t$f10,40(a0)\n 14c:\tldc1\t$f20,8(sp)\n 150:\tjr\tra\n 154:\taddiu\tsp,sp,72\n\t...\n","proto":{"Skin_Matrix_SetQuaternion":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000160 .text\n00000000 g F .text\t00000158 Skin_Matrix_SetQuaternion\n\n\nContents of section .text:\n 0000 27bdffb8 f7b40008 c4a00000 c4a20004 '...............\n 0010 c4ac0008 46000102 c4b4000c 3c014000 ....F.......<.@.\n 0020 46021182 460c6282 46062200 4614a182 F...F.b.F.\".F...\n 0030 460a4100 44815000 3c013f80 46062200 F.A.D.P.<.?.F.\".\n 0040 46085483 46120102 46121402 46126382 F.T.F...F...F.c.\n 0050 e7a40040 c7a60040 4606a282 4610a202 ...@...@F...F...\n 0060 460ea102 e7aa0034 46060282 e7a80030 F......4F......0\n 0070 46100202 e7a4002c 460e0482 e7aa0028 F......,F......(\n 0080 44800000 46101102 e7a80024 44818000 D...F......$D...\n 0090 460e1182 460e6282 e7a4001c c7a8001c F...F.b.........\n 00a0 e7a60018 e7aa0014 c7a40014 44815000 ............D.P.\n 00b0 46044180 46065201 e4880000 c7aa002c F.A.F.R........,\n 00c0 c7a40024 460a2180 e4860004 c7a80030 ...$F.!........0\n 00d0 46089101 e4840008 c7ae0028 c7ac0034 F..........(...4\n 00e0 c7a20018 e480000c c7a6002c c7aa0024 ...........,...$\n 00f0 46065201 e4880010 c7a40014 460c1200 F.R.........F...\n 0100 e480001c 46047280 e4880018 460a8181 ....F.r.....F...\n 0110 e4860014 c7a40030 460c1181 46041280 .......0F...F...\n 0120 e4860024 e48a0020 c7a8001c e480002c ...$... .......,\n 0130 e4800030 46087100 e4800034 e4800038 ...0F.q....4...8\n 0140 e490003c 46048281 e48a0028 d7b40008 ...\n 01f0 00000000 00000000 00000000 18200001 ............. ..\n 0200 00000000 00000000 00000000 00000000 ................\n 0210 00000000 00000000 7fffffff 00000000 ................\n 0220 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Skin_Matrix_SetQuaternion' — lift: cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-72 */\n/* 4:\tsdc1\t$f20,8(sp) */\n/* 8:\tlwc1\t$f0,0(a1) */\n/* c:\tlwc1\t$f2,4(a1) */\n/* 10:\tlwc1\t$f12,8(a1) */\n/* 14:\tmul.s\t$f4,$f0,$f0 */\n/* 18:\tlwc1\t$f20,12(a1) */\n/* 1c:\tlui\tat,0x4000 */\n/* 20:\tmul.s\t$f6,$f2,$f2 */\n/* 24:\tmul.s\t$f10,$f12,$f12 */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tmul.s\t$f6,$f20,$f20 */\n/* 30:\tadd.s\t$f4,$f8,$f10 */\n/* 34:\tmtc1\tat,$f10 */\n/* 38:\tlui\tat,0x3f80 */\n/* 3c:\tadd.s\t$f8,$f4,$f6 */\n/* 40:\tdiv.s\t$f18,$f10,$f8 */\n/* 44:\tmul.s\t$f4,$f0,$f18 */\n/* 48:\tmul.s\t$f16,$f2,$f18 */\n/* 4c:\tmul.s\t$f14,$f12,$f18 */\n/* 50:\tswc1\t$f4,64(sp) */\n/* 54:\tlwc1\t$f6,64(sp) */\n/* 58:\tmul.s\t$f10,$f20,$f6 */\n/* 5c:\tmul.s\t$f8,$f20,$f16 */\n/* 60:\tmul.s\t$f4,$f20,$f14 */\n/* 64:\tswc1\t$f10,52(sp) */\n/* 68:\tmul.s\t$f10,$f0,$f6 */\n/* 6c:\tswc1\t$f8,48(sp) */\n/* 70:\tmul.s\t$f8,$f0,$f16 */\n/* 74:\tswc1\t$f4,44(sp) */\n/* 78:\tmul.s\t$f18,$f0,$f14 */\n/* 7c:\tswc1\t$f10,40(sp) */\n/* 80:\tmtc1\tzero,$f0 */\n/* 84:\tmul.s\t$f4,$f2,$f16 */\n/* 88:\tswc1\t$f8,36(sp) */\n/* 8c:\tmtc1\tat,$f16 */\n/* 90:\tmul.s\t$f6,$f2,$f14 */\n/* 94:\tmul.s\t$f10,$f12,$f14 */\n/* 98:\tswc1\t$f4,28(sp) */\n/* 9c:\tlwc1\t$f8,28(sp) */\n/* a0:\tswc1\t$f6,24(sp) */\n/* a4:\tswc1\t$f10,20(sp) */\n/* a8:\tlwc1\t$f4,20(sp) */\n/* ac:\tmtc1\tat,$f10 */\n/* b0:\tadd.s\t$f6,$f8,$f4 */\n/* b4:\tsub.s\t$f8,$f10,$f6 */\n/* b8:\tswc1\t$f8,0(a0) */\n/* bc:\tlwc1\t$f10,44(sp) */\n/* c0:\tlwc1\t$f4,36(sp) */\n/* c4:\tadd.s\t$f6,$f4,$f10 */\n/* c8:\tswc1\t$f6,4(a0) */\n/* cc:\tlwc1\t$f8,48(sp) */\n/* d0:\tsub.s\t$f4,$f18,$f8 */\n/* d4:\tswc1\t$f4,8(a0) */\n/* d8:\tlwc1\t$f14,40(sp) */\n/* dc:\tlwc1\t$f12,52(sp) */\n/* e0:\tlwc1\t$f2,24(sp) */\n/* e4:\tswc1\t$f0,12(a0) */\n/* e8:\tlwc1\t$f6,44(sp) */\n/* ec:\tlwc1\t$f10,36(sp) */\n/* f0:\tsub.s\t$f8,$f10,$f6 */\n/* f4:\tswc1\t$f8,16(a0) */\n/* f8:\tlwc1\t$f4,20(sp) */\n/* fc:\tadd.s\t$f8,$f2,$f12 */\n/* 100:\tswc1\t$f0,28(a0) */\n/* 104:\tadd.s\t$f10,$f14,$f4 */\n/* 108:\tswc1\t$f8,24(a0) */\n/* 10c:\tsub.s\t$f6,$f16,$f10 */\n/* 110:\tswc1\t$f6,20(a0) */\n/* 114:\tlwc1\t$f4,48(sp) */\n/* 118:\tsub.s\t$f6,$f2,$f12 */\n/* 11c:\tadd.s\t$f10,$f2,$f4 */\n/* 120:\tswc1\t$f6,36(a0) */\n/* 124:\tswc1\t$f10,32(a0) */\n/* 128:\tlwc1\t$f8,28(sp) */\n/* 12c:\tswc1\t$f0,44(a0) */\n/* 130:\tswc1\t$f0,48(a0) */\n/* 134:\tadd.s\t$f4,$f14,$f8 */\n/* 138:\tswc1\t$f0,52(a0) */\n/* 13c:\tswc1\t$f0,56(a0) */\n/* 140:\tswc1\t$f16,60(a0) */\n/* 144:\tsub.s\t$f10,$f16,$f4 */\n/* 148:\tswc1\t$f10,40(a0) */\n/* 14c:\tldc1\t$f20,8(sp) */\n/* 150:\tjr\tra */\n/* 154:\taddiu\tsp,sp,72 */\n/* \t... */\nvoid Skin_Matrix_SetQuaternion(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":95,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Skin_Matrix_SetQuaternion @0x4': unmodelled store-class instruction 'sdc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Skin_Matrix_SetQuaternion(void *arg0, void *arg1) {\n f32 sp40;\n f32 sp34;\n f32 sp30;\n f32 sp2C;\n f32 sp28;\n f32 sp24;\n f32 sp1C;\n f32 sp18;\n f32 sp14;\n f32 temp_f0;\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f16;\n f32 temp_f18;\n f32 temp_f20;\n f32 temp_f2;\n f32 temp_f8;\n\n temp_f0 = arg1->unk0;\n temp_f2 = arg1->unk4;\n temp_f12 = arg1->unk8;\n temp_f20 = arg1->unkC;\n temp_f18 = 2.0f / ((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f12 * temp_f12) + (temp_f20 * temp_f20));\n temp_f16 = temp_f2 * temp_f18;\n temp_f14 = temp_f12 * temp_f18;\n sp40 = temp_f0 * temp_f18;\n temp_f8 = temp_f20 * temp_f16;\n sp34 = temp_f20 * sp40;\n sp30 = temp_f8;\n sp2C = temp_f20 * temp_f14;\n sp28 = temp_f0 * sp40;\n sp24 = temp_f0 * temp_f16;\n sp1C = temp_f2 * temp_f16;\n sp18 = temp_f2 * temp_f14;\n sp14 = temp_f12 * temp_f14;\n arg0->unk0 = (f32) (1.0f - (sp1C + sp14));\n arg0->unk4 = (f32) (sp24 + sp2C);\n arg0->unk8 = (f32) ((temp_f0 * temp_f14) - temp_f8);\n arg0->unkC = 0.0f;\n arg0->unk10 = (f32) (sp24 - sp2C);\n arg0->unk1C = 0.0f;\n arg0->unk18 = (f32) (sp18 + sp34);\n arg0->unk14 = (f32) (1.0f - (sp28 + sp14));\n arg0->unk24 = (f32) (sp18 - sp34);\n arg0->unk20 = (f32) (sp18 + sp30);\n arg0->unk2C = 0.0f;\n arg0->unk30 = 0.0f;\n arg0->unk34 = 0.0f;\n arg0->unk38 = 0.0f;\n arg0->unk3C = 1.0f;\n arg0->unk28 = (f32) (1.0f - (sp28 + sp1C));\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":52,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 45: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 46: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 48: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 62: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Skin_Matrix_SetQuaternion` — benchmark function af:Skin_Matrix_SetQuaternion:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Skin_Matrix_SetQuaternion\n addiu\t$sp, $sp, -72\n sdc1\t$f20, 8($sp)\n lwc1\t$f0, 0($a1)\n lwc1\t$f2, 4($a1)\n lwc1\t$f12, 8($a1)\n mul.s\t$f4, $f0, $f0\n lwc1\t$f20, 12($a1)\n lui\t$at, 0x4000\n mul.s\t$f6, $f2, $f2\n mul.s\t$f10, $f12, $f12\n add.s\t$f8, $f4, $f6\n mul.s\t$f6, $f20, $f20\n add.s\t$f4, $f8, $f10\n mtc1\t$at, $f10\n lui\t$at, 0x3f80\n add.s\t$f8, $f4, $f6\n div.s\t$f18, $f10, $f8\n mul.s\t$f4, $f0, $f18\n mul.s\t$f16, $f2, $f18\n mul.s\t$f14, $f12, $f18\n swc1\t$f4, 64($sp)\n lwc1\t$f6, 64($sp)\n mul.s\t$f10, $f20, $f6\n mul.s\t$f8, $f20, $f16\n mul.s\t$f4, $f20, $f14\n swc1\t$f10, 52($sp)\n mul.s\t$f10, $f0, $f6\n swc1\t$f8, 48($sp)\n mul.s\t$f8, $f0, $f16\n swc1\t$f4, 44($sp)\n mul.s\t$f18, $f0, $f14\n swc1\t$f10, 40($sp)\n mtc1\t$zero, $f0\n mul.s\t$f4, $f2, $f16\n swc1\t$f8, 36($sp)\n mtc1\t$at, $f16\n mul.s\t$f6, $f2, $f14\n mul.s\t$f10, $f12, $f14\n swc1\t$f4, 28($sp)\n lwc1\t$f8, 28($sp)\n swc1\t$f6, 24($sp)\n swc1\t$f10, 20($sp)\n lwc1\t$f4, 20($sp)\n mtc1\t$at, $f10\n add.s\t$f6, $f8, $f4\n sub.s\t$f8, $f10, $f6\n swc1\t$f8, 0($a0)\n lwc1\t$f10, 44($sp)\n lwc1\t$f4, 36($sp)\n add.s\t$f6, $f4, $f10\n swc1\t$f6, 4($a0)\n lwc1\t$f8, 48($sp)\n sub.s\t$f4, $f18, $f8\n swc1\t$f4, 8($a0)\n lwc1\t$f14, 40($sp)\n lwc1\t$f12, 52($sp)\n lwc1\t$f2, 24($sp)\n swc1\t$f0, 12($a0)\n lwc1\t$f6, 44($sp)\n lwc1\t$f10, 36($sp)\n sub.s\t$f8, $f10, $f6\n swc1\t$f8, 16($a0)\n lwc1\t$f4, 20($sp)\n add.s\t$f8, $f2, $f12\n swc1\t$f0, 28($a0)\n add.s\t$f10, $f14, $f4\n swc1\t$f8, 24($a0)\n sub.s\t$f6, $f16, $f10\n swc1\t$f6, 20($a0)\n lwc1\t$f4, 48($sp)\n sub.s\t$f6, $f2, $f12\n add.s\t$f10, $f2, $f4\n swc1\t$f6, 36($a0)\n swc1\t$f10, 32($a0)\n lwc1\t$f8, 28($sp)\n swc1\t$f0, 44($a0)\n swc1\t$f0, 48($a0)\n add.s\t$f4, $f14, $f8\n swc1\t$f0, 52($a0)\n swc1\t$f0, 56($a0)\n swc1\t$f16, 60($a0)\n sub.s\t$f10, $f16, $f4\n swc1\t$f10, 40($a0)\n ldc1\t$f20, 8($sp)\n jr\t$ra\n addiu\t$sp, $sp, 72\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Skin_Matrix_SetQuaternion # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Skin_Matrix_SetQuaternion` — benchmark function af:Skin_Matrix_SetQuaternion:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:Skin_Matrix_SetQuaternion: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,-72\n 4:\tsdc1\t$f20,8(sp)\n 8:\tlwc1\t$f0,0(a1)\n c:\tlwc1\t$f2,4(a1)\n 10:\tlwc1\t$f12,8(a1)\n 14:\tmul.s\t$f4,$f0,$f0\n 18:\tlwc1\t$f20,12(a1)\n 1c:\tlui\tat,0x4000\n 20:\tmul.s\t$f6,$f2,$f2\n 24:\tmul.s\t$f10,$f12,$f12\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tmul.s\t$f6,$f20,$f20\n 30:\tadd.s\t$f4,$f8,$f10\n 34:\tmtc1\tat,$f10\n 38:\tlui\tat,0x3f80\n 3c:\tadd.s\t$f8,$f4,$f6\n 40:\tdiv.s\t$f18,$f10,$f8\n 44:\tmul.s\t$f4,$f0,$f18\n 48:\tmul.s\t$f16,$f2,$f18\n 4c:\tmul.s\t$f14,$f12,$f18\n 50:\tswc1\t$f4,64(sp)\n 54:\tlwc1\t$f6,64(sp)\n 58:\tmul.s\t$f10,$f20,$f6\n 5c:\tmul.s\t$f8,$f20,$f16\n 60:\tmul.s\t$f4,$f20,$f14\n 64:\tswc1\t$f10,52(sp)\n 68:\tmul.s\t$f10,$f0,$f6\n 6c:\tswc1\t$f8,48(sp)\n 70:\tmul.s\t$f8,$f0,$f16\n 74:\tswc1\t$f4,44(sp)\n 78:\tmul.s\t$f18,$f0,$f14\n 7c:\tswc1\t$f10,40(sp)\n 80:\tmtc1\tzero,$f0\n 84:\tmul.s\t$f4,$f2,$f16\n 88:\tswc1\t$f8,36(sp)\n 8c:\tmtc1\tat,$f16\n 90:\tmul.s\t$f6,$f2,$f14\n 94:\tmul.s\t$f10,$f12,$f14\n 98:\tswc1\t$f4,28(sp)\n 9c:\tlwc1\t$f8,28(sp)\n a0:\tswc1\t$f6,24(sp)\n a4:\tswc1\t$f10,20(sp)\n a8:\tlwc1\t$f4,20(sp)\n ac:\tmtc1\tat,$f10\n b0:\tadd.s\t$f6,$f8,$f4\n b4:\tsub.s\t$f8,$f10,$f6\n b8:\tswc1\t$f8,0(a0)\n bc:\tlwc1\t$f10,44(sp)\n c0:\tlwc1\t$f4,36(sp)\n c4:\tadd.s\t$f6,$f4,$f10\n c8:\tswc1\t$f6,4(a0)\n cc:\tlwc1\t$f8,48(sp)\n d0:\tsub.s\t$f4,$f18,$f8\n d4:\tswc1\t$f4,8(a0)\n d8:\tlwc1\t$f14,40(sp)\n dc:\tlwc1\t$f12,52(sp)\n e0:\tlwc1\t$f2,24(sp)\n e4:\tswc1\t$f0,12(a0)\n e8:\tlwc1\t$f6,44(sp)\n ec:\tlwc1\t$f10,36(sp)\n f0:\tsub.s\t$f8,$f10,$f6\n f4:\tswc1\t$f8,16(a0)\n f8:\tlwc1\t$f4,20(sp)\n fc:\tadd.s\t$f8,$f2,$f12\n 100:\tswc1\t$f0,28(a0)\n 104:\tadd.s\t$f10,$f14,$f4\n 108:\tswc1\t$f8,24(a0)\n 10c:\tsub.s\t$f6,$f16,$f10\n 110:\tswc1\t$f6,20(a0)\n 114:\tlwc1\t$f4,48(sp)\n 118:\tsub.s\t$f6,$f2,$f12\n 11c:\tadd.s\t$f10,$f2,$f4\n 120:\tswc1\t$f6,36(a0)\n 124:\tswc1\t$f10,32(a0)\n 128:\tlwc1\t$f8,28(sp)\n 12c:\tswc1\t$f0,44(a0)\n 130:\tswc1\t$f0,48(a0)\n 134:\tadd.s\t$f4,$f14,$f8\n 138:\tswc1\t$f0,52(a0)\n 13c:\tswc1\t$f0,56(a0)\n 140:\tswc1\t$f16,60(a0)\n 144:\tsub.s\t$f10,$f16,$f4\n 148:\tswc1\t$f10,40(a0)\n 14c:\tldc1\t$f20,8(sp)\n 150:\tjr\tra\n 154:\taddiu\tsp,sp,72\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000160 .text\n00000000 g F .text\t00000158 Skin_Matrix_SetQuaternion\n\n\nContents of section .text:\n 0000 27bdffb8 f7b40008 c4a00000 c4a20004 '...............\n 0010 c4ac0008 46000102 c4b4000c 3c014000 ....F.......<.@.\n 0020 46021182 460c6282 46062200 4614a182 F...F.b.F.\".F...\n 0030 460a4100 44815000 3c013f80 46062200 F.A.D.P.<.?.F.\".\n 0040 46085483 46120102 46121402 46126382 F.T.F...F...F.c.\n 0050 e7a40040 c7a60040 4606a282 4610a202 ...@...@F...F...\n 0060 460ea102 e7aa0034 46060282 e7a80030 F......4F......0\n 0070 46100202 e7a4002c 460e0482 e7aa0028 F......,F......(\n 0080 44800000 46101102 e7a80024 44818000 D...F......$D...\n 0090 460e1182 460e6282 e7a4001c c7a8001c F...F.b.........\n 00a0 e7a60018 e7aa0014 c7a40014 44815000 ............D.P.\n 00b0 46044180 46065201 e4880000 c7aa002c F.A.F.R........,\n 00c0 c7a40024 460a2180 e4860004 c7a80030 ...$F.!........0\n 00d0 46089101 e4840008 c7ae0028 c7ac0034 F..........(...4\n 00e0 c7a20018 e480000c c7a6002c c7aa0024 ...........,...$\n 00f0 46065201 e4880010 c7a40014 460c1200 F.R.........F...\n 0100 e480001c 46047280 e4880018 460a8181 ....F.r.....F...\n 0110 e4860014 c7a40030 460c1181 46041280 .......0F...F...\n 0120 e4860024 e48a0020 c7a8001c e480002c ...$... .......,\n 0130 e4800030 46087100 e4800034 e4800038 ...0F.q....4...8\n 0140 e490003c 46048281 e48a0028 d7b40008 ...\n 01f0 00000000 00000000 00000000 18200001 ............. ..\n 0200 00000000 00000000 00000000 00000000 ................\n 0210 00000000 00000000 7fffffff 00000000 ................\n 0220 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Skin_Matrix_SetQuaternion\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 Skin_Matrix_SetQuaternion # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":5,"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 17: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 18: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 19: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 20: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 21: Selector requires struct/union pointer as left hand side"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel spolar2world\n addiu\t$sp, $sp, -64\n sw\t$ra, 28($sp)\n sw\t$s0, 24($sp)\n sw\t$a0, 64($sp)\n move\t$s0, $a1\n jal\tcos_s\n lh\t$a0, 4($a1)\n swc1\t$f0, 44($sp)\n jal\tcos_s\n lh\t$a0, 6($s0)\n swc1\t$f0, 36($sp)\n jal\tsin_s\n lh\t$a0, 4($s0)\n lh\t$a0, 6($s0)\n jal\tsin_s\n swc1\t$f0, 48($sp)\n lwc1\t$f2, 48($sp)\n lwc1\t$f4, 0($s0)\n lwc1\t$f16, 44($sp)\n addiu\t$t6, $sp, 52\n mul.s\t$f6, $f4, $f2\n lw\t$v0, 64($sp)\n mul.s\t$f8, $f6, $f0\n swc1\t$f8, 52($sp)\n lwc1\t$f10, 0($s0)\n lwc1\t$f8, 36($sp)\n mul.s\t$f18, $f10, $f16\n swc1\t$f18, 56($sp)\n lwc1\t$f4, 0($s0)\n mul.s\t$f6, $f4, $f2\n mul.s\t$f10, $f6, $f8\n swc1\t$f10, 60($sp)\n lw\t$t8, 0($t6)\n sw\t$t8, 0($v0)\n lw\t$t7, 4($t6)\n sw\t$t7, 4($v0)\n lw\t$t8, 8($t6)\n sw\t$t8, 8($v0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n addiu\t$sp, $sp, 64\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function spolar2world # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:suMtxMakeSRT:ido7.1","sym":"suMtxMakeSRT","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","array","matrix","shift","bitwise","call"],"loc":67,"refSource":"void suMtxMakeSRT(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX,\n f32 translateY, f32 translateZ) {\n struct {\n s16 intPart[4][4];\n u16 fracPart[4][4];\n }* mu = (void*)mtx;\n s32 fp;\n f32 sinX = sin_s(rotX);\n f32 sinY = sin_s(rotY);\n f32 sinZ = sin_s(rotZ);\n f32 cosX = cos_s(rotX);\n f32 cosY = cos_s(rotY);\n f32 cosZ = cos_s(rotZ);\n\n fp = cosY * cosZ * scaleX * 0x10000;\n mu->intPart[0][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][0] = fp & 0xFFFF;\n\n fp = cosY * sinZ * scaleX * 0x10000;\n mu->intPart[0][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][1] = fp & 0xFFFF;\n\n fp = -sinY * scaleX * 0x10000;\n mu->intPart[0][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][2] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * cosZ) - (cosX * sinZ)) * scaleY * 0x10000;\n mu->intPart[1][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][0] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * sinZ) + (cosX * cosZ)) * scaleY * 0x10000;\n mu->intPart[1][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][1] = fp & 0xFFFF;\n\n fp = sinX * cosY * scaleY * 0x10000;\n mu->intPart[1][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][2] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * cosZ) + (sinX * sinZ)) * scaleZ * 0x10000;\n mu->intPart[2][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][0] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * sinZ) - (sinX * cosZ)) * scaleZ * 0x10000;\n mu->intPart[2][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][1] = fp & 0xFFFF;\n\n fp = cosX * cosY * scaleZ * 0x10000;\n mu->intPart[2][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][2] = fp & 0xFFFF;\n\n fp = translateX * 0x10000;\n mu->intPart[3][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][0] = fp & 0xFFFF;\n\n fp = translateY * 0x10000;\n mu->intPart[3][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][1] = fp & 0xFFFF;\n\n fp = translateZ * 0x10000;\n mu->intPart[3][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][2] = fp & 0xFFFF;\n\n mu->intPart[0][3] = mu->intPart[1][3] = mu->intPart[2][3] = 0;\n mu->fracPart[0][3] = mu->fracPart[1][3] = mu->fracPart[2][3] = 0;\n mu->intPart[3][3] = 1;\n mu->fracPart[3][3] = 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/sys_matrix.c#L1448-L1514","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-88\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,36(sp)\n 10:\tsdc1\t$f20,24(sp)\n 14:\tsw\ta1,92(sp)\n 18:\tsw\ta2,96(sp)\n 1c:\tsw\ta3,100(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,106(sp)\n 28:\tmtc1\tv0,$f4\n 2c:\tlh\ta0,110(sp)\n 30:\tjal\t0 \n 34:\tcvt.s.w\t$f20,$f4\n 38:\tmtc1\tv0,$f6\n 3c:\tlh\ta0,114(sp)\n 40:\tcvt.s.w\t$f8,$f6\n 44:\tjal\t0 \n 48:\tswc1\t$f8,72(sp)\n 4c:\tmtc1\tv0,$f10\n 50:\tlh\ta0,106(sp)\n 54:\tcvt.s.w\t$f16,$f10\n 58:\tjal\t0 \n 5c:\tswc1\t$f16,68(sp)\n 60:\tmtc1\tv0,$f4\n 64:\tlh\ta0,110(sp)\n 68:\tcvt.s.w\t$f12,$f4\n 6c:\tjal\t0 \n 70:\tswc1\t$f12,64(sp)\n 74:\tmtc1\tv0,$f6\n 78:\tlh\ta0,114(sp)\n 7c:\tcvt.s.w\t$f14,$f6\n 80:\tjal\t0 \n 84:\tswc1\t$f14,60(sp)\n 88:\tmtc1\tv0,$f8\n 8c:\tlwc1\t$f14,60(sp)\n 90:\tlwc1\t$f4,92(sp)\n 94:\tcvt.s.w\t$f18,$f8\n 98:\tlui\tat,0x4780\n 9c:\tmtc1\tat,$f0\n a0:\tlwc1\t$f16,68(sp)\n a4:\tlwc1\t$f12,64(sp)\n a8:\tmul.s\t$f10,$f14,$f18\n ac:\tmul.s\t$f6,$f10,$f4\n b0:\tmul.s\t$f8,$f6,$f0\n b4:\tmul.s\t$f4,$f14,$f16\n b8:\ttrunc.w.s\t$f10,$f8\n bc:\tmfc1\tt9,$f10\n c0:\tnop\n c4:\tsrl\tt8,t9,0x10\n c8:\tsh\tt8,0(s0)\n cc:\tsh\tt9,32(s0)\n d0:\tlwc1\t$f6,92(sp)\n d4:\tmul.s\t$f8,$f4,$f6\n d8:\tmul.s\t$f10,$f8,$f0\n dc:\ttrunc.w.s\t$f4,$f10\n e0:\tmfc1\tt3,$f4\n e4:\tnop\n e8:\tsrl\tt2,t3,0x10\n ec:\tsh\tt2,2(s0)\n f0:\tsh\tt3,34(s0)\n f4:\tlwc1\t$f6,72(sp)\n f8:\tlwc1\t$f10,92(sp)\n fc:\tneg.s\t$f8,$f6\n 100:\tmul.s\t$f4,$f8,$f10\n 104:\tmul.s\t$f6,$f4,$f0\n 108:\ttrunc.w.s\t$f8,$f6\n 10c:\tmfc1\tt7,$f8\n 110:\tnop\n 114:\tsrl\tt6,t7,0x10\n 118:\tsh\tt6,4(s0)\n 11c:\tsh\tt7,36(s0)\n 120:\tlwc1\t$f10,72(sp)\n 124:\tmul.s\t$f4,$f20,$f10\n 128:\tswc1\t$f4,44(sp)\n 12c:\tlwc1\t$f6,44(sp)\n 130:\tmul.s\t$f8,$f6,$f18\n 134:\tlwc1\t$f6,96(sp)\n 138:\tmul.s\t$f10,$f12,$f16\n 13c:\tsub.s\t$f4,$f8,$f10\n 140:\tmul.s\t$f8,$f4,$f6\n 144:\tmul.s\t$f10,$f8,$f0\n 148:\ttrunc.w.s\t$f4,$f10\n 14c:\tmfc1\tt1,$f4\n 150:\tnop\n 154:\tsrl\tt0,t1,0x10\n 158:\tsh\tt0,8(s0)\n 15c:\tsh\tt1,40(s0)\n 160:\tlwc1\t$f6,44(sp)\n 164:\tmul.s\t$f8,$f6,$f16\n 168:\tlwc1\t$f6,96(sp)\n 16c:\tmul.s\t$f10,$f12,$f18\n 170:\tadd.s\t$f4,$f8,$f10\n 174:\tmul.s\t$f8,$f4,$f6\n 178:\tmul.s\t$f10,$f8,$f0\n 17c:\tmul.s\t$f6,$f20,$f14\n 180:\ttrunc.w.s\t$f4,$f10\n 184:\tmfc1\tt5,$f4\n 188:\tnop\n 18c:\tsrl\tt4,t5,0x10\n 190:\tsh\tt4,10(s0)\n 194:\tsh\tt5,42(s0)\n 198:\tlwc1\t$f8,96(sp)\n 19c:\tmul.s\t$f10,$f6,$f8\n 1a0:\tmul.s\t$f4,$f10,$f0\n 1a4:\ttrunc.w.s\t$f6,$f4\n 1a8:\tmfc1\tt9,$f6\n 1ac:\tnop\n 1b0:\tsrl\tt8,t9,0x10\n 1b4:\tsh\tt8,12(s0)\n 1b8:\tsh\tt9,44(s0)\n 1bc:\tlwc1\t$f8,72(sp)\n 1c0:\tmul.s\t$f2,$f12,$f8\n 1c4:\tlwc1\t$f8,100(sp)\n 1c8:\tmul.s\t$f10,$f2,$f18\n 1cc:\tmul.s\t$f4,$f20,$f16\n 1d0:\tadd.s\t$f6,$f10,$f4\n 1d4:\tmul.s\t$f10,$f6,$f8\n 1d8:\tmul.s\t$f4,$f10,$f0\n 1dc:\tmul.s\t$f8,$f2,$f16\n 1e0:\tmul.s\t$f10,$f20,$f18\n 1e4:\ttrunc.w.s\t$f6,$f4\n 1e8:\tsub.s\t$f4,$f8,$f10\n 1ec:\tmfc1\tt3,$f6\n 1f0:\tnop\n 1f4:\tsrl\tt2,t3,0x10\n 1f8:\tsh\tt2,16(s0)\n 1fc:\tsh\tt3,48(s0)\n 200:\tlwc1\t$f6,100(sp)\n 204:\tmul.s\t$f8,$f4,$f6\n 208:\tmul.s\t$f10,$f8,$f0\n 20c:\tmul.s\t$f6,$f12,$f14\n 210:\ttrunc.w.s\t$f4,$f10\n 214:\tmfc1\tt7,$f4\n 218:\tnop\n 21c:\tsrl\tt6,t7,0x10\n 220:\tsh\tt6,18(s0)\n 224:\tsh\tt7,50(s0)\n 228:\tlwc1\t$f8,100(sp)\n 22c:\tmul.s\t$f10,$f6,$f8\n 230:\tmul.s\t$f4,$f10,$f0\n 234:\ttrunc.w.s\t$f6,$f4\n 238:\tmfc1\tt1,$f6\n 23c:\tnop\n 240:\tsrl\tt0,t1,0x10\n 244:\tsh\tt0,20(s0)\n 248:\tsh\tt1,52(s0)\n 24c:\tlwc1\t$f8,116(sp)\n 250:\tmul.s\t$f10,$f8,$f0\n 254:\ttrunc.w.s\t$f4,$f10\n 258:\tmfc1\tt5,$f4\n 25c:\tnop\n 260:\tsrl\tt4,t5,0x10\n 264:\tsh\tt4,24(s0)\n 268:\tsh\tt5,56(s0)\n 26c:\tlwc1\t$f6,120(sp)\n 270:\tli\tt4,1\n 274:\tmul.s\t$f8,$f6,$f0\n 278:\ttrunc.w.s\t$f10,$f8\n 27c:\tmfc1\tt9,$f10\n 280:\tnop\n 284:\tsrl\tt8,t9,0x10\n 288:\tsh\tt8,26(s0)\n 28c:\tsh\tt9,58(s0)\n 290:\tlwc1\t$f4,124(sp)\n 294:\tsh\tzero,22(s0)\n 298:\tlh\tv0,22(s0)\n 29c:\tmul.s\t$f6,$f4,$f0\n 2a0:\tsh\tzero,38(s0)\n 2a4:\tsh\tzero,46(s0)\n 2a8:\tsh\tzero,54(s0)\n 2ac:\tsh\tt4,30(s0)\n 2b0:\tsh\tzero,62(s0)\n 2b4:\tsh\tv0,14(s0)\n 2b8:\ttrunc.w.s\t$f8,$f6\n 2bc:\tsh\tv0,6(s0)\n 2c0:\tmfc1\tt3,$f8\n 2c4:\tnop\n 2c8:\tsrl\tt2,t3,0x10\n 2cc:\tsh\tt2,28(s0)\n 2d0:\tsh\tt3,60(s0)\n 2d4:\tlw\tra,36(sp)\n 2d8:\tlw\ts0,32(sp)\n 2dc:\tldc1\t$f20,24(sp)\n 2e0:\tjr\tra\n 2e4:\taddiu\tsp,sp,88\n\t...\n","proto":{"suMtxMakeSRT":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000002f0 .text\n00000000 g F .text\t000002e8 suMtxMakeSRT\n00000000 F *UND*\t00000000 sin_s\n00000000 F *UND*\t00000000 cos_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 sin_s\n00000030 R_MIPS_26 sin_s\n00000044 R_MIPS_26 sin_s\n00000058 R_MIPS_26 cos_s\n0000006c R_MIPS_26 cos_s\n00000080 R_MIPS_26 cos_s\n\n\nContents of section .text:\n 0000 27bdffa8 afb00020 00808025 afbf0024 '...... ...%...$\n 0010 f7b40018 afa5005c afa60060 afa70064 .......\\...`...d\n 0020 0c000000 87a4006a 44822000 87a4006e .......jD. ....n\n 0030 0c000000 46802520 44823000 87a40072 ....F.% D.0....r\n 0040 46803220 0c000000 e7a80048 44825000 F.2 .......HD.P.\n 0050 87a4006a 46805420 0c000000 e7b00044 ...jF.T .......D\n 0060 44822000 87a4006e 46802320 0c000000 D. ....nF.# ....\n 0070 e7ac0040 44823000 87a40072 468033a0 ...@D.0....rF.3.\n 0080 0c000000 e7ae003c 44824000 c7ae003c ...........F.2.....\n 02c0 440b4000 00000000 000b5402 a60a001c D.@.......T.....\n 02d0 a60b003c 8fbf0024 8fb00020 d7b40018 ...<...$... ....\n 02e0 03e00008 27bd0058 00000000 00000000 ....'..X........\nContents of section .options:\n 0000 01200000 00000000 a301fff6 00000000 . ..............\n 0010 003ffffd 00000000 00000000 00007ff0 .?..............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a301fff6 00000000 003ffffd 00000000 .........?......\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000ba 00000048 000004c8 p..........H....\n 0010 00000007 00000684 00000001 00000510 ................\n 0020 00000004 00000544 00000000 00000000 .......D........\n 0030 00000011 00000574 00000038 000005b8 .......t...8....\n 0040 0000001c 000005f0 00000001 0000060c ................\n 0050 00000000 00000000 00000003 00000654 ...............T\n 0060 076211f0 1010f010 f01010f0 1210f012 .b..............\n 0070 10f01320 e42230d4 10271028 00102805 ... .\"0..'.(..(.\n 0080 102630d4 10271027 31d030d3 102230d4 .&0..'.'1.0..\"0.\n 0090 10271026 10207095 102021e0 321010d0 .'.&. p.. !.2...\n 00a0 e020e310 54000000 00000000 00000001 . ..T...........\n 00b0 00000000 80010000 ffffffcc ffffffff ................\n 00c0 00300000 ffffffc0 00000058 001d001f .0.........X....\n 00d0 0000001c 00000050 00000000 00000001 .......P........\n 00e0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00f0 1820000f 0000002a 000002e8 20200001 . .....*.... ..\n 0100 00000001 00000000 20200000 02000000 ........ ......\n 0110 03000000 04000000 05000000 06000000 ................\n 0120 07000000 08000000 09000000 20000000 ............ ...\n 0130 21000000 0a000000 0b000000 0b000000 !...............\n 0140 1a000000 00000000 00000003 06000000 ................\n 0150 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0160 2d69646f 2d323332 39393131 62336262 -ido-2329911b3bb\n 0170 35316331 342f752e 69007375 4d74784d 51c14/u.i.suMtxM\n 0180 616b6553 52540000 73754d74 784d616b akeSRT..suMtxMak\n 0190 65535254 0073696e 5f730063 6f735f73 eSRT.sin_s.cos_s\n 01a0 00000000 00000000 00000001 00000000 ................\n 01b0 00000037 00000000 00000004 00000000 ...7............\n 01c0 000000ba 00000000 00000000 00000001 ................\n 01d0 00000000 00000011 00000000 00000000 ................\n 01e0 01800000 00000000 00000045 00000000 ...........E....\n 01f0 00000000 00000000 18200001 00000000 ......... ......\n 0200 0000000d 00000000 18cfffff 00000000 ................\n 0210 00000013 00000000 18cfffff 00000000 ................\n 0220 00000000 00000000 00000000 00000000 ................\n 0230 00000000 7fffffff 00000000 7fffffff ................\n 0240 00000001 7fffffff 00000002 00000000 ................\n 0250 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'suMtxMakeSRT' — lift: cannot lift 'suMtxMakeSRT': 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,-88 */\n/* 4:\tsw\ts0,32(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,36(sp) */\n/* 10:\tsdc1\t$f20,24(sp) */\n/* 14:\tsw\ta1,92(sp) */\n/* 18:\tsw\ta2,96(sp) */\n/* 1c:\tsw\ta3,100(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tlh\ta0,106(sp) */\n/* 28:\tmtc1\tv0,$f4 */\n/* 2c:\tlh\ta0,110(sp) */\n/* 30:\tjal\t0 */\n/* 34:\tcvt.s.w\t$f20,$f4 */\n/* 38:\tmtc1\tv0,$f6 */\n/* 3c:\tlh\ta0,114(sp) */\n/* 40:\tcvt.s.w\t$f8,$f6 */\n/* 44:\tjal\t0 */\n/* 48:\tswc1\t$f8,72(sp) */\n/* 4c:\tmtc1\tv0,$f10 */\n/* 50:\tlh\ta0,106(sp) */\n/* 54:\tcvt.s.w\t$f16,$f10 */\n/* 58:\tjal\t0 */\n/* 5c:\tswc1\t$f16,68(sp) */\n/* 60:\tmtc1\tv0,$f4 */\n/* 64:\tlh\ta0,110(sp) */\n/* 68:\tcvt.s.w\t$f12,$f4 */\n/* 6c:\tjal\t0 */\n/* 70:\tswc1\t$f12,64(sp) */\n/* 74:\tmtc1\tv0,$f6 */\n/* 78:\tlh\ta0,114(sp) */\n/* 7c:\tcvt.s.w\t$f14,$f6 */\n/* 80:\tjal\t0 */\n/* 84:\tswc1\t$f14,60(sp) */\n/* 88:\tmtc1\tv0,$f8 */\n/* 8c:\tlwc1\t$f14,60(sp) */\n/* 90:\tlwc1\t$f4,92(sp) */\n/* 94:\tcvt.s.w\t$f18,$f8 */\n/* 98:\tlui\tat,0x4780 */\n/* 9c:\tmtc1\tat,$f0 */\n/* a0:\tlwc1\t$f16,68(sp) */\n/* a4:\tlwc1\t$f12,64(sp) */\n/* a8:\tmul.s\t$f10,$f14,$f18 */\n/* ac:\tmul.s\t$f6,$f10,$f4 */\n/* b0:\tmul.s\t$f8,$f6,$f0 */\n/* b4:\tmul.s\t$f4,$f14,$f16 */\n/* b8:\ttrunc.w.s\t$f10,$f8 */\n/* bc:\tmfc1\tt9,$f10 */\n/* c0:\tnop */\n/* c4:\tsrl\tt8,t9,0x10 */\n/* c8:\tsh\tt8,0(s0) */\n/* cc:\tsh\tt9,32(s0) */\n/* d0:\tlwc1\t$f6,92(sp) */\n/* d4:\tmul.s\t$f8,$f4,$f6 */\n/* d8:\tmul.s\t$f10,$f8,$f0 */\n/* dc:\ttrunc.w.s\t$f4,$f10 */\n/* e0:\tmfc1\tt3,$f4 */\n/* e4:\tnop */\n/* e8:\tsrl\tt2,t3,0x10 */\n/* ec:\tsh\tt2,2(s0) */\n/* f0:\tsh\tt3,34(s0) */\n/* f4:\tlwc1\t$f6,72(sp) */\n/* f8:\tlwc1\t$f10,92(sp) */\n/* fc:\tneg.s\t$f8,$f6 */\n/* 100:\tmul.s\t$f4,$f8,$f10 */\n/* 104:\tmul.s\t$f6,$f4,$f0 */\n/* 108:\ttrunc.w.s\t$f8,$f6 */\n/* 10c:\tmfc1\tt7,$f8 */\n/* 110:\tnop */\n/* 114:\tsrl\tt6,t7,0x10 */\n/* 118:\tsh\tt6,4(s0) */\n/* 11c:\tsh\tt7,36(s0) */\n/* 120:\tlwc1\t$f10,72(sp) */\n/* 124:\tmul.s\t$f4,$f20,$f10 */\n/* 128:\tswc1\t$f4,44(sp) */\n/* 12c:\tlwc1\t$f6,44(sp) */\n/* 130:\tmul.s\t$f8,$f6,$f18 */\n/* 134:\tlwc1\t$f6,96(sp) */\n/* 138:\tmul.s\t$f10,$f12,$f16 */\n/* 13c:\tsub.s\t$f4,$f8,$f10 */\n/* 140:\tmul.s\t$f8,$f4,$f6 */\n/* 144:\tmul.s\t$f10,$f8,$f0 */\n/* 148:\ttrunc.w.s\t$f4,$f10 */\n/* 14c:\tmfc1\tt1,$f4 */\n/* 150:\tnop */\n/* 154:\tsrl\tt0,t1,0x10 */\n/* 158:\tsh\tt0,8(s0) */\n/* 15c:\tsh\tt1,40(s0) */\n/* 160:\tlwc1\t$f6,44(sp) */\n/* 164:\tmul.s\t$f8,$f6,$f16 */\n/* 168:\tlwc1\t$f6,96(sp) */\n/* 16c:\tmul.s\t$f10,$f12,$f18 */\n/* 170:\tadd.s\t$f4,$f8,$f10 */\n/* 174:\tmul.s\t$f8,$f4,$f6 */\n/* 178:\tmul.s\t$f10,$f8,$f0 */\n/* 17c:\tmul.s\t$f6,$f20,$f14 */\n/* 180:\ttrunc.w.s\t$f4,$f10 */\n/* 184:\tmfc1\tt5,$f4 */\n/* 188:\tnop */\n/* 18c:\tsrl\tt4,t5,0x10 */\n/* 190:\tsh\tt4,10(s0) */\n/* 194:\tsh\tt5,42(s0) */\n/* 198:\tlwc1\t$f8,96(sp) */\n/* 19c:\tmul.s\t$f10,$f6,$f8 */\n/* 1a0:\tmul.s\t$f4,$f10,$f0 */\n/* 1a4:\ttrunc.w.s\t$f6,$f4 */\n/* 1a8:\tmfc1\tt9,$f6 */\n/* 1ac:\tnop */\n/* 1b0:\tsrl\tt8,t9,0x10 */\n/* 1b4:\tsh\tt8,12(s0) */\n/* 1b8:\tsh\tt9,44(s0) */\n/* 1bc:\tlwc1\t$f8,72(sp) */\n/* 1c0:\tmul.s\t$f2,$f12,$f8 */\n/* 1c4:\tlwc1\t$f8,100(sp) */\n/* 1c8:\tmul.s\t$f10,$f2,$f18 */\n/* 1cc:\tmul.s\t$f4,$f20,$f16 */\n/* 1d0:\tadd.s\t$f6,$f10,$f4 */\n/* 1d4:\tmul.s\t$f10,$f6,$f8 */\n/* 1d8:\tmul.s\t$f4,$f10,$f0 */\n/* 1dc:\tmul.s\t$f8,$f2,$f16 */\n/* 1e0:\tmul.s\t$f10,$f20,$f18 */\n/* 1e4:\ttrunc.w.s\t$f6,$f4 */\n/* 1e8:\tsub.s\t$f4,$f8,$f10 */\n/* 1ec:\tmfc1\tt3,$f6 */\n/* 1f0:\tnop */\n/* 1f4:\tsrl\tt2,t3,0x10 */\n/* 1f8:\tsh\tt2,16(s0) */\n/* 1fc:\tsh\tt3,48(s0) */\n/* 200:\tlwc1\t$f6,100(sp) */\n/* 204:\tmul.s\t$f8,$f4,$f6 */\n/* 208:\tmul.s\t$f10,$f8,$f0 */\n/* 20c:\tmul.s\t$f6,$f12,$f14 */\n/* 210:\ttrunc.w.s\t$f4,$f10 */\n/* 214:\tmfc1\tt7,$f4 */\n/* 218:\tnop */\n/* 21c:\tsrl\tt6,t7,0x10 */\n/* 220:\tsh\tt6,18(s0) */\n/* 224:\tsh\tt7,50(s0) */\n/* 228:\tlwc1\t$f8,100(sp) */\n/* 22c:\tmul.s\t$f10,$f6,$f8 */\n/* 230:\tmul.s\t$f4,$f10,$f0 */\n/* 234:\ttrunc.w.s\t$f6,$f4 */\n/* 238:\tmfc1\tt1,$f6 */\n/* 23c:\tnop */\n/* 240:\tsrl\tt0,t1,0x10 */\n/* 244:\tsh\tt0,20(s0) */\n/* 248:\tsh\tt1,52(s0) */\n/* 24c:\tlwc1\t$f8,116(sp) */\n/* 250:\tmul.s\t$f10,$f8,$f0 */\n/* 254:\ttrunc.w.s\t$f4,$f10 */\n/* 258:\tmfc1\tt5,$f4 */\n/* 25c:\tnop */\n/* 260:\tsrl\tt4,t5,0x10 */\n/* 264:\tsh\tt4,24(s0) */\n/* 268:\tsh\tt5,56(s0) */\n/* 26c:\tlwc1\t$f6,120(sp) */\n/* 270:\tli\tt4,1 */\n/* 274:\tmul.s\t$f8,$f6,$f0 */\n/* 278:\ttrunc.w.s\t$f10,$f8 */\n/* 27c:\tmfc1\tt9,$f10 */\n/* 280:\tnop */\n/* 284:\tsrl\tt8,t9,0x10 */\n/* 288:\tsh\tt8,26(s0) */\n/* 28c:\tsh\tt9,58(s0) */\n/* 290:\tlwc1\t$f4,124(sp) */\n/* 294:\tsh\tzero,22(s0) */\n/* 298:\tlh\tv0,22(s0) */\n/* 29c:\tmul.s\t$f6,$f4,$f0 */\n/* 2a0:\tsh\tzero,38(s0) */\n/* 2a4:\tsh\tzero,46(s0) */\n/* 2a8:\tsh\tzero,54(s0) */\n/* 2ac:\tsh\tt4,30(s0) */\n/* 2b0:\tsh\tzero,62(s0) */\n/* 2b4:\tsh\tv0,14(s0) */\n/* 2b8:\ttrunc.w.s\t$f8,$f6 */\n/* 2bc:\tsh\tv0,6(s0) */\n/* 2c0:\tmfc1\tt3,$f8 */\n/* 2c4:\tnop */\n/* 2c8:\tsrl\tt2,t3,0x10 */\n/* 2cc:\tsh\tt2,28(s0) */\n/* 2d0:\tsh\tt3,60(s0) */\n/* 2d4:\tlw\tra,36(sp) */\n/* 2d8:\tlw\ts0,32(sp) */\n/* 2dc:\tldc1\t$f20,24(sp) */\n/* 2e0:\tjr\tra */\n/* 2e4:\taddiu\tsp,sp,88 */\n/* \t... */\nvoid suMtxMakeSRT(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'suMtxMakeSRT': function call 'jal' at 0x20 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":195,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'suMtxMakeSRT': function call 'jal' at 0x20 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 cos_s(s16, s16); /* extern */\ns32 sin_s(s16); /* extern */\n\nvoid suMtxMakeSRT(void *arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6, f32 arg7, f32 arg8, f32 arg9) {\n f32 sp48;\n f32 sp44;\n f32 sp40;\n f32 sp3C;\n f32 sp2C;\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f16;\n f32 temp_f18;\n f32 temp_f20;\n f32 temp_f2;\n f32 temp_f8;\n s16 temp_v0;\n s32 temp_f10;\n s32 temp_f10_2;\n s32 temp_f4;\n s32 temp_f4_2;\n s32 temp_f4_3;\n s32 temp_f4_4;\n s32 temp_f4_5;\n s32 temp_f6;\n s32 temp_f6_2;\n s32 temp_f6_3;\n s32 temp_f8_2;\n s32 temp_f8_3;\n\n temp_f20 = (f32) sin_s(arg4);\n temp_f8 = (f32) sin_s(arg5);\n sp48 = temp_f8;\n temp_f16 = (f32) sin_s(arg6);\n sp44 = temp_f16;\n temp_f12 = (f32) cos_s(arg4);\n sp40 = temp_f12;\n temp_f14 = (f32) cos_s((bitwise s16) temp_f12, arg5);\n sp3C = temp_f14;\n temp_f18 = (f32) cos_s(arg6);\n temp_f10 = (s32) (temp_f14 * temp_f18 * arg1 * 65536.0f);\n arg0->unk0 = (s16) ((u32) temp_f10 >> 0x10);\n arg0->unk20 = (s16) temp_f10;\n temp_f4 = (s32) (temp_f14 * temp_f16 * arg1 * 65536.0f);\n arg0->unk2 = (s16) ((u32) temp_f4 >> 0x10);\n arg0->unk22 = (s16) temp_f4;\n temp_f8_2 = (s32) (-sp48 * arg1 * 65536.0f);\n arg0->unk4 = (s16) ((u32) temp_f8_2 >> 0x10);\n arg0->unk24 = (s16) temp_f8_2;\n sp2C = temp_f20 * sp48;\n temp_f4_2 = (s32) (((sp2C * temp_f18) - (temp_f12 * temp_f16)) * arg2 * 65536.0f);\n arg0->unk8 = (s16) ((u32) temp_f4_2 >> 0x10);\n arg0->unk28 = (s16) temp_f4_2;\n temp_f4_3 = (s32) (((sp2C * temp_f16) + (temp_f12 * temp_f18)) * arg2 * 65536.0f);\n arg0->unkA = (s16) ((u32) temp_f4_3 >> 0x10);\n arg0->unk2A = (s16) temp_f4_3;\n temp_f6 = (s32) (temp_f20 * temp_f14 * arg2 * 65536.0f);\n arg0->unkC = (s16) ((u32) temp_f6 >> 0x10);\n arg0->unk2C = (s16) temp_f6;\n temp_f2 = temp_f12 * temp_f8;\n temp_f6_2 = (s32) (((temp_f2 * temp_f18) + (temp_f20 * temp_f16)) * arg3 * 65536.0f);\n arg0->unk10 = (s16) ((u32) temp_f6_2 >> 0x10);\n arg0->unk30 = (s16) temp_f6_2;\n temp_f4_4 = (s32) (((temp_f2 * temp_f16) - (temp_f20 * temp_f18)) * arg3 * 65536.0f);\n arg0->unk12 = (s16) ((u32) temp_f4_4 >> 0x10);\n arg0->unk32 = (s16) temp_f4_4;\n temp_f6_3 = (s32) (temp_f12 * temp_f14 * arg3 * 65536.0f);\n arg0->unk14 = (s16) ((u32) temp_f6_3 >> 0x10);\n arg0->unk34 = (s16) temp_f6_3;\n temp_f4_5 = (s32) (arg7 * 65536.0f);\n arg0->unk18 = (s16) ((u32) temp_f4_5 >> 0x10);\n arg0->unk38 = (s16) temp_f4_5;\n temp_f10_2 = (s32) (arg8 * 65536.0f);\n arg0->unk1A = (s16) ((u32) temp_f10_2 >> 0x10);\n arg0->unk3A = (s16) temp_f10_2;\n arg0->unk16 = 0;\n temp_v0 = arg0->unk16;\n arg0->unk26 = 0;\n arg0->unk2E = 0;\n arg0->unk36 = 0;\n arg0->unk1E = 1;\n arg0->unk3E = 0;\n arg0->unkE = temp_v0;\n temp_f8_3 = (s32) (arg9 * 65536.0f);\n arg0->unk6 = temp_v0;\n arg0->unk1C = (s16) ((u32) temp_f8_3 >> 0x10);\n arg0->unk3C = (s16) temp_f8_3;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":49,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `suMtxMakeSRT` — benchmark function af:suMtxMakeSRT:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel suMtxMakeSRT\n addiu\t$sp, $sp, -88\n sw\t$s0, 32($sp)\n move\t$s0, $a0\n sw\t$ra, 36($sp)\n sdc1\t$f20, 24($sp)\n sw\t$a1, 92($sp)\n sw\t$a2, 96($sp)\n sw\t$a3, 100($sp)\n jal\tsin_s\n lh\t$a0, 106($sp)\n mtc1\t$v0, $f4\n lh\t$a0, 110($sp)\n jal\tsin_s\n cvt.s.w\t$f20, $f4\n mtc1\t$v0, $f6\n lh\t$a0, 114($sp)\n cvt.s.w\t$f8, $f6\n jal\tsin_s\n swc1\t$f8, 72($sp)\n mtc1\t$v0, $f10\n lh\t$a0, 106($sp)\n cvt.s.w\t$f16, $f10\n jal\tcos_s\n swc1\t$f16, 68($sp)\n mtc1\t$v0, $f4\n lh\t$a0, 110($sp)\n cvt.s.w\t$f12, $f4\n jal\tcos_s\n swc1\t$f12, 64($sp)\n mtc1\t$v0, $f6\n lh\t$a0, 114($sp)\n cvt.s.w\t$f14, $f6\n jal\tcos_s\n swc1\t$f14, 60($sp)\n mtc1\t$v0, $f8\n lwc1\t$f14, 60($sp)\n lwc1\t$f4, 92($sp)\n cvt.s.w\t$f18, $f8\n lui\t$at, 0x4780\n mtc1\t$at, $f0\n lwc1\t$f16, 68($sp)\n lwc1\t$f12, 64($sp)\n mul.s\t$f10, $f14, $f18\n mul.s\t$f6, $f10, $f4\n mul.s\t$f8, $f6, $f0\n mul.s\t$f4, $f14, $f16\n trunc.w.s\t$f10, $f8\n mfc1\t$t9, $f10\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 0($s0)\n sh\t$t9, 32($s0)\n lwc1\t$f6, 92($sp)\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t3, $f4\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 2($s0)\n sh\t$t3, 34($s0)\n lwc1\t$f6, 72($sp)\n lwc1\t$f10, 92($sp)\n neg.s\t$f8, $f6\n mul.s\t$f4, $f8, $f10\n mul.s\t$f6, $f4, $f0\n trunc.w.s\t$f8, $f6\n mfc1\t$t7, $f8\n nop\n srl\t$t6, $t7, 0x10\n sh\t$t6, 4($s0)\n sh\t$t7, 36($s0)\n lwc1\t$f10, 72($sp)\n mul.s\t$f4, $f20, $f10\n swc1\t$f4, 44($sp)\n lwc1\t$f6, 44($sp)\n mul.s\t$f8, $f6, $f18\n lwc1\t$f6, 96($sp)\n mul.s\t$f10, $f12, $f16\n sub.s\t$f4, $f8, $f10\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t1, $f4\n nop\n srl\t$t0, $t1, 0x10\n sh\t$t0, 8($s0)\n sh\t$t1, 40($s0)\n lwc1\t$f6, 44($sp)\n mul.s\t$f8, $f6, $f16\n lwc1\t$f6, 96($sp)\n mul.s\t$f10, $f12, $f18\n add.s\t$f4, $f8, $f10\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n mul.s\t$f6, $f20, $f14\n trunc.w.s\t$f4, $f10\n mfc1\t$t5, $f4\n nop\n srl\t$t4, $t5, 0x10\n sh\t$t4, 10($s0)\n sh\t$t5, 42($s0)\n lwc1\t$f8, 96($sp)\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n trunc.w.s\t$f6, $f4\n mfc1\t$t9, $f6\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 12($s0)\n sh\t$t9, 44($s0)\n lwc1\t$f8, 72($sp)\n mul.s\t$f2, $f12, $f8\n lwc1\t$f8, 100($sp)\n mul.s\t$f10, $f2, $f18\n mul.s\t$f4, $f20, $f16\n add.s\t$f6, $f10, $f4\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n mul.s\t$f8, $f2, $f16\n mul.s\t$f10, $f20, $f18\n trunc.w.s\t$f6, $f4\n sub.s\t$f4, $f8, $f10\n mfc1\t$t3, $f6\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 16($s0)\n sh\t$t3, 48($s0)\n lwc1\t$f6, 100($sp)\n mul.s\t$f8, $f4, $f6\n mul.s\t$f10, $f8, $f0\n mul.s\t$f6, $f12, $f14\n trunc.w.s\t$f4, $f10\n mfc1\t$t7, $f4\n nop\n srl\t$t6, $t7, 0x10\n sh\t$t6, 18($s0)\n sh\t$t7, 50($s0)\n lwc1\t$f8, 100($sp)\n mul.s\t$f10, $f6, $f8\n mul.s\t$f4, $f10, $f0\n trunc.w.s\t$f6, $f4\n mfc1\t$t1, $f6\n nop\n srl\t$t0, $t1, 0x10\n sh\t$t0, 20($s0)\n sh\t$t1, 52($s0)\n lwc1\t$f8, 116($sp)\n mul.s\t$f10, $f8, $f0\n trunc.w.s\t$f4, $f10\n mfc1\t$t5, $f4\n nop\n srl\t$t4, $t5, 0x10\n sh\t$t4, 24($s0)\n sh\t$t5, 56($s0)\n lwc1\t$f6, 120($sp)\n li\t$t4, 1\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t9, $f10\n nop\n srl\t$t8, $t9, 0x10\n sh\t$t8, 26($s0)\n sh\t$t9, 58($s0)\n lwc1\t$f4, 124($sp)\n sh\t$zero, 22($s0)\n lh\t$v0, 22($s0)\n mul.s\t$f6, $f4, $f0\n sh\t$zero, 38($s0)\n sh\t$zero, 46($s0)\n sh\t$zero, 54($s0)\n sh\t$t4, 30($s0)\n sh\t$zero, 62($s0)\n sh\t$v0, 14($s0)\n trunc.w.s\t$f8, $f6\n sh\t$v0, 6($s0)\n mfc1\t$t3, $f8\n nop\n srl\t$t2, $t3, 0x10\n sh\t$t2, 28($s0)\n sh\t$t3, 60($s0)\n lw\t$ra, 36($sp)\n lw\t$s0, 32($sp)\n ldc1\t$f20, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 88\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function suMtxMakeSRT # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `suMtxMakeSRT` — benchmark function af:suMtxMakeSRT:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:suMtxMakeSRT: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,-88\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,36(sp)\n 10:\tsdc1\t$f20,24(sp)\n 14:\tsw\ta1,92(sp)\n 18:\tsw\ta2,96(sp)\n 1c:\tsw\ta3,100(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,106(sp)\n 28:\tmtc1\tv0,$f4\n 2c:\tlh\ta0,110(sp)\n 30:\tjal\t0 \n 34:\tcvt.s.w\t$f20,$f4\n 38:\tmtc1\tv0,$f6\n 3c:\tlh\ta0,114(sp)\n 40:\tcvt.s.w\t$f8,$f6\n 44:\tjal\t0 \n 48:\tswc1\t$f8,72(sp)\n 4c:\tmtc1\tv0,$f10\n 50:\tlh\ta0,106(sp)\n 54:\tcvt.s.w\t$f16,$f10\n 58:\tjal\t0 \n 5c:\tswc1\t$f16,68(sp)\n 60:\tmtc1\tv0,$f4\n 64:\tlh\ta0,110(sp)\n 68:\tcvt.s.w\t$f12,$f4\n 6c:\tjal\t0 \n 70:\tswc1\t$f12,64(sp)\n 74:\tmtc1\tv0,$f6\n 78:\tlh\ta0,114(sp)\n 7c:\tcvt.s.w\t$f14,$f6\n 80:\tjal\t0 \n 84:\tswc1\t$f14,60(sp)\n 88:\tmtc1\tv0,$f8\n 8c:\tlwc1\t$f14,60(sp)\n 90:\tlwc1\t$f4,92(sp)\n 94:\tcvt.s.w\t$f18,$f8\n 98:\tlui\tat,0x4780\n 9c:\tmtc1\tat,$f0\n a0:\tlwc1\t$f16,68(sp)\n a4:\tlwc1\t$f12,64(sp)\n a8:\tmul.s\t$f10,$f14,$f18\n ac:\tmul.s\t$f6,$f10,$f4\n b0:\tmul.s\t$f8,$f6,$f0\n b4:\tmul.s\t$f4,$f14,$f16\n b8:\ttrunc.w.s\t$f10,$f8\n bc:\tmfc1\tt9,$f10\n c0:\tnop\n c4:\tsrl\tt8,t9,0x10\n c8:\tsh\tt8,0(s0)\n cc:\tsh\tt9,32(s0)\n d0:\tlwc1\t$f6,92(sp)\n d4:\tmul.s\t$f8,$f4,$f6\n d8:\tmul.s\t$f10,$f8,$f0\n dc:\ttrunc.w.s\t$f4,$f10\n e0:\tmfc1\tt3,$f4\n e4:\tnop\n e8:\tsrl\tt2,t3,0x10\n ec:\tsh\tt2,2(s0)\n f0:\tsh\tt3,34(s0)\n f4:\tlwc1\t$f6,72(sp)\n f8:\tlwc1\t$f10,92(sp)\n fc:\tneg.s\t$f8,$f6\n 100:\tmul.s\t$f4,$f8,$f10\n 104:\tmul.s\t$f6,$f4,$f0\n 108:\ttrunc.w.s\t$f8,$f6\n 10c:\tmfc1\tt7,$f8\n 110:\tnop\n 114:\tsrl\tt6,t7,0x10\n 118:\tsh\tt6,4(s0)\n 11c:\tsh\tt7,36(s0)\n 120:\tlwc1\t$f10,72(sp)\n 124:\tmul.s\t$f4,$f20,$f10\n 128:\tswc1\t$f4,44(sp)\n 12c:\tlwc1\t$f6,44(sp)\n 130:\tmul.s\t$f8,$f6,$f18\n 134:\tlwc1\t$f6,96(sp)\n 138:\tmul.s\t$f10,$f12,$f16\n 13c:\tsub.s\t$f4,$f8,$f10\n 140:\tmul.s\t$f8,$f4,$f6\n 144:\tmul.s\t$f10,$f8,$f0\n 148:\ttrunc.w.s\t$f4,$f10\n 14c:\tmfc1\tt1,$f4\n 150:\tnop\n 154:\tsrl\tt0,t1,0x10\n 158:\tsh\tt0,8(s0)\n 15c:\tsh\tt1,40(s0)\n 160:\tlwc1\t$f6,44(sp)\n 164:\tmul.s\t$f8,$f6,$f16\n 168:\tlwc1\t$f6,96(sp)\n 16c:\tmul.s\t$f10,$f12,$f18\n 170:\tadd.s\t$f4,$f8,$f10\n 174:\tmul.s\t$f8,$f4,$f6\n 178:\tmul.s\t$f10,$f8,$f0\n 17c:\tmul.s\t$f6,$f20,$f14\n 180:\ttrunc.w.s\t$f4,$f10\n 184:\tmfc1\tt5,$f4\n 188:\tnop\n 18c:\tsrl\tt4,t5,0x10\n 190:\tsh\tt4,10(s0)\n 194:\tsh\tt5,42(s0)\n 198:\tlwc1\t$f8,96(sp)\n 19c:\tmul.s\t$f10,$f6,$f8\n 1a0:\tmul.s\t$f4,$f10,$f0\n 1a4:\ttrunc.w.s\t$f6,$f4\n 1a8:\tmfc1\tt9,$f6\n 1ac:\tnop\n 1b0:\tsrl\tt8,t9,0x10\n 1b4:\tsh\tt8,12(s0)\n 1b8:\tsh\tt9,44(s0)\n 1bc:\tlwc1\t$f8,72(sp)\n 1c0:\tmul.s\t$f2,$f12,$f8\n 1c4:\tlwc1\t$f8,100(sp)\n 1c8:\tmul.s\t$f10,$f2,$f18\n 1cc:\tmul.s\t$f4,$f20,$f16\n 1d0:\tadd.s\t$f6,$f10,$f4\n 1d4:\tmul.s\t$f10,$f6,$f8\n 1d8:\tmul.s\t$f4,$f10,$f0\n 1dc:\tmul.s\t$f8,$f2,$f16\n 1e0:\tmul.s\t$f10,$f20,$f18\n 1e4:\ttrunc.w.s\t$f6,$f4\n 1e8:\tsub.s\t$f4,$f8,$f10\n 1ec:\tmfc1\tt3,$f6\n 1f0:\tnop\n 1f4:\tsrl\tt2,t3,0x10\n 1f8:\tsh\tt2,16(s0)\n 1fc:\tsh\tt3,48(s0)\n 200:\tlwc1\t$f6,100(sp)\n 204:\tmul.s\t$f8,$f4,$f6\n 208:\tmul.s\t$f10,$f8,$f0\n 20c:\tmul.s\t$f6,$f12,$f14\n 210:\ttrunc.w.s\t$f4,$f10\n 214:\tmfc1\tt7,$f4\n 218:\tnop\n 21c:\tsrl\tt6,t7,0x10\n 220:\tsh\tt6,18(s0)\n 224:\tsh\tt7,50(s0)\n 228:\tlwc1\t$f8,100(sp)\n 22c:\tmul.s\t$f10,$f6,$f8\n 230:\tmul.s\t$f4,$f10,$f0\n 234:\ttrunc.w.s\t$f6,$f4\n 238:\tmfc1\tt1,$f6\n 23c:\tnop\n 240:\tsrl\tt0,t1,0x10\n 244:\tsh\tt0,20(s0)\n 248:\tsh\tt1,52(s0)\n 24c:\tlwc1\t$f8,116(sp)\n 250:\tmul.s\t$f10,$f8,$f0\n 254:\ttrunc.w.s\t$f4,$f10\n 258:\tmfc1\tt5,$f4\n 25c:\tnop\n 260:\tsrl\tt4,t5,0x10\n 264:\tsh\tt4,24(s0)\n 268:\tsh\tt5,56(s0)\n 26c:\tlwc1\t$f6,120(sp)\n 270:\tli\tt4,1\n 274:\tmul.s\t$f8,$f6,$f0\n 278:\ttrunc.w.s\t$f10,$f8\n 27c:\tmfc1\tt9,$f10\n 280:\tnop\n 284:\tsrl\tt8,t9,0x10\n 288:\tsh\tt8,26(s0)\n 28c:\tsh\tt9,58(s0)\n 290:\tlwc1\t$f4,124(sp)\n 294:\tsh\tzero,22(s0)\n 298:\tlh\tv0,22(s0)\n 29c:\tmul.s\t$f6,$f4,$f0\n 2a0:\tsh\tzero,38(s0)\n 2a4:\tsh\tzero,46(s0)\n 2a8:\tsh\tzero,54(s0)\n 2ac:\tsh\tt4,30(s0)\n 2b0:\tsh\tzero,62(s0)\n 2b4:\tsh\tv0,14(s0)\n 2b8:\ttrunc.w.s\t$f8,$f6\n 2bc:\tsh\tv0,6(s0)\n 2c0:\tmfc1\tt3,$f8\n 2c4:\tnop\n 2c8:\tsrl\tt2,t3,0x10\n 2cc:\tsh\tt2,28(s0)\n 2d0:\tsh\tt3,60(s0)\n 2d4:\tlw\tra,36(sp)\n 2d8:\tlw\ts0,32(sp)\n 2dc:\tldc1\t$f20,24(sp)\n 2e0:\tjr\tra\n 2e4:\taddiu\tsp,sp,88\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000002f0 .text\n00000000 g F .text\t000002e8 suMtxMakeSRT\n00000000 F *UND*\t00000000 sin_s\n00000000 F *UND*\t00000000 cos_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 sin_s\n00000030 R_MIPS_26 sin_s\n00000044 R_MIPS_26 sin_s\n00000058 R_MIPS_26 cos_s\n0000006c R_MIPS_26 cos_s\n00000080 R_MIPS_26 cos_s\n\n\nContents of section .text:\n 0000 27bdffa8 afb00020 00808025 afbf0024 '...... ...%...$\n 0010 f7b40018 afa5005c afa60060 afa70064 .......\\...`...d\n 0020 0c000000 87a4006a 44822000 87a4006e .......jD. ....n\n 0030 0c000000 46802520 44823000 87a40072 ....F.% D.0....r\n 0040 46803220 0c000000 e7a80048 44825000 F.2 .......HD.P.\n 0050 87a4006a 46805420 0c000000 e7b00044 ...jF.T .......D\n 0060 44822000 87a4006e 46802320 0c000000 D. ....nF.# ....\n 0070 e7ac0040 44823000 87a40072 468033a0 ...@D.0....rF.3.\n 0080 0c000000 e7ae003c 44824000 c7ae003c ...........F.2.....\n 02c0 440b4000 00000000 000b5402 a60a001c D.@.......T.....\n 02d0 a60b003c 8fbf0024 8fb00020 d7b40018 ...<...$... ....\n 02e0 03e00008 27bd0058 00000000 00000000 ....'..X........\nContents of section .options:\n 0000 01200000 00000000 a301fff6 00000000 . ..............\n 0010 003ffffd 00000000 00000000 00007ff0 .?..............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a301fff6 00000000 003ffffd 00000000 .........?......\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 000000ba 00000048 000004c8 p..........H....\n 0010 00000007 00000684 00000001 00000510 ................\n 0020 00000004 00000544 00000000 00000000 .......D........\n 0030 00000011 00000574 00000038 000005b8 .......t...8....\n 0040 0000001c 000005f0 00000001 0000060c ................\n 0050 00000000 00000000 00000003 00000654 ...............T\n 0060 076211f0 1010f010 f01010f0 1210f012 .b..............\n 0070 10f01320 e42230d4 10271028 00102805 ... .\"0..'.(..(.\n 0080 102630d4 10271027 31d030d3 102230d4 .&0..'.'1.0..\"0.\n 0090 10271026 10207095 102021e0 321010d0 .'.&. p.. !.2...\n 00a0 e020e310 54000000 00000000 00000001 . ..T...........\n 00b0 00000000 80010000 ffffffcc ffffffff ................\n 00c0 00300000 ffffffc0 00000058 001d001f .0.........X....\n 00d0 0000001c 00000050 00000000 00000001 .......P........\n 00e0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00f0 1820000f 0000002a 000002e8 20200001 . .....*.... ..\n 0100 00000001 00000000 20200000 02000000 ........ ......\n 0110 03000000 04000000 05000000 06000000 ................\n 0120 07000000 08000000 09000000 20000000 ............ ...\n 0130 21000000 0a000000 0b000000 0b000000 !...............\n 0140 1a000000 00000000 00000003 06000000 ................\n 0150 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0160 2d69646f 2d323332 39393131 62336262 -ido-2329911b3bb\n 0170 35316331 342f752e 69007375 4d74784d 51c14/u.i.suMtxM\n 0180 616b6553 52540000 73754d74 784d616b akeSRT..suMtxMak\n 0190 65535254 0073696e 5f730063 6f735f73 eSRT.sin_s.cos_s\n 01a0 00000000 00000000 00000001 00000000 ................\n 01b0 00000037 00000000 00000004 00000000 ...7............\n 01c0 000000ba 00000000 00000000 00000001 ................\n 01d0 00000000 00000011 00000000 00000000 ................\n 01e0 01800000 00000000 00000045 00000000 ...........E....\n 01f0 00000000 00000000 18200001 00000000 ......... ......\n 0200 0000000d 00000000 18cfffff 00000000 ................\n 0210 00000013 00000000 18cfffff 00000000 ................\n 0220 00000000 00000000 00000000 00000000 ................\n 0230 00000000 7fffffff 00000000 7fffffff ................\n 0240 00000001 7fffffff 00000002 00000000 ................\n 0250 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"suMtxMakeSRT\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead 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 suMtxMakeSRT # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 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","cfe: Error: /c.i, line 14: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ValueSet__s_xyz\n lhu\t$t6, 0($a1)\n lh\t$v1, 2($a1)\n andi\t$t7, $t6, 0x7ff\n addu\t$v0, $t7, $a0\n sh\t$v1, 4($v0)\n sh\t$v1, 2($v0)\n jr\t$ra\n sh\t$v1, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ValueSet__s_xyz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_add:ido7.1","sym":"xyz_t_add","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_add(xyz_t* augend, xyz_t* addend, xyz_t* total) {\n total->x = augend->x + addend->x;\n total->y = augend->y + addend->y;\n total->z = augend->z + addend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_add' — lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tadd.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tadd.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_add(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_add(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 + arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 + arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 + arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_add\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n add.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n add.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_mult_v:ido7.1","sym":"xyz_t_mult_v","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float"],"loc":5,"refSource":"void xyz_t_mult_v(xyz_t* multiplicand, f32 multiplier) {\n multiplicand->x *= multiplier;\n multiplicand->y *= multiplier;\n multiplicand->z *= multiplier;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_mult_v' — lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f4,0(a0) */\n/* 8:\tlwc1\t$f8,4(a0) */\n/* c:\tlwc1\t$f16,8(a0) */\n/* 10:\tmul.s\t$f6,$f4,$f12 */\n/* 14:\tmul.s\t$f10,$f8,$f12 */\n/* 18:\tmul.s\t$f18,$f16,$f12 */\n/* 1c:\tswc1\t$f6,0(a0) */\n/* 20:\tswc1\t$f10,4(a0) */\n/* 24:\tjr\tra */\n/* 28:\tswc1\t$f18,8(a0) */\n/* 2c:\tnop */\nvoid xyz_t_mult_v(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_mult_v(void *arg0, f32 arg1) {\n arg0->unk0 = (f32) (arg0->unk0 * arg1);\n arg0->unk4 = (f32) (arg0->unk4 * arg1);\n arg0->unk8 = (f32) (arg0->unk8 * arg1);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_mult_v\n mtc1\t$a1, $f12\n lwc1\t$f4, 0($a0)\n lwc1\t$f8, 4($a0)\n lwc1\t$f16, 8($a0)\n mul.s\t$f6, $f4, $f12\n mul.s\t$f10, $f8, $f12\n mul.s\t$f18, $f16, $f12\n swc1\t$f6, 0($a0)\n swc1\t$f10, 4($a0)\n jr\t$ra\n swc1\t$f18, 8($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_mult_v # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub_ss:ido7.1","sym":"xyz_t_sub_ss","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_sub_ss(xyz_t* dest, s_xyz* minuend, s_xyz* subtrahend) {\n dest->x = minuend->x - subtrahend->x;\n dest->y = minuend->y - subtrahend->y;\n dest->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub_ss' — lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlh\tt6,0(a1) */\n/* 4:\tlh\tt7,0(a2) */\n/* 8:\tsubu\tt8,t6,t7 */\n/* c:\tmtc1\tt8,$f4 */\n/* 10:\tnop */\n/* 14:\tcvt.s.w\t$f6,$f4 */\n/* 18:\tswc1\t$f6,0(a0) */\n/* 1c:\tlh\tt0,2(a2) */\n/* 20:\tlh\tt9,2(a1) */\n/* 24:\tsubu\tt1,t9,t0 */\n/* 28:\tmtc1\tt1,$f8 */\n/* 2c:\tnop */\n/* 30:\tcvt.s.w\t$f10,$f8 */\n/* 34:\tswc1\t$f10,4(a0) */\n/* 38:\tlh\tt3,4(a2) */\n/* 3c:\tlh\tt2,4(a1) */\n/* 40:\tsubu\tt4,t2,t3 */\n/* 44:\tmtc1\tt4,$f16 */\n/* 48:\tnop */\n/* 4c:\tcvt.s.w\t$f18,$f16 */\n/* 50:\tjr\tra */\n/* 54:\tswc1\t$f18,8(a0) */\n/* \t... */\nvoid xyz_t_sub_ss(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub_ss(void *arg0, void *arg1, void *arg2) {\n arg0->unk0 = (f32) (arg1->unk0 - arg2->unk0);\n arg0->unk4 = (f32) (arg1->unk2 - arg2->unk2);\n arg0->unk8 = (f32) (arg1->unk4 - arg2->unk4);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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","cfe: Error: /c.i, line 8: 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub_ss\n lh\t$t6, 0($a1)\n lh\t$t7, 0($a2)\n subu\t$t8, $t6, $t7\n mtc1\t$t8, $f4\n nop\n cvt.s.w\t$f6, $f4\n swc1\t$f6, 0($a0)\n lh\t$t0, 2($a2)\n lh\t$t9, 2($a1)\n subu\t$t1, $t9, $t0\n mtc1\t$t1, $f8\n nop\n cvt.s.w\t$f10, $f8\n swc1\t$f10, 4($a0)\n lh\t$t3, 4($a2)\n lh\t$t2, 4($a1)\n subu\t$t4, $t2, $t3\n mtc1\t$t4, $f16\n nop\n cvt.s.w\t$f18, $f16\n jr\t$ra\n swc1\t$f18, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub_ss # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub:ido7.1","sym":"xyz_t_sub","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","float"],"loc":5,"refSource":"void xyz_t_sub(xyz_t* minuend, xyz_t* subtrahend, xyz_t* diff) {\n diff->x = minuend->x - subtrahend->x;\n diff->y = minuend->y - subtrahend->y;\n diff->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","proto":{"xyz_t_sub":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub' — lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tsub.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tsub.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tsub.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_sub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 - arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 - arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 - arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 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 `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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n sub.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n sub.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n sub.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckTileCollisionVertical:agbcc","sym":"CheckTileCollisionVertical","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","branch","pointer","memory","goto","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","loop","nested-loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ConfigureEntityBehavior:agbcc","sym":"ConfigureEntityBehavior","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["table","pointer","global","switch","loop","mmio","dma","jump-table"],"loc":94,"refSource":"void ConfigureEntityBehavior(u8 arg0, u8 arg1, u8 arg2) {\n void *var_r3;\n void *var_r5;\n void *var_r6;\n u32 var_sb;\n u8 var_r1;\n\n if (arg2 != 0) {\n gEntityInfo[0x23].unkF = 0x19;\n gEntityInfo[0x22].unkF = 0x19;\n gEntityInfo[0x21].unkF = 0x19;\n gEntityInfo[0x20].unkF = 0x19;\n }\n\n switch (arg1) {\n case 0:\n var_sb = 0xD;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 1:\n var_sb = 4;\n var_r6 = &gUnk_03003F56[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x24)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 2:\n var_sb = 6;\n var_r6 = &gUnk_03003E96[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x21)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 3:\n var_sb = 6;\n var_r6 = &gUnk_03003DD6[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1E)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x13);\n break;\n\n case 4:\n var_sb = 6;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0xD);\n break;\n\n case 5:\n var_sb = 6;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C + (gBgInfo[2].hLength * 0x16);\n break;\n\n case 6:\n var_sb = 4;\n var_r6 = &gUnk_03003F56[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x24)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 7:\n var_sb = 7;\n var_r6 = &gUnk_03003E96[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x21)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 8:\n var_sb = 0xA;\n var_r6 = &gUnk_03003DD6[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1E)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n\n case 9:\n var_sb = 0xD;\n var_r6 = &gUnk_03003D16[arg0];\n var_r5 = &gBgDataPtrs.pBufBg2Tilemap[6 + (arg0 * 8) + (gBgInfo[2].hLength * 0x1B)];\n var_r3 = gBgDataPtrs.pBufBg2Tilemap + 0x3C;\n break;\n }\n\n for (var_r1 = 0; var_r1 < var_sb; var_r1++) {\n DmaCopy16Wait(3, var_r3, var_r6, 0x8);\n DmaCopy16Wait(3, var_r3, var_r5, 0x8);\n var_r6 += 0x40;\n var_r5 += gBgInfo[2].hLength;\n var_r3 += gBgInfo[2].hLength;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L4121-L4214","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\n\n.text\n\t.align\t2, 0\n","proto":{"ConfigureEntityBehavior":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ConfigureEntityBehavior' — lift: cannot lift 'ConfigureEntityBehavior': 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\tConfigureEntityBehavior */\n/* \t.type\t ConfigureEntityBehavior,function */\n/* \t.thumb_func */\n/* ConfigureEntityBehavior: */\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\tr4, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr1, r1, #0x18 */\n/* \tmov\tr8, r1 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldr\tr1, .L35 */\n/* \tldr\tr2, .L35+0x4 */\n/* \tadd\tr0, r1, r2 */\n/* \tmov\tr2, #0x19 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr7, .L35+0x8 */\n/* \tadd\tr0, r1, r7 */\n/* \tstrb\tr2, [r0] */\n/* \tsub\tr7, r7, #0x1c */\n/* \tadd\tr0, r1, r7 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr0, .L35+0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tstrb\tr2, [r1] */\n/* .L4: */\n/* \tmov\tr1, r8 */\n/* \tcmp\tr1, #0x9 */\n/* \tbls\t.LCB42 */\n/* \tb\t.L5\t@long jump */\n/* .LCB42: */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L35+0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgEntityInfo */\n/* \t.word\t0x3e3 */\n/* \t.word\t0x3c7 */\n/* \t.word\t0x38f */\n/* \t.word\t.L16 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L16: */\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/* \t.word\t.L12 */\n/* \t.word\t.L13 */\n/* \t.word\t.L14 */\n/* \t.word\t.L15 */\n/* .L6: */\n/* \tmov\tr2, #0xd */\n/* \tmov\tr9, r2 */\n/* \tb\t.L31 */\n/* .L7: */\n/* \tmov\tr7, #0x4 */\n/* \tmov\tr9, r7 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L37 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L37+0x4 */\n/* \tldr\tr0, .L37+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgUnk_03003F56 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L8: */\n/* \tmov\tr0, #0x6 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L39 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L39+0x4 */\n/* \tldr\tr0, .L39+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x5 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03003E96 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L9: */\n/* \tmov\tr1, #0x6 */\n/* \tmov\tr9, r1 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L41 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L41+0x4 */\n/* \tldr\tr0, .L41+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x4 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tb\t.L32 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgUnk_03003DD6 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L10: */\n/* \tmov\tr2, #0x6 */\n/* \tmov\tr9, r2 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L43 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L43+0x4 */\n/* \tldr\tr0, .L43+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tmov\tr0, #0xd */\n/* \tb\t.L33 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L11: */\n/* \tmov\tr7, #0x6 */\n/* \tmov\tr9, r7 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L45 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L45+0x4 */\n/* \tldr\tr0, .L45+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr3, [r3, #0x14] */\n/* \tadd\tr5, r3, r2 */\n/* \tmov\tr0, #0x16 */\n/* .L33: */\n/* \tmul\tr0, r0, r1 */\n/* .L32: */\n/* \tadd\tr0, r0, #0x3c */\n/* \tadd\tr3, r3, r0 */\n/* \tb\t.L5 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L12: */\n/* \tmov\tr0, #0x4 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L47 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tb\t.L34 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03003F56 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L13: */\n/* \tmov\tr1, #0x7 */\n/* \tmov\tr9, r1 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L49 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L49+0x4 */\n/* \tldr\tr0, .L49+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x5 */\n/* \tadd\tr0, r0, r1 */\n/* \tb\t.L34 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03003E96 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L14: */\n/* \tmov\tr2, #0xa */\n/* \tmov\tr9, r2 */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L51 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L51+0x4 */\n/* \tldr\tr0, .L51+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x4 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tb\t.L34 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgUnk_03003DD6 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* .L15: */\n/* \tmov\tr7, #0xd */\n/* \tmov\tr9, r7 */\n/* .L31: */\n/* \tlsl\tr2, r4, #0x3 */\n/* \tldr\tr0, .L53 */\n/* \tadd\tr6, r2, r0 */\n/* \tldr\tr3, .L53+0x4 */\n/* \tldr\tr0, .L53+0x8 */\n/* \tadd\tr0, r0, #0x48 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, r1 */\n/* .L34: */\n/* \tadd\tr0, r0, #0x6 */\n/* \tadd\tr2, r2, r0 */\n/* \tldr\tr0, [r3, #0x14] */\n/* \tadd\tr5, r0, r2 */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x3c */\n/* .L5: */\n/* \tmov\tr1, #0x0 */\n/* \tcmp\tr1, r9 */\n/* \tbcs\t.L19\t@cond_branch */\n/* \tldr\tr4, .L53+0xc */\n/* \tldr\tr0, .L53+0x10 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tmov\tip, r2 */\n/* \tldr\tr7, .L53+0x14 */\n/* \tmov\tsl, r7 */\n/* .L21: */\n/* \tstr\tr3, [r4] */\n/* \tstr\tr6, [r4, #0x4] */\n/* \tmov\tr0, r8 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tmov\tr2, ip */\n/* \tand\tr0, r0, r2 */\n/* \tadd\tr6, r6, #0x40 */\n/* \tadd\tr7, r1, #0x1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x18 */\n/* .L22: */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L22\t@cond_branch */\n/* .L23: */\n/* \tldr\tr1, .L53+0xc */\n/* \tstr\tr3, [r1] */\n/* \tstr\tr5, [r1, #0x4] */\n/* \tmov\tr0, r8 */\n/* \tstr\tr0, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tmov\tr2, ip */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x18 */\n/* .L26: */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L26\t@cond_branch */\n/* .L27: */\n/* \tmov\tr1, sl */\n/* \tldrh\tr0, [r1] */\n/* \tadd\tr5, r5, r0 */\n/* \tadd\tr3, r3, r0 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tcmp\tr1, r9 */\n/* \tbcc\t.L21\t@cond_branch */\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{r0} */\n/* \tbx\tr0 */\n/* .L54: */\n/* \t.align\t2, 0 */\n/* .L53: */\n/* \t.word\tgUnk_03003D16 */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgBgInfo */\n/* \t.word\t0x40000d4 */\n/* \t.word\t-0x7ffffffc */\n/* \t.word\tgBgInfo+0x48 */\n/* .Lfe1: */\n/* \t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ConfigureEntityBehavior(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ConfigureEntityBehavior': 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":379,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ConfigureEntityBehavior': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? gBgDataPtrs;\nextern ? gBgInfo;\nextern ? gEntityInfo;\nextern ? gUnk_03003D16;\nextern ? gUnk_03003DD6;\nextern ? gUnk_03003E96;\nextern ? gUnk_03003F56;\n\nvoid ConfigureEntityBehavior(u8 arg0, u8 arg1, s32 arg2, s32 arg3) {\n s32 temp_r2;\n s32 temp_r2_2;\n s32 temp_r2_3;\n s32 temp_r2_4;\n s32 temp_r2_5;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_3;\n s32 var_r2;\n s32 var_r3;\n u8 temp_r1;\n u8 temp_r4;\n u8 var_r1;\n void *var_r5;\n void *var_r6;\n void *var_r9;\n\n var_r9 = saved_reg_r9;\n var_r3 = arg3;\n var_r6 = saved_reg_r9;\n var_r5 = saved_reg_r8;\n temp_r4 = arg0;\n temp_r1 = arg1;\n if ((arg2 << 0x18) != 0) {\n gEntityInfo.unk3E3 = 0x19;\n gEntityInfo.unk3C7 = 0x19;\n gEntityInfo.unk3AB = 0x19;\n gEntityInfo.unk38F = 0x19;\n }\n switch ((u32) temp_r1) { /* irregular */\n case 0:\n var_r9 = (void *)0xD;\nblock_17:\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003D16;\n var_r0 = gBgInfo.unk48 * 0x1B;\nblock_18:\n var_r5 = gBgDataPtrs.unk14 + (var_r2 + (var_r0 + 6));\n var_r3 = gBgDataPtrs.unk14 + 0x3C;\n break;\n case 1:\n var_r9 = (void *)4;\n temp_r2 = temp_r4 * 8;\n var_r6 = temp_r2 + &gUnk_03003F56;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2 + ((gBgInfo.unk48 * 0x24) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\nblock_12:\n var_r3 = gBgDataPtrs.unk14 + (var_r0_2 + 0x3C);\n break;\n case 2:\n var_r9 = (void *)6;\n temp_r2_2 = temp_r4 * 8;\n var_r6 = temp_r2_2 + &gUnk_03003E96;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_2 + ((gBgInfo.unk48 * 0x21) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\n goto block_12;\n case 3:\n var_r9 = (void *)6;\n temp_r2_3 = temp_r4 * 8;\n var_r6 = temp_r2_3 + &gUnk_03003DD6;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_3 + ((gBgInfo.unk48 * 0x1E) + 6));\n var_r0_2 = gBgInfo.unk48 * 0x13;\n goto block_12;\n case 4:\n var_r9 = (void *)6;\n temp_r2_4 = temp_r4 * 8;\n var_r6 = temp_r2_4 + &gUnk_03003D16;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_4 + ((gBgInfo.unk48 * 0x1B) + 6));\n var_r0_3 = 0xD;\nblock_11:\n var_r0_2 = var_r0_3 * gBgInfo.unk48;\n goto block_12;\n case 5:\n var_r9 = (void *)6;\n temp_r2_5 = temp_r4 * 8;\n var_r6 = temp_r2_5 + &gUnk_03003D16;\n var_r5 = gBgDataPtrs.unk14 + (temp_r2_5 + ((gBgInfo.unk48 * 0x1B) + 6));\n var_r0_3 = 0x16;\n goto block_11;\n case 6:\n var_r9 = (void *)4;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003F56;\n var_r0 = gBgInfo.unk48 * 0x24;\n goto block_18;\n case 7:\n var_r9 = (void *)7;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003E96;\n var_r0 = gBgInfo.unk48 * 0x21;\n goto block_18;\n case 8:\n var_r9 = (void *)0xA;\n var_r2 = temp_r4 * 8;\n var_r6 = var_r2 + &gUnk_03003DD6;\n var_r0 = gBgInfo.unk48 * 0x1E;\n goto block_18;\n case 9:\n var_r9 = (void *)0xD;\n goto block_17;\n }\n var_r1 = 0;\n if ((u32) var_r9 > 0U) {\n do {\n (void *)0x040000D4->unk0 = var_r3;\n (void *)0x040000D4->unk4 = var_r6;\n (void *)0x040000D4->unk8 = 0x80000004;\n var_r6 += 0x40;\n if ((void *)0x040000D4->unk8 & 0x80000000) {\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n }\n (void *)0x040000D4->unk0 = var_r3;\n (void *)0x040000D4->unk4 = var_r5;\n (void *)0x040000D4->unk8 = 0x80000004;\n if ((void *)0x040000D4->unk8 & 0x80000000) {\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n }\n var_r5 += gBgInfo.unk48;\n var_r3 += gBgInfo.unk48;\n var_r1 += 1;\n } while ((u32) var_r1 < (u32) var_r9);\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":132,"gotos":8,"casts":24,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ConfigureEntityBehavior` — benchmark function kleod:ConfigureEntityBehavior:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ConfigureEntityBehavior # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ConfigureEntityBehavior` — benchmark function kleod:ConfigureEntityBehavior:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ConfigureEntityBehavior:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tConfigureEntityBehavior\n\t.type\t ConfigureEntityBehavior,function\n\t.thumb_func\nConfigureEntityBehavior:\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\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr8, r1\n\tlsl\tr2, r2, #0x18\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L35\n\tldr\tr2, .L35+0x4\n\tadd\tr0, r1, r2\n\tmov\tr2, #0x19\n\tstrb\tr2, [r0]\n\tldr\tr7, .L35+0x8\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tsub\tr7, r7, #0x1c\n\tadd\tr0, r1, r7\n\tstrb\tr2, [r0]\n\tldr\tr0, .L35+0xc\n\tadd\tr1, r1, r0\n\tstrb\tr2, [r1]\n.L4:\n\tmov\tr1, r8\n\tcmp\tr1, #0x9\n\tbls\t.LCB42\n\tb\t.L5\t@long jump\n.LCB42:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L35+0x10\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgEntityInfo\n\t.word\t0x3e3\n\t.word\t0x3c7\n\t.word\t0x38f\n\t.word\t.L16\n\t.align\t2, 0\n\t.align\t2, 0\n.L16:\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\t.word\t.L12\n\t.word\t.L13\n\t.word\t.L14\n\t.word\t.L15\n.L6:\n\tmov\tr2, #0xd\n\tmov\tr9, r2\n\tb\t.L31\n.L7:\n\tmov\tr7, #0x4\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L37\n\tadd\tr6, r2, r0\n\tldr\tr3, .L37+0x4\n\tldr\tr0, .L37+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L8:\n\tmov\tr0, #0x6\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L39\n\tadd\tr6, r2, r0\n\tldr\tr3, .L39+0x4\n\tldr\tr0, .L39+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L9:\n\tmov\tr1, #0x6\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L41\n\tadd\tr6, r2, r0\n\tldr\tr3, .L41+0x4\n\tldr\tr0, .L41+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L10:\n\tmov\tr2, #0x6\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L43\n\tadd\tr6, r2, r0\n\tldr\tr3, .L43+0x4\n\tldr\tr0, .L43+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0xd\n\tb\t.L33\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L11:\n\tmov\tr7, #0x6\n\tmov\tr9, r7\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L45\n\tadd\tr6, r2, r0\n\tldr\tr3, .L45+0x4\n\tldr\tr0, .L45+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr3, [r3, #0x14]\n\tadd\tr5, r3, r2\n\tmov\tr0, #0x16\n.L33:\n\tmul\tr0, r0, r1\n.L32:\n\tadd\tr0, r0, #0x3c\n\tadd\tr3, r3, r0\n\tb\t.L5\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L12:\n\tmov\tr0, #0x4\n\tmov\tr9, r0\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L47\n\tadd\tr6, r2, r0\n\tldr\tr3, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tb\t.L34\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03003F56\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L13:\n\tmov\tr1, #0x7\n\tmov\tr9, r1\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L49\n\tadd\tr6, r2, r0\n\tldr\tr3, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x5\n\tadd\tr0, r0, r1\n\tb\t.L34\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003E96\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L14:\n\tmov\tr2, #0xa\n\tmov\tr9, r2\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L51\n\tadd\tr6, r2, r0\n\tldr\tr3, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x4\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tb\t.L34\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03003DD6\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n.L15:\n\tmov\tr7, #0xd\n\tmov\tr9, r7\n.L31:\n\tlsl\tr2, r4, #0x3\n\tldr\tr0, .L53\n\tadd\tr6, r2, r0\n\tldr\tr3, .L53+0x4\n\tldr\tr0, .L53+0x8\n\tadd\tr0, r0, #0x48\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, r1\n.L34:\n\tadd\tr0, r0, #0x6\n\tadd\tr2, r2, r0\n\tldr\tr0, [r3, #0x14]\n\tadd\tr5, r0, r2\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x3c\n.L5:\n\tmov\tr1, #0x0\n\tcmp\tr1, r9\n\tbcs\t.L19\t@cond_branch\n\tldr\tr4, .L53+0xc\n\tldr\tr0, .L53+0x10\n\tmov\tr8, r0\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\tmov\tip, r2\n\tldr\tr7, .L53+0x14\n\tmov\tsl, r7\n.L21:\n\tstr\tr3, [r4]\n\tstr\tr6, [r4, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tadd\tr6, r6, #0x40\n\tadd\tr7, r1, #0x1\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n.L22:\n\tldr\tr0, [r4, #0x8]\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L22\t@cond_branch\n.L23:\n\tldr\tr1, .L53+0xc\n\tstr\tr3, [r1]\n\tstr\tr5, [r1, #0x4]\n\tmov\tr0, r8\n\tstr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tmov\tr2, ip\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n.L26:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L26\t@cond_branch\n.L27:\n\tmov\tr1, sl\n\tldrh\tr0, [r1]\n\tadd\tr5, r5, r0\n\tadd\tr3, r3, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, r9\n\tbcc\t.L21\t@cond_branch\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{r0}\n\tbx\tr0\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03003D16\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffc\n\t.word\tgBgInfo+0x48\n.Lfe1:\n\t.size\t ConfigureEntityBehavior,.Lfe1-ConfigureEntityBehavior\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 \"ConfigureEntityBehavior\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ConfigureEntityBehavior # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","branch","loop","shift","strength-reduce"],"loc":16,"refSource":"void CopyBGScrollTiles(void) {\n u32 var_r5;\n u32 var_r6;\n\n for (var_r6 = 0; var_r6 < 3; var_r6++) {\n if (var_r6 < gUnk_03005220.hearts) {\n var_r5 = 0;\n } else {\n var_r5 = 2;\n }\n gBgTilemapBufs[0][(var_r6 * 2) + 0x241] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x242] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x261] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x15) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x262] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x15) << 5)];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1165-L1180","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-NkXTmJ/c.c:1077: invalid operands to binary <<"},{"label":"unsigned/scopebase/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-hAz9gH/c.c:1078: invalid operands to binary <<"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"nonmatch","source":"void CopyBGScrollTiles(void) {\n u32 v0;\n s32 v1;\n v0 = 0;\n do {\n if (v0 >= gUnk_03005220.hearts) {\n v1 = 2;\n } else {\n v1 = 0;\n }\n gBgTilemapBufs[0][(v0 << 1) + 577] = gBgTilemapBufs[0][(v0 << 1) + (v1 + 20 << 5)];\n gBgTilemapBufs[0][(v0 << 1) + 578] = gBgTilemapBufs[0][(v0 << 1) + ((v1 + 20 << 5) + 1)];\n gBgTilemapBufs[0][(v0 << 1) + 609] = gBgTilemapBufs[0][(v0 << 1) + (v1 + 21 << 5)];\n gBgTilemapBufs[0][(v0 << 1) + 610] = gBgTilemapBufs[0][(v0 << 1) + ((v1 + 21 << 5) + 1)];\n v0 = v0 + 1;\n } while (v0 <= 2);\n return;\n}\n","score":30,"maxScore":72,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":3,"opMismatch":1,"argMismatch":20},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void CopyBGScrollTiles(void) {\n s32 temp_r1;\n s32 temp_r2;\n s32 temp_r3;\n s32 var_r5;\n u32 var_r6;\n\n var_r6 = 0;\n do {\n var_r5 = 2;\n if (var_r6 < (u32) ((u32) (gUnk_03005220 << 0x1E) >> 0x1E)) {\n var_r5 = 0;\n }\n temp_r3 = var_r6 * 2;\n temp_r1 = (var_r5 + 0x14) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x241] = (*gBgTilemapBufs)[temp_r3 + temp_r1];\n (*gBgTilemapBufs)[temp_r3 + 0x242] = (*gBgTilemapBufs)[temp_r3 + (temp_r1 + 1)];\n temp_r2 = (var_r5 + 0x15) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x261] = (*gBgTilemapBufs)[temp_r3 + temp_r2];\n (*gBgTilemapBufs)[temp_r3 + 0x262] = (*gBgTilemapBufs)[temp_r3 + (temp_r2 + 1)];\n var_r6 += 1;\n } while (var_r6 <= 2U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":22,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1082: invalid operands to binary <<"]},"gapSize":{"decompiler":"asmlift","score":30,"maxScore":72,"ratio":0.4166666666666667,"kinds":{"insert":4,"delete":2,"replace":3,"opMismatch":1,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:CountCollectedGems:agbcc","sym":"CountCollectedGems","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","loop","nested-loop","bitwise"],"loc":85,"refSource":"void CountCollectedGems(void) {\n u8 sp0;\n u8 var_ip;\n u8 var_r0;\n u8 var_r3;\n u8 var_r6;\n u8 var_r8;\n\n if ((gUnk_03004670->unk8[5][7] & 0x80) != 0) {\n var_ip = 0;\n var_r8 = 0;\n var_r6 = 0;\n sp0 = 0;\n for (var_r0 = 0; var_r0 < 5; var_r0++) {\n for (var_r3 = 0; var_r3 < 7; var_r3++) {\n if ((var_r3 == 3 || var_r3 == 5) && (gUnk_03004670->unk8[var_r0][var_r3] & 0x7F) == 0x64) {\n var_ip += 1;\n } else if ((var_r3 != 7) && ((gUnk_03004670->unk8[var_r0][var_r3] & 0x7F) == 0x1E)) {\n var_r8 += 1;\n }\n if (gUnk_03004670->unk8[var_r0][var_r3] & 0x80) {\n var_r6 += 1;\n }\n }\n }\n\n if ((gUnk_03004670->unk8[5][0] & 0x7F) == 0x1E) {\n sp0 += 1;\n }\n if ((gUnk_03004670->unk8[5][1] & 0x7F) == 0x1E) {\n sp0 += 1;\n }\n\n if (((gUnk_03004670->unk8[5][0] & 0x7F) == 0x7F) && (var_r6 == 0x23)) {\n gUnk_03004C08.unk0_0 = 4;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][0] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[5][1] & 0x7F) == 0x7F) && ((var_r8 + var_ip) > 0x18)) {\n gUnk_03004C08.unk0_0 = 5;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][1] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[5][2] & 0x7F) == 0x7F) && ((sp0 + var_ip + var_r8) == 0x25)) {\n gUnk_03004C08.unk0_0 = 6;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][2] = 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else {\n // gCallbackQueue.current[1] = GameplayMainLoop;\n }\n } else {\n if (((gUnk_03004670->unk8[0][7] & 0x80) != 0) && ((gUnk_03004670->unk8[1][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 0;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[1][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[1][7] & 0x80) != 0) && ((gUnk_03004670->unk8[2][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 1;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[2][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[2][7] & 0x80) != 0) && ((gUnk_03004670->unk8[3][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 2;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[3][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else if (((gUnk_03004670->unk8[3][7] & 0x80) != 0) && ((gUnk_03004670->unk8[4][0] & 0x7F) == 0x7F)) {\n gUnk_03004C08.unk0_0 = 3;\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[4][0] &= 0x80;\n gCallbackQueue.current[1] = UpdateWorldMapNodeAnim;\n return;\n } else {\n // gCallbackQueue.current[1] = GameplayMainLoop;\n }\n }\n gCallbackQueue.current[1] = GameplayMainLoop;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1891-L1975","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-8f3949f8ca4f.i.gz","proto":{"CountCollectedGems":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CountCollectedGems' — lift: cannot lift 'CountCollectedGems': 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\tCountCollectedGems */\n/* \t.type\t CountCollectedGems,function */\n/* \t.thumb_func */\n/* CountCollectedGems: */\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/* \tldr\tr2, .L39 */\n/* \tldr\tr3, [r2] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x37 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tmov\tsl, r2 */\n/* \tcmp\tr5, #0 */\n/* \tbne\t.LCB19 */\n/* \tb\t.L4\t@long jump */\n/* .LCB19: */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tip, r0 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tr1, #0x0 */\n/* \tstr\tr1, [sp] */\n/* \tmov\tr4, sl */\n/* \tmov\tr1, #0x7f */\n/* \tmov\tr9, r1 */\n/* .L8: */\n/* \tmov\tr3, #0x0 */\n/* \tadd\tr5, r0, #0x1 */\n/* \tlsl\tr2, r0, #0x3 */\n/* .L12: */\n/* \tcmp\tr3, #0x3 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tcmp\tr3, #0x5 */\n/* \tbne\t.L13\t@cond_branch */\n/* .L14: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, r9 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x64 */\n/* \tbne\t.L13\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/* \tb\t.L15 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03004670 */\n/* .L13: */\n/* \tcmp\tr3, #0x7 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, r9 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\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/* .L15: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr1, r3, r2 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr7, #0x80 */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L11\t@cond_branch */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L11: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, #0x6 */\n/* \tbls\t.L12\t@cond_branch */\n/* \tlsl\tr0, r5, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x4 */\n/* \tbls\t.L8\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tldr\tr1, [r0] */\n/* \tadd\tr5, r1, #0 */\n/* \tadd\tr5, r5, #0x30 */\n/* \tldrb\tr0, [r5] */\n/* \tmov\tr4, #0x7f */\n/* \tadd\tr3, r4, #0 */\n/* \tand\tr3, r3, r0 */\n/* \tcmp\tr3, #0x1e */\n/* \tbne\t.L20\t@cond_branch */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp] */\n/* .L20: */\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.L21\t@cond_branch */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp] */\n/* .L21: */\n/* \tcmp\tr3, #0x7f */\n/* \tbne\t.L22\t@cond_branch */\n/* \tcmp\tr6, #0x23 */\n/* \tbne\t.L22\t@cond_branch */\n/* \tldr\tr2, .L41 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x4 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tstrb\tr7, [r5] */\n/* \tldr\tr0, .L41+0x4 */\n/* \tb\t.L37 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L22: */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x31 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L24\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, ip */\n/* \tcmp\tr0, #0x18 */\n/* \tble\t.L24\t@cond_branch */\n/* \tldr\tr2, .L43 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x5 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tmov\tr0, #0x80 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L43+0x4 */\n/* \tb\t.L37 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L24: */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x32 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.LCB249 */\n/* \tb\t.L28\t@long jump */\n/* .LCB249: */\n/* \tldr\tr0, [sp] */\n/* \tadd\tr0, r0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tcmp\tr0, #0x25 */\n/* \tbeq\t.LCB254 */\n/* \tb\t.L28\t@long jump */\n/* .LCB254: */\n/* \tldr\tr2, .L45 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x6 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tmov\tr0, #0x80 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L45+0x4 */\n/* \tb\t.L37 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L4: */\n/* \tldrb\tr1, [r3, #0xf] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L29\t@cond_branch */\n/* \tldrb\tr1, [r3, #0x10] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L29\t@cond_branch */\n/* \tldr\tr1, .L47 */\n/* \tldrb\tr2, [r1] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r2 */\n/* \tstrb\tr0, [r1] */\n/* \tstrb\tr5, [r1, #0x2] */\n/* \tldrb\tr1, [r3, #0x10] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x10] */\n/* \tldr\tr1, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tb\t.L38 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L29: */\n/* \tmov\tr0, sl */\n/* \tldr\tr3, [r0] */\n/* \tldrb\tr1, [r3, #0x17] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L31\t@cond_branch */\n/* \tldrb\tr1, [r3, #0x18] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L31\t@cond_branch */\n/* \tldr\tr2, .L49 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x1 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3, #0x18] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x18] */\n/* \tldr\tr1, .L49+0x4 */\n/* \tldr\tr0, .L49+0x8 */\n/* \tb\t.L38 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L31: */\n/* \tmov\tr1, sl */\n/* \tldr\tr3, [r1] */\n/* \tldrb\tr1, [r3, #0x1f] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L33\t@cond_branch */\n/* \tadd\tr3, r3, #0x20 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L33\t@cond_branch */\n/* \tldr\tr2, .L51 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr1, .L51+0x4 */\n/* \tldr\tr0, .L51+0x8 */\n/* \tb\t.L38 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L33: */\n/* \tmov\tr0, sl */\n/* \tldr\tr2, [r0] */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x27 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr4, #0x80 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L28\t@cond_branch */\n/* \tadd\tr3, r2, #0 */\n/* \tadd\tr3, r3, #0x28 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.L28\t@cond_branch */\n/* \tldr\tr2, .L53 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x10 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r1 */\n/* \tmov\tr1, #0x3 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r2] */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0x2] */\n/* \tldrb\tr1, [r3] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L53+0x4 */\n/* \tb\t.L37 */\n/* .L54: */\n/* \t.align\t2, 0 */\n/* .L53: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tUpdateWorldMapNodeAnim */\n/* .L28: */\n/* \tldr\tr0, .L55 */\n/* .L37: */\n/* \tldr\tr1, .L55+0x4 */\n/* .L38: */\n/* \tstr\tr0, [r1, #0x4] */\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{r0} */\n/* \tbx\tr0 */\n/* .L56: */\n/* \t.align\t2, 0 */\n/* .L55: */\n/* \t.word\tGameplayMainLoop */\n/* \t.word\tgCallbackQueue */\n/* .Lfe1: */\n/* \t.size\t CountCollectedGems,.Lfe1-CountCollectedGems */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CountCollectedGems(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CountCollectedGems': 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":404,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CountCollectedGems': 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 CountCollectedGems(void) {\n s32 temp_r2;\n s32 temp_r3;\n u8 temp_r5;\n u8 var_ip;\n u8 var_r0_2;\n u8 var_r3;\n u8 var_r6;\n u8 var_r8;\n void (*var_r0)();\n\n temp_r5 = 0x80 & gUnk_03004670->unk8[5][7];\n if (temp_r5 == 0) {\n if ((0x80 & gUnk_03004670->unk8[0][7]) && ((0x7F & gUnk_03004670->unk8[1][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) (-0x10 & gUnk_03004C08.unk0);\n gUnk_03004C08.unk2 = temp_r5;\n gUnk_03004670->unk8[1][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[1][7]) && ((0x7F & gUnk_03004670->unk8[2][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 1);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[2][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[2][7]) && ((0x7F & gUnk_03004670->unk8[3][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 2);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[3][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if ((0x80 & gUnk_03004670->unk8[3][7]) && ((0x7F & gUnk_03004670->unk8[4][0]) == 0x7F)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 3);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[4][0] &= 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else {\n goto block_42;\n }\n } else {\n var_r0_2 = 0;\n var_ip = 0;\n var_r8 = 0;\n var_r6 = 0;\n unksp0 = 0;\n do {\n var_r3 = 0;\n temp_r2 = var_r0_2 * 8;\nloop_4:\n switch (var_r3) { /* irregular */\n case 7:\n break;\n case 3:\n case 5:\n if ((0x7F & gUnk_03004670->unk8[0][var_r3 + temp_r2]) == 0x64) {\n var_ip += 1;\n } else if ((var_r3 != 7) && ((0x7F & gUnk_03004670->unk8[0][var_r3 + temp_r2]) == 0x1E)) {\n var_r8 += 1;\n }\n break;\n }\n if (0x80 & gUnk_03004670->unk8[0][var_r3 + temp_r2]) {\n var_r6 += 1;\n }\n var_r3 += 1;\n if ((u32) var_r3 <= 6U) {\n goto loop_4;\n }\n var_r0_2 += 1;\n } while ((u32) var_r0_2 <= 4U);\n temp_r3 = 0x7F & gUnk_03004670->unk8[5][0];\n if (temp_r3 == 0x1E) {\n unksp0 = (s32) (u8) (unksp0 + 1);\n }\n if ((0x7F & gUnk_03004670->unk8[5][1]) == 0x1E) {\n unksp0 = (s32) (u8) (unksp0 + 1);\n }\n if ((temp_r3 == 0x7F) && (var_r6 == 0x23)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 4);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][0] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else if (((0x7F & gUnk_03004670->unk8[5][1]) == 0x7F) && ((s32) (var_r8 + var_ip) > 0x18)) {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 5);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][1] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n } else {\n if ((0x7F & gUnk_03004670->unk8[5][2]) != 0x7F) {\n goto block_42;\n }\n if ((unksp0 + var_ip + var_r8) != 0x25) {\nblock_42:\n var_r0 = GameplayMainLoop;\n } else {\n gUnk_03004C08.unk0 = (u8) ((-0x10 & gUnk_03004C08.unk0) | 6);\n gUnk_03004C08.unk2 = 0;\n gUnk_03004670->unk8[5][2] = 0x80;\n var_r0 = UpdateWorldMapNodeAnim;\n }\n }\n }\n gCallbackQueue.current[1] = var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":56,"lines":100,"gotos":3,"casts":15,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1152: structure has no member named `unk0'","/c.c:1157: structure has no member named `unk0'","/c.c:1162: structure has no member named `unk0'","/c.c:1167: structure has no member named `unk0'","/c.c:1179: `unksp0' undeclared (first use in this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountCollectedGems` — benchmark function kleod:CountCollectedGems:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\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-8f3949f8ca4f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CountCollectedGems(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CountCollectedGems # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CountCollectedGems` — benchmark function kleod:CountCollectedGems:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:CountCollectedGems:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountCollectedGems\n\t.type\t CountCollectedGems,function\n\t.thumb_func\nCountCollectedGems:\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\tldr\tr2, .L39\n\tldr\tr3, [r2]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tmov\tsl, r2\n\tcmp\tr5, #0\n\tbne\t.LCB19\n\tb\t.L4\t@long jump\n.LCB19:\n\tmov\tr0, #0x0\n\tmov\tip, r0\n\tmov\tr8, r0\n\tmov\tr6, #0x0\n\tmov\tr1, #0x0\n\tstr\tr1, [sp]\n\tmov\tr4, sl\n\tmov\tr1, #0x7f\n\tmov\tr9, r1\n.L8:\n\tmov\tr3, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr2, r0, #0x3\n.L12:\n\tcmp\tr3, #0x3\n\tbeq\t.L14\t@cond_branch\n\tcmp\tr3, #0x5\n\tbne\t.L13\t@cond_branch\n.L14:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L13\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\tb\t.L15\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004670\n.L13:\n\tcmp\tr3, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, r9\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\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.L15:\n\tldr\tr0, [r4]\n\tadd\tr1, r3, r2\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr7, #0x80\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L11:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x6\n\tbls\t.L12\t@cond_branch\n\tlsl\tr0, r5, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x4\n\tbls\t.L8\t@cond_branch\n\tmov\tr0, sl\n\tldr\tr1, [r0]\n\tadd\tr5, r1, #0\n\tadd\tr5, r5, #0x30\n\tldrb\tr0, [r5]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L20:\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.L21\t@cond_branch\n\tldr\tr0, [sp]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp]\n.L21:\n\tcmp\tr3, #0x7f\n\tbne\t.L22\t@cond_branch\n\tcmp\tr6, #0x23\n\tbne\t.L22\t@cond_branch\n\tldr\tr2, .L41\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x4\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tstrb\tr7, [r5]\n\tldr\tr0, .L41+0x4\n\tb\t.L37\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L22:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x31\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, ip\n\tcmp\tr0, #0x18\n\tble\t.L24\t@cond_branch\n\tldr\tr2, .L43\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x5\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L43+0x4\n\tb\t.L37\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L24:\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x32\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.LCB249\n\tb\t.L28\t@long jump\n.LCB249:\n\tldr\tr0, [sp]\n\tadd\tr0, r0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x25\n\tbeq\t.LCB254\n\tb\t.L28\t@long jump\n.LCB254:\n\tldr\tr2, .L45\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x6\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tmov\tr0, #0x80\n\tstrb\tr0, [r3]\n\tldr\tr0, .L45+0x4\n\tb\t.L37\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L4:\n\tldrb\tr1, [r3, #0xf]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L29\t@cond_branch\n\tldrb\tr1, [r3, #0x10]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L29\t@cond_branch\n\tldr\tr1, .L47\n\tldrb\tr2, [r1]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\tstrb\tr0, [r1]\n\tstrb\tr5, [r1, #0x2]\n\tldrb\tr1, [r3, #0x10]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x10]\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tb\t.L38\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L29:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr1, [r3, #0x17]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L31\t@cond_branch\n\tldrb\tr1, [r3, #0x18]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L31\t@cond_branch\n\tldr\tr2, .L49\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3, #0x18]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0x18]\n\tldr\tr1, .L49+0x4\n\tldr\tr0, .L49+0x8\n\tb\t.L38\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L31:\n\tmov\tr1, sl\n\tldr\tr3, [r1]\n\tldrb\tr1, [r3, #0x1f]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L33\t@cond_branch\n\tadd\tr3, r3, #0x20\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L33\t@cond_branch\n\tldr\tr2, .L51\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr1, .L51+0x4\n\tldr\tr0, .L51+0x8\n\tb\t.L38\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tUpdateWorldMapNodeAnim\n.L33:\n\tmov\tr0, sl\n\tldr\tr2, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x27\n\tldrb\tr1, [r0]\n\tmov\tr4, #0x80\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L28\t@cond_branch\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.L28\t@cond_branch\n\tldr\tr2, .L53\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x10\n\tneg\tr0, r0\n\tand\tr0, r0, r1\n\tmov\tr1, #0x3\n\torr\tr0, r0, r1\n\tstrb\tr0, [r2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0x2]\n\tldrb\tr1, [r3]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L53+0x4\n\tb\t.L37\n.L54:\n\t.align\t2, 0\n.L53:\n\t.word\tgUnk_03004C08\n\t.word\tUpdateWorldMapNodeAnim\n.L28:\n\tldr\tr0, .L55\n.L37:\n\tldr\tr1, .L55+0x4\n.L38:\n\tstr\tr0, [r1, #0x4]\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{r0}\n\tbx\tr0\n.L56:\n\t.align\t2, 0\n.L55:\n\t.word\tGameplayMainLoop\n\t.word\tgCallbackQueue\n.Lfe1:\n\t.size\t CountCollectedGems,.Lfe1-CountCollectedGems\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 \"CountCollectedGems\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountCollectedGems # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","cast","memory","shift","bitwise","call"],"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 if (*a1 >= 0) {\n LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc((u32)a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n thunk_HeapFree(v0, a0);\n }\n return;\n}\n","score":9,"maxScore":30,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":12,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Decompress(void *arg0, void *arg1) {\n void *temp_r0;\n\n if ((s32) arg1->unk0 < 0) {\n temp_r0 = thunk_HeapAlloc((u32) arg1->unk4 >> 8, 0U);\n HuffUnComp(arg1 + 4, temp_r0);\n LZ77UnCompWram(temp_r0, arg0);\n thunk_HeapFree(temp_r0);\n return;\n }\n LZ77UnCompWram(arg1 + 4, arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk0' in something not a structure or union","/c.c:1076: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":30,"ratio":0.3,"kinds":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["cast","memory","pointer","bitwise","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["cast","memory","bitwise","call","mmio","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":[{"name":"REG_DMA3SAD","shape":"scalar u32"}],"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 *)®_DMA3SAD = v0 + 4;\n ((s32 *)®_DMA3SAD)[1] = a1;\n ((s32 *)®_DMA3SAD)[2] = a2 << 16 >> 17 | 128 << 24;\n do {\n } while ((((s32 *)®_DMA3SAD)[2] & 128 << 24) != 0);\n thunk_HeapFree(v0, ®_DMA3SAD, 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","cast","memory","shift","bitwise","mmio","dma"],"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"},{"name":"REG_DMA3SAD","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 *)®_DMA3SAD;\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityDeathAnimation:agbcc","sym":"EntityDeathAnimation","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","global","bitwise","call"],"loc":50,"refSource":"void EntityDeathAnimation(u8 slot) {\n u8 phase;\n s16 byteMask;\n int newPhase;\n EntityDeathStruct *entities = (EntityDeathStruct *)gEntityArray;\n EntityDeathStruct *entity = &entities[slot];\n EntityDeathStruct *arr;\n EntityDeathStruct *self;\n\n entity->timer = entity->timer - 1;\n byteMask = 0xFF;\n if (entity->timer == 0xFF) {\n entity->timer = 25;\n phase = entity->phase;\n if (phase <= 5) {\n SpawnEntityAtPosition(entities[slot - *gEntityDeathState].x, entities[slot - *gEntityDeathState].y, (u8)(phase + 0x0C), 0);\n }\n newPhase = entity->phase - 1;\n entity->phase = newPhase;\n do {\n if ((newPhase & byteMask) == 0) {\n do {\n SpawnEntityAtPosition(entities[slot - *gEntityDeathState].x, entities[slot - *gEntityDeathState].y, 2,\n (u8)(slot - *gEntityDeathState));\n } while (0);\n } else {\n m4aSongNumStart(0x56);\n if (entity->phase > 9) {\n entities[slot + *gEntityDeathState].typeId = 0;\n LoadSpriteFrame((u8)(slot + *gEntityDeathState), sub_08051A0C(entity->phase, 0x0A));\n }\n LoadSpriteFrame(slot, sub_08051A84(entity->phase, 0x0A));\n if (entity->phase == 9) {\n entities[slot + *gEntityDeathState].typeId = 0x1C; /* inactive */\n entities[slot + *gEntityDeathState].subState = 0;\n }\n }\n } while (0);\n }\n arr = (EntityDeathStruct *)gEntityArray;\n self = &arr[slot];\n byteMask |= 0;\n self->x = arr[slot - *gEntityDeathState].x;\n self->y = arr[slot - *gEntityDeathState].y - 0x20;\n if (self->phase > 9) {\n arr[slot + *gEntityDeathState].x = arr[slot - *gEntityDeathState].x - 3;\n arr[slot + *gEntityDeathState].y = arr[slot - *gEntityDeathState].y - 0x20;\n self->x = self->x + 3;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_1.c#L446-L495","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-169871128279.i.gz","proto":{"EntityDeathAnimation":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Elem0 { u16 field_0; u16 field_2; u8 _pad0[4]; u8 field_8; u8 field_9; u8 _pad1[5]; u8 field_15; u8 field_16; u8 _pad2[11]; };\nvoid EntityDeathAnimation(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n u8 * v8;\n v0 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9;\n v1 = 0;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9 = v0 - 1;\n if ((u8)(v0 - 1) == 255) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_9 = 25;\n v2 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8;\n if (v2 > 5) {\n v4 = v1;\n } else {\n v3 = *(u8 *)50352780;\n v4 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - v3].field_2;\n v5 = 0;\n SpawnEntityAtPosition(((struct Elem0 *)&gEntityArray)[(u8)a0 - v3].field_0, v4, (u8)(v2 + 12), v5);\n v2 = (u8)(v2 + 12);\n a1 = v5;\n }\n v6 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 = v6 - 1;\n if ((v6 - 1 & 255) != 0) {\n m4aSongNumStart(86, v4, v2, a1);\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 > 9) {\n v8 = (u8 *)50352780;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *v8].field_15 = v1;\n LoadSpriteFrame((u8)((u8)a0 + *v8), (u8)sub_08051A0C(((struct Elem0 *)&gEntityArray)[(u8)a0].field_8, 10, v8, a1));\n v2 = v8;\n }\n LoadSpriteFrame((u8)a0, (u8)sub_08051A84(((struct Elem0 *)&gEntityArray)[(u8)a0].field_8, 10, v2, a1));\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 == 9) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_15 = 28;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_16 = v1;\n }\n } else {\n v7 = *(u8 *)50352780;\n SpawnEntityAtPosition(((struct Elem0 *)&gEntityArray)[(u8)a0 - v7].field_0, ((struct Elem0 *)&gEntityArray)[(u8)a0 - v7].field_2, 2, (u8)((u8)a0 - v7));\n }\n }\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_0;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_2 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_2 - 32;\n if (((struct Elem0 *)&gEntityArray)[(u8)a0].field_8 > 9) {\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_0 - 3;\n ((struct Elem0 *)&gEntityArray)[(u8)a0 + *(u8 *)50352780].field_2 = ((struct Elem0 *)&gEntityArray)[(u8)a0 - *(u8 *)50352780].field_2 - 32;\n ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 = ((struct Elem0 *)&gEntityArray)[(u8)a0].field_0 + 3;\n }\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":56,"gotos":0,"casts":49,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'EntityDeathAnimation': agbcc failed: /c.c:1127: too many arguments to function `m4aSongNumStart'"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EntityDeathAnimation(u8 slot) {\n u8 temp_r0;\n u8 temp_r0_2;\n u8 temp_r2;\n u8 temp_r2_2;\n u8 temp_r2_3;\n u8 temp_r3;\n u8 temp_r4;\n u8 temp_r5;\n void *temp_r1;\n void *temp_r1_2;\n void *temp_r4_2;\n void *temp_r6;\n\n temp_r5 = slot;\n temp_r6 = (temp_r5 * 0x1C) + gEntityArray;\n temp_r0 = temp_r6->unk9 - 1;\n temp_r6->unk9 = temp_r0;\n if (temp_r0 == 0xFF) {\n temp_r6->unk9 = 0x19U;\n temp_r2 = temp_r6->unk8;\n if ((u32) temp_r2 <= 5U) {\n temp_r1 = ((temp_r5 - *(u8 *)0x0300528C) * 0x1C) + gEntityArray;\n SpawnEntityAtPosition(temp_r1->unk0, temp_r1->unk2, (u8) (temp_r2 + 0xC), 0U);\n }\n temp_r0_2 = temp_r6->unk8 - 1;\n temp_r6->unk8 = temp_r0_2;\n if (temp_r0_2 == 0) {\n temp_r3 = temp_r5 - *(void *)0x0300528C;\n temp_r1_2 = (temp_r3 * 0x1C) + gEntityArray;\n SpawnEntityAtPosition(temp_r1_2->unk0, temp_r1_2->unk2, 2U, temp_r3);\n } else {\n m4aSongNumStart(0x56U);\n if ((u32) temp_r6->unk8 > 9U) {\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unkF = 0;\n temp_r4 = temp_r5 + *(void *)0x0300528C;\n LoadSpriteFrame(temp_r4, sub_08051A0C(temp_r6->unk8, 0xAU));\n }\n LoadSpriteFrame(temp_r5, sub_08051A84(temp_r6->unk8, 0xAU));\n if (temp_r6->unk8 == 9) {\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unkF = 0x1C;\n (((temp_r5 + *(void *)0x0300528C) * 0x1C) + gEntityArray)->unk10 = 0;\n }\n }\n }\n temp_r4_2 = (temp_r5 * 0x1C) + gEntityArray;\n temp_r4_2->unk0 = (u16) *(((temp_r5 - *(void *)0x0300528C) * 0x1C) + gEntityArray);\n temp_r4_2->unk2 = (s16) ((((temp_r5 - *(void *)0x0300528C) * 0x1C) + gEntityArray)->unk2 - 0x20);\n if ((u32) temp_r4_2->unk8 > 9U) {\n temp_r2_2 = *(void *)0x0300528C;\n *(((temp_r5 + temp_r2_2) * 0x1C) + gEntityArray) = *(((temp_r5 - temp_r2_2) * 0x1C) + gEntityArray) - 3;\n temp_r2_3 = *(void *)0x0300528C;\n (((temp_r5 + temp_r2_3) * 0x1C) + gEntityArray)->unk2 = (s16) ((((temp_r5 - temp_r2_3) * 0x1C) + gEntityArray)->unk2 - 0x20);\n temp_r4_2->unk0 = (u16) (temp_r4_2->unk0 + 3);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":55,"gotos":0,"casts":18,"unkGlue":0,"rawMem":0,"addrDeref":10},"errorMarkers":["agbcc failed: /c.c:1113: warning: dereferencing `void *' pointer","/c.c:1113: request for member `unk9' in something not a structure or union","/c.c:1114: warning: dereferencing `void *' pointer","/c.c:1114: request for member `unk9' in something not a structure or union","/c.c:1116: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EntityDeathAnimation` — benchmark function kleod:EntityDeathAnimation:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\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-169871128279.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EntityDeathAnimation(u8 slot);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EntityDeathAnimation # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EntityDeathAnimation` — benchmark function kleod:EntityDeathAnimation:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityDeathAnimation:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityDeathAnimation\n\t.type\t EntityDeathAnimation,function\n\t.thumb_func\nEntityDeathAnimation:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr7, .L20\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr6, r0, r7\n\tldrb\tr0, [r6, #0x9]\n\tsub\tr0, r0, #0x1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrb\tr0, [r6, #0x9]\n\tmov\tr4, #0xff\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0xff\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x19\n\tstrb\tr0, [r6, #0x9]\n\tldrb\tr2, [r6, #0x8]\n\tcmp\tr2, #0x5\n\tbhi\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr0, [r0]\n\tsub\tr0, r5, r0\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tadd\tr2, r2, #0xc\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tbl\tSpawnEntityAtPosition\n.L4:\n\tldrb\tr0, [r6, #0x8]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r6, #0x8]\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tldrb\tr3, [r0]\n\tsub\tr3, r5, r3\n\tlsl\tr1, r3, #0x3\n\tsub\tr1, r1, r3\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r7\n\tldrh\tr0, [r1]\n\tldrh\tr1, [r1, #0x2]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr2, #0x2\n\tbl\tSpawnEntityAtPosition\n\tb\t.L3\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntityArray\n\t.word\t0x300528c\n.L8:\n\tmov\tr0, #0x56\n\tbl\tm4aSongNumStart\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L15\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr4, [r2]\n\tadd\tr4, r5, r4\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A0C\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r4, #0\n\tbl\tLoadSpriteFrame\n.L15:\n\tldrb\tr0, [r6, #0x8]\n\tmov\tr1, #0xa\n\tbl\tsub_08051A84\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r5, #0\n\tbl\tLoadSpriteFrame\n\tldrb\tr0, [r6, #0x8]\n\tcmp\tr0, #0x9\n\tbne\t.L3\t@cond_branch\n\tldr\tr2, .L22\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tldrb\tr1, [r2]\n\tadd\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r7\n\tmov\tr1, r8\n\tstrb\tr1, [r0, #0x10]\n.L3:\n\tldr\tr3, .L22+0x4\n\tlsl\tr0, r5, #0x3\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr4, r0, r3\n\tldr\tr6, .L22\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldrb\tr1, [r6]\n\tsub\tr1, r5, r1\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r4, #0x2]\n\tldrb\tr0, [r4, #0x8]\n\tcmp\tr0, #0x9\n\tbls\t.L19\t@cond_branch\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x3\n\tstrh\tr0, [r1]\n\tldrb\tr2, [r6]\n\tadd\tr0, r5, r2\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tsub\tr2, r5, r2\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x2]\n\tsub\tr0, r0, #0x20\n\tstrh\tr0, [r1, #0x2]\n\tldrh\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tstrh\tr0, [r4]\n.L19:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x300528c\n\t.word\tgEntityArray\n.Lfe1:\n\t.size\t EntityDeathAnimation,.Lfe1-EntityDeathAnimation\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 \"EntityDeathAnimation\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EntityDeathAnimation # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:EntityItemDrop:agbcc","sym":"EntityItemDrop","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitfield","array","struct","global","switch","shift","comparison-tree"],"loc":64,"refSource":"void EntityItemDrop(u8 arg0) {\n u8 itemType = arg0 + 0xE4;\n\n if (gGameFlagsPtr[0x0A] == 1) {\n gEntity.base[arg0].unk_F = 0x1C;\n gEntity.base[arg0].unk_10 = 0;\n return;\n }\n\n switch (gEntity.base[arg0].unk_F) {\n case 3: {\n gEntity.base[arg0].unk_F = 0;\n gEntity.base[arg0].unk_14 = 0;\n gEntity.base[arg0].unk_10 = 1;\n gEntity.base[arg0].unk_C_0 = 0;\n\n if (gEntity.unk_204_2 == 0) {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 + 0x10;\n } else {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 - 0x10;\n }\n\n gEntity.base[arg0].unk_2 = gEntity.unk_1FA;\n gEntity.base[arg0].unk_8 = gItemDropParamTable.unk_0[itemType][0];\n gEntity.base[arg0].unk_9 = gItemDropParamTable.unk_0[itemType][1];\n gEntity.base[arg0].unk_16 = 4;\n break;\n }\n\n case 4: {\n gEntity.base[arg0].unk_F = 0;\n gEntity.base[arg0].unk_14 = 0;\n gEntity.base[arg0].unk_10 = 1;\n gEntity.base[arg0].unk_C_0 = 0;\n\n if (gEntity.unk_204_2 == 0) {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 + 0x10;\n } else {\n gEntity.base[arg0].unk_0 = gEntity.unk_1F8 - 0x10;\n }\n\n gEntity.base[arg0].unk_2 = gEntity.unk_1FA;\n gEntity.base[arg0].unk_8 = gItemDropParamTable.unk_A[itemType][0];\n gEntity.base[arg0].unk_9 = gItemDropParamTable.unk_A[itemType][1];\n gEntity.base[arg0].unk_16 = 2;\n break;\n }\n\n case 0: {\n gEntity.base[arg0].unk_2 = 0x10C - ((gEntity.base[arg0].unk_9 * gSineTable[gEntity.base[arg0].unk_14]) >> 8);\n gEntity.base[arg0].unk_0 += gEntity.base[arg0].unk_8;\n\n gEntity.base[arg0].unk_14 += gEntity.base[arg0].unk_16;\n if (gEntity.base[arg0].unk_14 == 0x88) {\n gEntity.base[arg0].unk_F = 0x1C;\n gEntity.base[arg0].unk_10 = 0;\n }\n break;\n }\n\n default:\n break;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_1.c#L534-L597","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-d4ba501e6cbc.i.gz","proto":{"EntityItemDrop":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/flip-branch","symbolsUsed":[{"name":"gEntity","shape":"struct Entity (520 B)"},{"name":"gGameFlagsPtr","shape":"u8[]"},{"name":"gItemDropParamTable","shape":"struct ItemDropParamTable (20 B)"},{"name":"gSineTable","shape":"s16[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 field_0; u8 _pad0[1]; };\nstruct Elem1 { u8 field_0; u8 _pad0[1]; };\nstruct Elem2 { u8 field_0; u8 _pad0[1]; };\nstruct Elem3 { u8 field_0; u8 _pad0[1]; };\nstruct Struct0 { u16 field_0; u16 field_2; u8 _pad0[8]; u8 field_12; u8 _pad1[2]; u8 field_15; u8 field_16; u8 _pad2[3]; u16 field_20; u8 field_22; };\nstruct Struct1 { u8 _pad0[2]; u16 field_2; u8 _pad1[4]; u8 field_8; u8 field_9; u8 _pad2[12]; u8 field_22; };\nstruct Struct2 { u8 _pad0[2]; u16 field_2; u8 _pad1[4]; u8 field_8; u8 field_9; u8 _pad2[12]; u8 field_22; };\nvoid EntityItemDrop(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n u8 * p0;\n p0 = (u8 *)&gEntity;\n if (gGameFlagsPtr[10] != 1) {\n if (p0[(u8)a0 * 28 + 15] == 3) {\n p0[(u8)a0 * 28 + 15] = 0;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = 0;\n p0[(u8)a0 * 28 + 16] = 1;\n p0[(u8)a0 * 28 + 12] = 1 - 5 & p0[(u8)a0 * 28 + 12];\n if ((u32)(p0[129 << 2] << 28) >> 30 != 0) {\n v2 = ((u16 *)&gEntity)[252] - 16;\n } else {\n v2 = ((u16 *)&gEntity)[252] + 16;\n }\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = v2;\n ((struct Struct1 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = ((u16 *)&gEntity)[253];\n p0[(u8)a0 * 28 + 8] = ((struct Elem0 *)&gItemDropParamTable)[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 9] = ((struct Elem1 *)((u32)&gItemDropParamTable + 1))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 22] = 4;\n return;\n } else {\n if (p0[(u8)a0 * 28 + 15] > 3) {\n if (p0[(u8)a0 * 28 + 15] == 4) {\n p0[(u8)a0 * 28 + 15] = 0;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = 0;\n p0[(u8)a0 * 28 + 16] = 1;\n p0[(u8)a0 * 28 + 12] = 1 - 5 & p0[(u8)a0 * 28 + 12];\n if ((u32)(p0[129 << 2] << 28) >> 30 != 0) {\n v3 = ((u16 *)&gEntity)[252] - 16;\n } else {\n v3 = ((u16 *)&gEntity)[252] + 16;\n }\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = v3;\n ((struct Struct2 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = ((u16 *)&gEntity)[253];\n p0[(u8)a0 * 28 + 8] = ((struct Elem2 *)((u32)&gItemDropParamTable + 10))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 9] = ((struct Elem3 *)((u32)&gItemDropParamTable + 11))[(a0 << 24) + (228 << 24) >> 24].field_0;\n p0[(u8)a0 * 28 + 22] = 2;\n return;\n } else {\n return;\n }\n } else {\n if (p0[(u8)a0 * 28 + 15] == 0) {\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_2 = (134 << 1) - (*(s8 *)((u8)a0 * 28 + (u32)&gEntity + 9) * *(s16 *)((((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 << 1) + (u32)&gSineTable + 0) >> 8);\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0 = *(s8 *)((u8)a0 * 28 + (u32)&gEntity + 8) + ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_0;\n v0 = p0[(u8)a0 * 28 + 22];\n v1 = ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20;\n ((struct Struct0 *)((u8)a0 * 28 + (u32)&gEntity))->field_20 = v1 + v0;\n if ((u16)(v1 + v0) != 136) {\n return;\n } else {\n p0[(u8)a0 * 28 + 15] = 28;\n p0[(u8)a0 * 28 + 16] = 0;\n return;\n }\n } else {\n return;\n }\n }\n }\n } else {\n p0[(u8)a0 * 28 + 15] = 28;\n p0[(u8)a0 * 28 + 16] = 0;\n return;\n }\n}\n","score":148,"maxScore":234,"compileErrors":null,"breakdown":{"insert":52,"delete":30,"replace":24,"opMismatch":5,"argMismatch":37},"quality":{"score":76,"lines":77,"gotos":0,"casts":50,"unkGlue":0,"rawMem":3,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EntityItemDrop(u8 arg0) {\n s32 temp_r3_2;\n s32 temp_r3_3;\n struct EntityBase *temp_r0;\n struct EntityBase *temp_r1_2;\n struct EntityBase *temp_r1_3;\n struct EntityBase *temp_r3;\n u16 temp_r0_2;\n u16 var_r0;\n u16 var_r0_2;\n u32 temp_r5;\n u8 temp_r1;\n u8 temp_r4;\n\n temp_r4 = arg0;\n temp_r5 = (u32) ((arg0 << 0x18) + 0xE4000000) >> 0x18;\n if (gGameFlagsPtr->unkA == 1) {\n temp_r0 = &gEntity.base[temp_r4];\n temp_r0->unk_F = 0x1C;\n temp_r0->unk_10 = 0;\n return;\n }\n temp_r3 = &gEntity.base[temp_r4];\n temp_r1 = temp_r3->unk_F;\n switch (temp_r1) { /* irregular */\n case 3:\n temp_r3->unk_F = 0;\n temp_r3->unk_14 = 0;\n temp_r3->unk_10 = 1;\n temp_r3->unkC = (u8) (-4 & temp_r3->unkC);\n if (((u32) (gEntity.unk204 << 0x1C) >> 0x1E) == 0) {\n var_r0 = gEntity.unk_1F8 + 0x10;\n } else {\n var_r0 = gEntity.unk_1F8 - 0x10;\n }\n temp_r3->unk_0 = var_r0;\n temp_r1_2 = &gEntity.base[temp_r4];\n temp_r1_2->unk_2 = gEntity.unk_1FA;\n temp_r3_2 = temp_r5 * 2;\n temp_r1_2->unk_8 = (s8) *(temp_r3_2 + &gItemDropParamTable);\n temp_r1_2->unk_9 = (s8) *(temp_r3_2 + &gItemDropParamTable.unk_0[0][1]);\n temp_r1_2->unk_16 = 4;\n return;\n case 4:\n temp_r3->unk_F = 0;\n temp_r3->unk_14 = 0;\n temp_r3->unk_10 = 1;\n temp_r3->unkC = (u8) (-4 & temp_r3->unkC);\n if (((u32) (gEntity.unk204 << 0x1C) >> 0x1E) == 0) {\n var_r0_2 = gEntity.unk_1F8 + 0x10;\n } else {\n var_r0_2 = gEntity.unk_1F8 - 0x10;\n }\n temp_r3->unk_0 = var_r0_2;\n temp_r1_3 = &gEntity.base[temp_r4];\n temp_r1_3->unk_2 = gEntity.unk_1FA;\n temp_r3_3 = temp_r5 * 2;\n temp_r1_3->unk_8 = (s8) *(temp_r3_3 + gItemDropParamTable.unk_A[0]);\n temp_r1_3->unk_9 = (s8) *(temp_r3_3 + &gItemDropParamTable.unk_A[0][1]);\n temp_r1_3->unk_16 = 2;\n return;\n case 0:\n temp_r3->unk_2 = 0x10C - ((s32) (temp_r3->unk_9 * gSineTable[temp_r3->unk_14]) >> 8);\n temp_r3->unk_0 += temp_r3->unk_8;\n temp_r0_2 = temp_r3->unk_14 + temp_r3->unk_16;\n temp_r3->unk_14 = temp_r0_2;\n if (temp_r0_2 == 0x88) {\n temp_r3->unk_F = 0x1C;\n temp_r3->unk_10 = 0;\n }\n return;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":72,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1114: request for member `unkA' in something not a structure or union","/c.c:1127: structure has no member named `unkC'","/c.c:1128: structure has no member named `unk204'","/c.c:1137: aggregate value used where an integer was expected","/c.c:1145: structure has no member named `unkC'"]},"gapSize":{"decompiler":"asmlift","score":148,"maxScore":234,"ratio":0.6324786324786325,"kinds":{"insert":52,"delete":30,"replace":24,"opMismatch":5,"argMismatch":37}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EntityItemDrop` — benchmark function kleod:EntityItemDrop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\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-d4ba501e6cbc.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EntityItemDrop(u8 arg0);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EntityItemDrop # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EntityItemDrop` — benchmark function kleod:EntityItemDrop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:EntityItemDrop:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEntityItemDrop\n\t.type\t EntityItemDrop,function\n\t.thumb_func\nEntityItemDrop:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tmov\tr1, #0xe4\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L18\n\tldrb\tr0, [r0, #0xa]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldr\tr1, .L18+0x4\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr2, #0x0\n\tmov\tr1, #0x1c\n\tstrb\tr1, [r0, #0xf]\n\tstrb\tr2, [r0, #0x10]\n\tb\t.L2\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntity\n.L3:\n\tldr\tr0, .L20\n\tlsl\tr2, r4, #0x3\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr3, r1, r0\n\tldrb\tr1, [r3, #0xf]\n\tmov\tip, r0\n\tcmp\tr1, #0x3\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0x3\n\tbgt\t.L15\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L11\t@cond_branch\n\tb\t.L2\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgEntity\n.L15:\n\tcmp\tr1, #0x4\n\tbeq\t.L8\t@cond_branch\n\tb\t.L2\n.L5:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L16\n.L6:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L16:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L22\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgItemDropParamTable\n.L8:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0xf]\n\tstrh\tr0, [r3, #0x14]\n\tmov\tr0, #0x1\n\tstrb\tr0, [r3, #0x10]\n\tldrb\tr1, [r3, #0xc]\n\tsub\tr0, r0, #0x5\n\tand\tr0, r0, r1\n\tstrb\tr0, [r3, #0xc]\n\tmov\tr0, #0x81\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, ip\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1e\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tadd\tr0, r0, #0x10\n\tb\t.L17\n.L9:\n\tmov\tr0, #0xfc\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tsub\tr0, r0, #0x10\n.L17:\n\tstrh\tr0, [r3]\n\tsub\tr1, r2, r4\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, ip\n\tmov\tr0, #0xfd\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1, #0x2]\n\tldr\tr2, .L24\n\tlsl\tr3, r5, #0x1\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xa\n\tadd\tr0, r3, r0\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1, #0x8]\n\tadd\tr2, r2, #0xb\n\tadd\tr3, r3, r2\n\tldrb\tr0, [r3]\n\tstrb\tr0, [r1, #0x9]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1, #0x16]\n\tb\t.L2\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgItemDropParamTable\n.L11:\n\tmov\tr2, #0x9\n\tldrsb\tr2, [r3, r2]\n\tldr\tr1, .L26\n\tldrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r1\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r0, r1]\n\tmov\tr1, r2\n\tmul\tr1, r1, r0\n\tasr\tr1, r1, #0x8\n\tmov\tr2, #0x86\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, #0\n\tsub\tr0, r0, r1\n\tstrh\tr0, [r3, #0x2]\n\tmov\tr0, #0x8\n\tldrsb\tr0, [r3, r0]\n\tldrh\tr1, [r3]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrb\tr1, [r3, #0x16]\n\tldrh\tr0, [r3, #0x14]\n\tadd\tr0, r0, r1\n\tstrh\tr0, [r3, #0x14]\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x88\n\tbne\t.L2\t@cond_branch\n\tmov\tr0, #0x1c\n\tstrb\tr0, [r3, #0xf]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r3, #0x10]\n.L2:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSineTable\n.Lfe1:\n\t.size\t EntityItemDrop,.Lfe1-EntityItemDrop\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 \"EntityItemDrop\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EntityItemDrop # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","branch","call"],"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-MUXcew/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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":"gPauseFlag","shape":"scalar u8"}],"outcome":"nonmatch","source":"void GameUpdate(void) {\n s32 v0;\n v0 = gPauseFlag;\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","memory","pointer","shift","bitwise","mmio","strength-reduce"],"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"},{"name":"REG_DISPSTAT","shape":"scalar u16"},{"name":"REG_IE","shape":"scalar u16"}],"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 REG_IE = REG_IE | 2;\n REG_DISPSTAT = REG_DISPSTAT | 16;\n if ((u32)((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n REG_IE = 65533 & REG_IE;\n REG_DISPSTAT = 65519 & REG_DISPSTAT;\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":100,"lines":19,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ProcessInputAndUpdateEntities:agbcc","sym":"ProcessInputAndUpdateEntities","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","switch","loop","nested-loop","shift","bitwise","call","mmio","dma","jump-table","strength-reduce"],"loc":136,"refSource":"void ProcessInputAndUpdateEntities(void) {\n u8 sp4;\n u32 var_r1;\n u8 var_r4;\n u8 var_r5;\n\n sp4 = (gNewKeys & (START_BUTTON | B_BUTTON)) != 0;\n if (gNewKeys & A_BUTTON) {\n sp4 = gUnk_03004658[0xC] + 1;\n }\n\n if (gNewKeys & (DPAD_DOWN | DPAD_UP)) {\n for (var_r5 = 0; var_r5 < 2; var_r5++) {\n DmaFill16(3, 0, &gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5], 0x4);\n DmaFill16(3, 0, &gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7], 0x4);\n }\n\n if ((gUnk_030034C0 == 0) || (gUnk_030034C0 == 2)) {\n if (gNewKeys & DPAD_DOWN) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] += 1;\n if (gUnk_03004658[0xC] > 3) {\n gUnk_03004658[0xC] = 0;\n }\n }\n\n if (gNewKeys & DPAD_UP) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] -= 1;\n if (gUnk_03004658[0xC] & 0x80) {\n gUnk_03004658[0xC] = 3;\n }\n }\n } else {\n if (gNewKeys & DPAD_DOWN) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] += 1;\n if (gUnk_03004658[0xC] > 2) {\n gUnk_03004658[0xC] = 0;\n }\n }\n\n if (gNewKeys & DPAD_UP) {\n m4aSongNumStart(0x51);\n gUnk_03004658[0xC] -= 1;\n if (gUnk_03004658[0xC] & 0x80) {\n gUnk_03004658[0xC] = 2;\n }\n }\n }\n\n for (var_r5 = 0; var_r5 < 2; var_r5++) {\n for (var_r4 = 0; var_r4 < 2; var_r4++) {\n if (gUnk_030034BC == 0) {\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0x9D + var_r4] + gUnk_03000800;\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0xAF + var_r4] + gUnk_03000800;\n } else {\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xA5 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0x9D + var_r4];\n gBgTilemapBufs[gUnk_030034BC][((var_r5 + (gUnk_03004658[0xC] * 3)) << 5) + 0xB7 + var_r4]\n = gBgDataPtrs.pBufBg3Tilemap[(var_r5 * 0x1E) + 0xAF + var_r4];\n }\n }\n }\n }\n\n if (sp4 > 0) {\n sp4 = gUnk_081166F8[gUnk_030034C0][sp4 - 1];\n }\n\n switch (sp4 - 1) {\n case 0:\n gCallbackQueue.next[0] = ReadKeyInput;\n for (var_r1 = 0; var_r1 < 10; var_r1++) {\n gCallbackQueue.next[var_r1] = gCallbackQueue.previous[var_r1];\n }\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = gCallbackQueue.previousCount;\n\n UpdateOamSortOrder();\n m4aSoundVSyncOn();\n m4aMPlayAllContinue();\n break;\n\n case 1:\n UpdateOamSortOrder();\n gCallbackQueue.current[1] = TransitionFadeOutFull;\n gUnk_03005220.unk4 = gUnk_03005284->unk18;\n gUnk_03005220.lives = gUnk_03005284->unk0;\n gUnk_03005220.hearts = gUnk_03005284->unk8_0;\n REG_BLDCNT = 0;\n gBlendValue = 0;\n break;\n\n case 2:\n gUnk_03005284->unk0 = gUnk_03005220.lives = gUnk_03005284->unk1E;\n UpdateOamSortOrder();\n gBlendValue = 0;\n if (gUnk_03004C20.world == 6 && gUnk_03004C20.level == 8) {\n gUnk_03004C20.world = 5;\n }\n gUnk_030034B0.unk6_4 = gUnk_03004C20.level;\n gUnk_03004C20.level = 0;\n gCallbackQueue.current[1] = TransitionGameOver;\n break;\n\n case 3:\n gCallbackQueue.current[1] = SetupBG3WindowOverlay;\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tilemap);\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tiles);\n break;\n\n case 4:\n if (gUnk_03004C20.level != 0) {\n gUnk_03005284->unk0 = gUnk_03005220.lives = gUnk_03005284->unk1E;\n }\n UpdateOamSortOrder();\n REG_BLDCNT = 0;\n gBlendValue = 0;\n FreeAllDecompBuffers();\n gCallbackQueue.current[1] = TransitionToGameplayScreen;\n break;\n\n case 5:\n gBlendValue = 0;\n gUnk_03004C20.level = 9;\n gUnk_03004D9C = 0;\n InitOamEntries();\n gCallbackQueue.current[1] = TransitionSoftReset;\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tilemap);\n thunk_HeapFree(gBgDataPtrs.pBufBg3Tiles);\n break;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1495-L1630","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\n\n.text\n\t.align\t2, 0\n","proto":{"ProcessInputAndUpdateEntities":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ProcessInputAndUpdateEntities' — lift: cannot lift 'ProcessInputAndUpdateEntities': 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\tProcessInputAndUpdateEntities */\n/* \t.type\t ProcessInputAndUpdateEntities,function */\n/* \t.thumb_func */\n/* ProcessInputAndUpdateEntities: */\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, #-0xc */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr2, [r0] */\n/* \tmov\tr1, #0xa */\n/* \tand\tr1, r1, r2 */\n/* \tneg\tr0, r1 */\n/* \torr\tr0, r0, r1 */\n/* \tlsr\tr0, r0, #0x1f */\n/* \tstr\tr0, [sp, #0x4] */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldr\tr0, .L54+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tldrb\tr0, [r0, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tstr\tr0, [sp, #0x4] */\n/* .L5: */\n/* \tmov\tr0, #0xc0 */\n/* \tand\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB39 */\n/* \tb\t.L6\t@long jump */\n/* .LCB39: */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr3, .L54+0x4 */\n/* \tldr\tr0, .L54+0x8 */\n/* \tldr\tr1, .L54+0xc */\n/* \tmov\tr9, r1 */\n/* \tmov\tr4, sp */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr2, .L54+0x10 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0xb */\n/* \tldr\tr0, .L54+0x14 */\n/* \tadd\tr6, r1, r0 */\n/* \tmov\tip, r6 */\n/* \tadd\tr0, r0, #0x24 */\n/* \tadd\tr1, r1, r0 */\n/* \tmov\tr8, r1 */\n/* \tldr\tr3, [r3] */\n/* \tldr\tr6, .L54+0x18 */\n/* .L10: */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r2] */\n/* \tldrb\tr1, [r3, #0xc] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r5, r0 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tadd\tr0, r0, ip */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr1, sp */\n/* \tstr\tr1, [r2] */\n/* \tldrb\tr1, [r3, #0xc] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tadd\tr0, r5, r0 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tadd\tr0, r0, r8 */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tadd\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1 */\n/* \tbls\t.L10\t@cond_branch */\n/* \tmov\tr2, r9 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tcmp\tr0, #0x2 */\n/* \tbne\t.L12\t@cond_branch */\n/* .L13: */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L54+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr0, [r2, #0xc] */\n/* \tcmp\tr0, #0x3 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L14: */\n/* \tldr\tr0, .L54 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x40 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L54+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr1, [r2, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x3 */\n/* \tb\t.L52 */\n/* .L55: */\n/* \t.align\t2, 0 */\n/* .L54: */\n/* \t.word\tgNewKeys */\n/* \t.word\tgUnk_03004658 */\n/* \t.word\tgUnk_030034BC */\n/* \t.word\tgUnk_030034C0 */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgBgTilemapBufs+0x14a */\n/* \t.word\t-0x7efffffe */\n/* .L12: */\n/* \tldr\tr0, .L56 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L56+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr0, [r2, #0xc] */\n/* \tcmp\tr0, #0x2 */\n/* \tbls\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L19: */\n/* \tldr\tr0, .L56 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x40 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x51 */\n/* \tbl\tm4aSongNumStart */\n/* \tldr\tr2, .L56+0x4 */\n/* \tldr\tr1, [r2] */\n/* \tldrb\tr0, [r1, #0xc] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr2, [r2] */\n/* \tldrb\tr1, [r2, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tmov\tr0, #0x2 */\n/* .L52: */\n/* \tstrb\tr0, [r2, #0xc] */\n/* .L18: */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr3, .L56+0x8 */\n/* \tmov\tr8, r3 */\n/* \tldr\tr6, .L56+0xc */\n/* \tmov\tip, r6 */\n/* \tldr\tr7, .L56+0x4 */\n/* \tmov\tsl, r7 */\n/* .L26: */\n/* \tmov\tr4, #0x0 */\n/* \tadd\tr0, r5, #0x1 */\n/* \tmov\tr9, r0 */\n/* \tlsl\tr0, r5, #0x4 */\n/* \tsub\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tstr\tr0, [sp, #0x8] */\n/* .L30: */\n/* \tmov\tr1, r8 */\n/* \tldrb\tr0, [r1] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L31\t@cond_branch */\n/* \tmov\tr2, sl */\n/* \tldr\tr3, [r2] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xa5 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr6, r8 */\n/* \tldrb\tr0, [r6] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr7, .L56+0x10 */\n/* \tldr\tr0, [r7, #0x1c] */\n/* \tldr\tr6, [sp, #0x8] */\n/* \tadd\tr2, r6, r4 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r2, r0 */\n/* \tmov\tr7, #0x9d */\n/* \tlsl\tr7, r7, #0x1 */\n/* \tadd\tr0, r0, r7 */\n/* \tldrh\tr0, [r0] */\n/* \tldr\tr6, .L56+0x14 */\n/* \tldrb\tr6, [r6] */\n/* \tadd\tr0, r0, r6 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xb7 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr7, r8 */\n/* \tldrb\tr0, [r7] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr3, .L56+0x10 */\n/* \tldr\tr0, [r3, #0x1c] */\n/* \tadd\tr2, r2, r0 */\n/* \tmov\tr6, #0xaf */\n/* \tlsl\tr6, r6, #0x1 */\n/* \tadd\tr0, r2, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tldr\tr7, .L56+0x14 */\n/* \tldrb\tr7, [r7] */\n/* \tadd\tr0, r0, r7 */\n/* \tb\t.L53 */\n/* .L57: */\n/* \t.align\t2, 0 */\n/* .L56: */\n/* \t.word\tgNewKeys */\n/* \t.word\tgUnk_03004658 */\n/* \t.word\tgUnk_030034BC */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgUnk_03000800 */\n/* .L31: */\n/* \tmov\tr0, sl */\n/* \tldr\tr3, [r0] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xa5 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr2, r8 */\n/* \tldrb\tr0, [r2] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr6, .L58 */\n/* \tldr\tr0, [r6, #0x1c] */\n/* \tldr\tr7, [sp, #0x8] */\n/* \tadd\tr2, r7, r4 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r2, r0 */\n/* \tmov\tr6, #0x9d */\n/* \tlsl\tr6, r6, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r3, #0xc] */\n/* \tlsl\tr1, r0, #0x1 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r5, r1 */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xb7 */\n/* \tadd\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr7, r8 */\n/* \tldrb\tr0, [r7] */\n/* \tlsl\tr0, r0, #0xb */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, ip */\n/* \tldr\tr3, .L58 */\n/* \tldr\tr0, [r3, #0x1c] */\n/* \tadd\tr2, r2, r0 */\n/* \tadd\tr6, r6, #0x24 */\n/* \tadd\tr0, r2, r6 */\n/* \tldrh\tr0, [r0] */\n/* .L53: */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr0, r4, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tcmp\tr4, #0x1 */\n/* \tbls\t.L30\t@cond_branch */\n/* \tmov\tr7, r9 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1 */\n/* \tbhi\t.LCB418 */\n/* \tb\t.L26\t@long jump */\n/* .LCB418: */\n/* .L6: */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L35\t@cond_branch */\n/* \tldr\tr1, .L58+0x4 */\n/* \tldr\tr0, .L58+0x8 */\n/* \tldrb\tr0, [r0] */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tsub\tr0, r0, #0x1 */\n/* \tldr\tr2, [sp, #0x4] */\n/* \tadd\tr0, r2, r0 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tstr\tr0, [sp, #0x4] */\n/* .L35: */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tcmp\tr0, #0x5 */\n/* \tbls\t.LCB440 */\n/* \tb\t.L36\t@long jump */\n/* .LCB440: */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tldr\tr1, .L58+0xc */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L59: */\n/* \t.align\t2, 0 */\n/* .L58: */\n/* \t.word\tgBgDataPtrs */\n/* \t.word\tgUnk_081166F8 */\n/* \t.word\tgUnk_030034C0 */\n/* \t.word\t.L50 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L50: */\n/* \t.word\t.L37 */\n/* \t.word\t.L43 */\n/* \t.word\t.L44 */\n/* \t.word\t.L46 */\n/* \t.word\t.L47 */\n/* \t.word\t.L49 */\n/* .L37: */\n/* \tldr\tr2, .L60 */\n/* \tldr\tr0, .L60+0x4 */\n/* \tstr\tr0, [r2, #0x28] */\n/* \tmov\tr1, #0x0 */\n/* \tadd\tr3, r2, #0 */\n/* \tadd\tr3, r3, #0x28 */\n/* .L41: */\n/* \tldr\tr0, [r3, #0x28] */\n/* \tstmia\tr3!, {r0} */\n/* \tadd\tr1, r1, #0x1 */\n/* \tcmp\tr1, #0x9 */\n/* \tbls\t.L41\t@cond_branch */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x78 */\n/* \tldrb\tr0, [r0] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tmov\tr1, #0x0 */\n/* \tstr\tr1, [r0] */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x7a */\n/* \tldrb\tr1, [r0] */\n/* \tsub\tr0, r0, #0x1 */\n/* \tstrb\tr1, [r0] */\n/* \tbl\tUpdateOamSortOrder */\n/* \tbl\tm4aSoundVSyncOn */\n/* \tbl\tm4aMPlayAllContinue */\n/* \tb\t.L36 */\n/* .L61: */\n/* \t.align\t2, 0 */\n/* .L60: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tReadKeyInput */\n/* .L43: */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr1, .L62 */\n/* \tldr\tr0, .L62+0x4 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr3, .L62+0x8 */\n/* \tldr\tr0, .L62+0xc */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, [r1, #0x18] */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tldrb\tr2, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x4c */\n/* \tmov\tr4, #0x0 */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr1, [r1, #0x8] */\n/* \tlsl\tr1, r1, #0x1e */\n/* \tlsr\tr1, r1, #0x1e */\n/* \tldrb\tr2, [r3] */\n/* \tmov\tr0, #0x4 */\n/* \tneg\tr0, r0 */\n/* \tand\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r3] */\n/* \tldr\tr0, .L62+0x10 */\n/* \tmov\tr1, #0x0 */\n/* \tstrh\tr4, [r0] */\n/* \tldr\tr0, .L62+0x14 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L36 */\n/* .L63: */\n/* \t.align\t2, 0 */\n/* .L62: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionFadeOutFull */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\t0x4000050 */\n/* \t.word\tgBlendValue */\n/* .L44: */\n/* \tldr\tr0, .L64 */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, .L64+0x4 */\n/* \tldrb\tr2, [r1, #0x1e] */\n/* \tadd\tr0, r0, #0x4c */\n/* \tmov\tr5, #0x0 */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr0, [r1, #0x1e] */\n/* \tstrb\tr0, [r1] */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr0, .L64+0x8 */\n/* \tstrb\tr5, [r0] */\n/* \tldr\tr4, .L64+0xc */\n/* \tldrh\tr1, [r4, #0xc] */\n/* \tmov\tr0, #0xc1 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tcmp\tr1, r0 */\n/* \tbne\t.L45\t@cond_branch */\n/* \tmov\tr0, #0x5 */\n/* \tstrb\tr0, [r4, #0xd] */\n/* .L45: */\n/* \tldr\tr3, .L64+0x10 */\n/* \tldrb\tr1, [r4, #0xc] */\n/* \tlsl\tr1, r1, #0x4 */\n/* \tldrb\tr2, [r3, #0x6] */\n/* \tmov\tr0, #0xf */\n/* \tand\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tstrb\tr0, [r3, #0x6] */\n/* \tstrb\tr5, [r4, #0xc] */\n/* \tldr\tr1, .L64+0x14 */\n/* \tldr\tr0, .L64+0x18 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tb\t.L36 */\n/* .L65: */\n/* \t.align\t2, 0 */\n/* .L64: */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgBlendValue */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_030034B0 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionGameOver */\n/* .L46: */\n/* \tldr\tr1, .L66 */\n/* \tldr\tr0, .L66+0x4 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr4, .L66+0x8 */\n/* \tldr\tr0, [r4, #0x1c] */\n/* \tbl\tthunk_HeapFree */\n/* \tldr\tr0, [r4, #0x18] */\n/* \tbl\tthunk_HeapFree */\n/* \tb\t.L36 */\n/* .L67: */\n/* \t.align\t2, 0 */\n/* .L66: */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tSetupBG3WindowOverlay */\n/* \t.word\tgBgDataPtrs */\n/* .L47: */\n/* \tldr\tr0, .L68 */\n/* \tldrb\tr0, [r0, #0xc] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L48\t@cond_branch */\n/* \tldr\tr0, .L68+0x4 */\n/* \tldr\tr1, [r0] */\n/* \tldr\tr0, .L68+0x8 */\n/* \tldrb\tr2, [r1, #0x1e] */\n/* \tadd\tr0, r0, #0x4c */\n/* \tstrb\tr2, [r0] */\n/* \tldrb\tr0, [r1, #0x1e] */\n/* \tstrb\tr0, [r1] */\n/* .L48: */\n/* \tbl\tUpdateOamSortOrder */\n/* \tldr\tr0, .L68+0xc */\n/* \tmov\tr1, #0x0 */\n/* \tstrh\tr1, [r0] */\n/* \tldr\tr0, .L68+0x10 */\n/* \tstrb\tr1, [r0] */\n/* \tbl\tFreeAllDecompBuffers */\n/* \tldr\tr1, .L68+0x14 */\n/* \tldr\tr0, .L68+0x18 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tb\t.L36 */\n/* .L69: */\n/* \t.align\t2, 0 */\n/* .L68: */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_03005284 */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\t0x4000050 */\n/* \t.word\tgBlendValue */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionToGameplayScreen */\n/* .L49: */\n/* \tldr\tr1, .L70 */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r1] */\n/* \tldr\tr1, .L70+0x4 */\n/* \tmov\tr2, #0x0 */\n/* \tmov\tr0, #0x9 */\n/* \tstrb\tr0, [r1, #0xc] */\n/* \tldr\tr0, .L70+0x8 */\n/* \tstrb\tr2, [r0] */\n/* \tbl\tInitOamEntries */\n/* \tldr\tr1, .L70+0xc */\n/* \tldr\tr0, .L70+0x10 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr4, .L70+0x14 */\n/* \tldr\tr0, [r4, #0x1c] */\n/* \tbl\tthunk_HeapFree */\n/* \tldr\tr0, [r4, #0x18] */\n/* \tbl\tthunk_HeapFree */\n/* .L36: */\n/* \tadd\tsp, sp, #0xc */\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/* .L71: */\n/* \t.align\t2, 0 */\n/* .L70: */\n/* \t.word\tgBlendValue */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgUnk_03004D9C */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tTransitionSoftReset */\n/* \t.word\tgBgDataPtrs */\n/* .Lfe1: */\n/* \t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ProcessInputAndUpdateEntities(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ProcessInputAndUpdateEntities': 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":595,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ProcessInputAndUpdateEntities': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? FreeAllDecompBuffers(); /* extern */\n? InitOamEntries(); /* extern */\n? UpdateOamSortOrder(); /* extern */\n? m4aMPlayAllContinue(); /* extern */\n? m4aSongNumStart(s32); /* extern */\n? m4aSoundVSyncOn(); /* extern */\n? thunk_HeapFree(s32); /* extern */\nextern ? ReadKeyInput;\nextern ? SetupBG3WindowOverlay;\nextern ? TransitionFadeOutFull;\nextern ? TransitionGameOver;\nextern ? TransitionSoftReset;\nextern ? TransitionToGameplayScreen;\nextern ? gBgDataPtrs;\nextern ? gBgTilemapBufs;\nextern s8 gBlendValue;\nextern ? gCallbackQueue;\nextern u16 gNewKeys;\nextern u8 gUnk_03000800;\nextern ? gUnk_030034B0;\nextern u8 gUnk_030034BC;\nextern u8 gUnk_030034C0;\nextern void *gUnk_03004658;\nextern ? gUnk_03004C20;\nextern s8 gUnk_03004D9C;\nextern ? gUnk_03005220;\nextern void *gUnk_03005284;\nextern ? gUnk_081166F8;\n\nvoid ProcessInputAndUpdateEntities(void) {\n s32 temp_r1;\n s32 temp_r1_2;\n s32 temp_r2;\n s32 temp_r2_2;\n s8 var_r0;\n u16 *var_r1;\n u16 var_r0_2;\n u32 temp_r0_2;\n u32 var_r1_2;\n u8 var_r4;\n u8 var_r5;\n u8 var_r5_2;\n void *temp_r0;\n void *var_r3;\n\n temp_r1 = 0xA & gNewKeys;\n unksp4 = (u32) ((0 - temp_r1) | temp_r1) >> 0x1F;\n if (1 & gNewKeys) {\n unksp4 = (s32) (u8) (gUnk_03004658->unkC + 1);\n }\n if (!(0xC0 & gNewKeys)) {\n\n } else {\n var_r5 = 0;\n temp_r1_2 = gUnk_030034BC << 0xB;\n temp_r0 = &gBgTilemapBufs + 0x14A;\n do {\n unksp0 = 0;\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (void *) (((var_r5 + (gUnk_03004658->unkC * 3)) << 6) + (temp_r1_2 + temp_r0));\n (void *)0x040000D4->unk8 = 0x81000002;\n unksp0 = 0;\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (void *) (((var_r5 + (gUnk_03004658->unkC * 3)) << 6) + (temp_r1_2 + (temp_r0 + 0x24)));\n (void *)0x040000D4->unk8 = 0x81000002;\n var_r5 += 1;\n } while ((u32) var_r5 <= 1U);\n if ((gUnk_030034C0 == 0) || (gUnk_030034C0 == 2)) {\n if (0x80 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC + 1);\n if ((u32) gUnk_03004658->unkC > 3U) {\n gUnk_03004658->unkC = 0U;\n }\n }\n if (0x40 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC - 1);\n if (0x80 & gUnk_03004658->unkC) {\n var_r0 = 3;\n goto block_20;\n }\n }\n } else {\n if (0x80 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC + 1);\n if ((u32) gUnk_03004658->unkC > 2U) {\n gUnk_03004658->unkC = 0U;\n }\n }\n if (0x40 & gNewKeys) {\n m4aSongNumStart(0x51);\n gUnk_03004658->unkC = (u8) (gUnk_03004658->unkC - 1);\n if (0x80 & gUnk_03004658->unkC) {\n var_r0 = 2;\nblock_20:\n gUnk_03004658->unkC = var_r0;\n }\n }\n }\n var_r5_2 = 0;\nloop_22:\n var_r4 = 0;\n unksp8 = var_r5_2 * 0x1E;\n do {\n if (gUnk_030034BC == 0) {\n temp_r2 = (unksp8 + var_r4) * 2;\n *(((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xA5)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs) = (temp_r2 + gBgDataPtrs.unk1C)->unk13A + gUnk_03000800;\n var_r1 = ((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xB7)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs;\n var_r0_2 = (temp_r2 + gBgDataPtrs.unk1C)->unk15E + gUnk_03000800;\n } else {\n temp_r2_2 = (unksp8 + var_r4) * 2;\n *(((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xA5)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs) = (temp_r2_2 + gBgDataPtrs.unk1C)->unk13A;\n var_r1 = ((((var_r5_2 + (gUnk_03004658->unkC * 3)) << 5) + (var_r4 + 0xB7)) * 2) + (gUnk_030034BC << 0xB) + &gBgTilemapBufs;\n var_r0_2 = (temp_r2_2 + gBgDataPtrs.unk1C)->unk15E;\n }\n *var_r1 = var_r0_2;\n var_r4 += 1;\n } while ((u32) var_r4 <= 1U);\n var_r5_2 += 1;\n if ((u32) var_r5_2 <= 1U) {\n goto loop_22;\n }\n }\n if (unksp4 != 0) {\n unksp4 = (s32) *(unksp4 + ((gUnk_030034C0 * 4) - 1) + &gUnk_081166F8);\n }\n temp_r0_2 = unksp4 - 1;\n switch (temp_r0_2) { /* irregular */\n case 0:\n gCallbackQueue.unk28 = &ReadKeyInput;\n var_r1_2 = 0;\n var_r3 = &gCallbackQueue + 0x28;\n do {\n var_r3->unk0 = (s32) var_r3->unk28;\n var_r3 += 4;\n var_r1_2 += 1;\n } while (var_r1_2 <= 9U);\n *(((gCallbackQueue.unk78 - 1) * 4) + &gCallbackQueue) = 0;\n *((&gCallbackQueue + 0x7A) - 1) = gCallbackQueue.unk7A;\n UpdateOamSortOrder();\n m4aSoundVSyncOn();\n m4aMPlayAllContinue();\n return;\n case 1:\n UpdateOamSortOrder();\n gCallbackQueue.unk4 = &TransitionFadeOutFull;\n gUnk_03005220.unk4 = (s32) gUnk_03005284->unk18;\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk0;\n gUnk_03005220.unk0 = (u8) ((-4 & gUnk_03005220.unk0) | ((u32) (gUnk_03005284->unk8 << 0x1E) >> 0x1E));\n *(s16 *)0x04000050 = 0;\n gBlendValue = 0;\n return;\n case 2:\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk1E;\n gUnk_03005284->unk0 = (u8) gUnk_03005284->unk1E;\n UpdateOamSortOrder();\n gBlendValue = 0;\n if (gUnk_03004C20.unkC == 0x608) {\n gUnk_03004C20.unkD = 5;\n }\n gUnk_030034B0.unk6 = (u8) ((0xF & gUnk_030034B0.unk6) | ((u8) gUnk_03004C20.unkC * 0x10));\n gUnk_03004C20.unkC = 0;\n gCallbackQueue.unk4 = &TransitionGameOver;\n return;\n case 3:\n gCallbackQueue.unk4 = &SetupBG3WindowOverlay;\n thunk_HeapFree(gBgDataPtrs.unk1C);\n thunk_HeapFree(gBgDataPtrs.unk18);\n return;\n case 4:\n if ((u8) gUnk_03004C20.unkC != 0) {\n gUnk_03005220.unk4C = (u8) gUnk_03005284->unk1E;\n gUnk_03005284->unk0 = (u8) gUnk_03005284->unk1E;\n }\n UpdateOamSortOrder();\n *(void *)0x04000050 = 0;\n gBlendValue = 0;\n FreeAllDecompBuffers();\n gCallbackQueue.unk4 = &TransitionToGameplayScreen;\n return;\n case 5:\n gBlendValue = 0;\n gUnk_03004C20.unkC = 9;\n gUnk_03004D9C = 0;\n InitOamEntries();\n gCallbackQueue.unk4 = &TransitionSoftReset;\n thunk_HeapFree(gBgDataPtrs.unk1C);\n thunk_HeapFree(gBgDataPtrs.unk18);\n return;\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":190,"gotos":2,"casts":36,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessInputAndUpdateEntities` — benchmark function kleod:ProcessInputAndUpdateEntities:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessInputAndUpdateEntities # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessInputAndUpdateEntities` — benchmark function kleod:ProcessInputAndUpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:ProcessInputAndUpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessInputAndUpdateEntities\n\t.type\t ProcessInputAndUpdateEntities,function\n\t.thumb_func\nProcessInputAndUpdateEntities:\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, #-0xc\n\tldr\tr0, .L54\n\tldrh\tr2, [r0]\n\tmov\tr1, #0xa\n\tand\tr1, r1, r2\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr0, r0, #0x1f\n\tstr\tr0, [sp, #0x4]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, .L54+0x4\n\tldr\tr0, [r0]\n\tldrb\tr0, [r0, #0xc]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tstr\tr0, [sp, #0x4]\n.L5:\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.LCB39\n\tb\t.L6\t@long jump\n.LCB39:\n\tmov\tr5, #0x0\n\tldr\tr3, .L54+0x4\n\tldr\tr0, .L54+0x8\n\tldr\tr1, .L54+0xc\n\tmov\tr9, r1\n\tmov\tr4, sp\n\tmov\tr7, #0x0\n\tldr\tr2, .L54+0x10\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0xb\n\tldr\tr0, .L54+0x14\n\tadd\tr6, r1, r0\n\tmov\tip, r6\n\tadd\tr0, r0, #0x24\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr3, [r3]\n\tldr\tr6, .L54+0x18\n.L10:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, ip\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tstrh\tr7, [r4]\n\tmov\tr1, sp\n\tstr\tr1, [r2]\n\tldrb\tr1, [r3, #0xc]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tadd\tr0, r5, r0\n\tlsl\tr0, r0, #0x6\n\tadd\tr0, r0, r8\n\tstr\tr0, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbls\t.L10\t@cond_branch\n\tmov\tr2, r9\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tcmp\tr0, #0x2\n\tbne\t.L12\t@cond_branch\n.L13:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L14\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x3\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L14:\n\tldr\tr0, .L54\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L54+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x3\n\tb\t.L52\n.L55:\n\t.align\t2, 0\n.L54:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_030034C0\n\t.word\t0x40000d4\n\t.word\tgBgTilemapBufs+0x14a\n\t.word\t-0x7efffffe\n.L12:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L19\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr0, [r2, #0xc]\n\tcmp\tr0, #0x2\n\tbls\t.L19\t@cond_branch\n\tmov\tr0, #0x0\n\tstrb\tr0, [r2, #0xc]\n.L19:\n\tldr\tr0, .L56\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x40\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x51\n\tbl\tm4aSongNumStart\n\tldr\tr2, .L56+0x4\n\tldr\tr1, [r2]\n\tldrb\tr0, [r1, #0xc]\n\tsub\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr2, [r2]\n\tldrb\tr1, [r2, #0xc]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tmov\tr0, #0x2\n.L52:\n\tstrb\tr0, [r2, #0xc]\n.L18:\n\tmov\tr5, #0x0\n\tldr\tr3, .L56+0x8\n\tmov\tr8, r3\n\tldr\tr6, .L56+0xc\n\tmov\tip, r6\n\tldr\tr7, .L56+0x4\n\tmov\tsl, r7\n.L26:\n\tmov\tr4, #0x0\n\tadd\tr0, r5, #0x1\n\tmov\tr9, r0\n\tlsl\tr0, r5, #0x4\n\tsub\tr0, r0, r5\n\tlsl\tr0, r0, #0x1\n\tstr\tr0, [sp, #0x8]\n.L30:\n\tmov\tr1, r8\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L31\t@cond_branch\n\tmov\tr2, sl\n\tldr\tr3, [r2]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr6, r8\n\tldrb\tr0, [r6]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr7, .L56+0x10\n\tldr\tr0, [r7, #0x1c]\n\tldr\tr6, [sp, #0x8]\n\tadd\tr2, r6, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr7, #0x9d\n\tlsl\tr7, r7, #0x1\n\tadd\tr0, r0, r7\n\tldrh\tr0, [r0]\n\tldr\tr6, .L56+0x14\n\tldrb\tr6, [r6]\n\tadd\tr0, r0, r6\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L56+0x10\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tmov\tr6, #0xaf\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n\tldr\tr7, .L56+0x14\n\tldrb\tr7, [r7]\n\tadd\tr0, r0, r7\n\tb\t.L53\n.L57:\n\t.align\t2, 0\n.L56:\n\t.word\tgNewKeys\n\t.word\tgUnk_03004658\n\t.word\tgUnk_030034BC\n\t.word\tgBgTilemapBufs\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_03000800\n.L31:\n\tmov\tr0, sl\n\tldr\tr3, [r0]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xa5\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, r8\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr6, .L58\n\tldr\tr0, [r6, #0x1c]\n\tldr\tr7, [sp, #0x8]\n\tadd\tr2, r7, r4\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r2, r0\n\tmov\tr6, #0x9d\n\tlsl\tr6, r6, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r3, #0xc]\n\tlsl\tr1, r0, #0x1\n\tadd\tr1, r1, r0\n\tadd\tr1, r5, r1\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xb7\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tmov\tr7, r8\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0xb\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, ip\n\tldr\tr3, .L58\n\tldr\tr0, [r3, #0x1c]\n\tadd\tr2, r2, r0\n\tadd\tr6, r6, #0x24\n\tadd\tr0, r2, r6\n\tldrh\tr0, [r0]\n.L53:\n\tstrh\tr0, [r1]\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x1\n\tbls\t.L30\t@cond_branch\n\tmov\tr7, r9\n\tlsl\tr0, r7, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1\n\tbhi\t.LCB418\n\tb\t.L26\t@long jump\n.LCB418:\n.L6:\n\tldr\tr0, [sp, #0x4]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tldr\tr1, .L58+0x4\n\tldr\tr0, .L58+0x8\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x2\n\tsub\tr0, r0, #0x1\n\tldr\tr2, [sp, #0x4]\n\tadd\tr0, r2, r0\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tstr\tr0, [sp, #0x4]\n.L35:\n\tldr\tr0, [sp, #0x4]\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x5\n\tbls\t.LCB440\n\tb\t.L36\t@long jump\n.LCB440:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L58+0xc\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L59:\n\t.align\t2, 0\n.L58:\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_081166F8\n\t.word\tgUnk_030034C0\n\t.word\t.L50\n\t.align\t2, 0\n\t.align\t2, 0\n.L50:\n\t.word\t.L37\n\t.word\t.L43\n\t.word\t.L44\n\t.word\t.L46\n\t.word\t.L47\n\t.word\t.L49\n.L37:\n\tldr\tr2, .L60\n\tldr\tr0, .L60+0x4\n\tstr\tr0, [r2, #0x28]\n\tmov\tr1, #0x0\n\tadd\tr3, r2, #0\n\tadd\tr3, r3, #0x28\n.L41:\n\tldr\tr0, [r3, #0x28]\n\tstmia\tr3!, {r0}\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, #0x9\n\tbls\t.L41\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r2\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x7a\n\tldrb\tr1, [r0]\n\tsub\tr0, r0, #0x1\n\tstrb\tr1, [r0]\n\tbl\tUpdateOamSortOrder\n\tbl\tm4aSoundVSyncOn\n\tbl\tm4aMPlayAllContinue\n\tb\t.L36\n.L61:\n\t.align\t2, 0\n.L60:\n\t.word\tgCallbackQueue\n\t.word\tReadKeyInput\n.L43:\n\tbl\tUpdateOamSortOrder\n\tldr\tr1, .L62\n\tldr\tr0, .L62+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr3, .L62+0x8\n\tldr\tr0, .L62+0xc\n\tldr\tr1, [r0]\n\tldr\tr0, [r1, #0x18]\n\tstr\tr0, [r3, #0x4]\n\tldrb\tr2, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x4c\n\tmov\tr4, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tlsl\tr1, r1, #0x1e\n\tlsr\tr1, r1, #0x1e\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x4\n\tneg\tr0, r0\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3]\n\tldr\tr0, .L62+0x10\n\tmov\tr1, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr0, .L62+0x14\n\tstrb\tr1, [r0]\n\tb\t.L36\n.L63:\n\t.align\t2, 0\n.L62:\n\t.word\tgCallbackQueue\n\t.word\tTransitionFadeOutFull\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03005284\n\t.word\t0x4000050\n\t.word\tgBlendValue\n.L44:\n\tldr\tr0, .L64\n\tldr\tr1, [r0]\n\tldr\tr0, .L64+0x4\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tmov\tr5, #0x0\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L64+0x8\n\tstrb\tr5, [r0]\n\tldr\tr4, .L64+0xc\n\tldrh\tr1, [r4, #0xc]\n\tmov\tr0, #0xc1\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbne\t.L45\t@cond_branch\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0xd]\n.L45:\n\tldr\tr3, .L64+0x10\n\tldrb\tr1, [r4, #0xc]\n\tlsl\tr1, r1, #0x4\n\tldrb\tr2, [r3, #0x6]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r2\n\torr\tr0, r0, r1\n\tstrb\tr0, [r3, #0x6]\n\tstrb\tr5, [r4, #0xc]\n\tldr\tr1, .L64+0x14\n\tldr\tr0, .L64+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L65:\n\t.align\t2, 0\n.L64:\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_030034B0\n\t.word\tgCallbackQueue\n\t.word\tTransitionGameOver\n.L46:\n\tldr\tr1, .L66\n\tldr\tr0, .L66+0x4\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L66+0x8\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n\tb\t.L36\n.L67:\n\t.align\t2, 0\n.L66:\n\t.word\tgCallbackQueue\n\t.word\tSetupBG3WindowOverlay\n\t.word\tgBgDataPtrs\n.L47:\n\tldr\tr0, .L68\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0\n\tbeq\t.L48\t@cond_branch\n\tldr\tr0, .L68+0x4\n\tldr\tr1, [r0]\n\tldr\tr0, .L68+0x8\n\tldrb\tr2, [r1, #0x1e]\n\tadd\tr0, r0, #0x4c\n\tstrb\tr2, [r0]\n\tldrb\tr0, [r1, #0x1e]\n\tstrb\tr0, [r1]\n.L48:\n\tbl\tUpdateOamSortOrder\n\tldr\tr0, .L68+0xc\n\tmov\tr1, #0x0\n\tstrh\tr1, [r0]\n\tldr\tr0, .L68+0x10\n\tstrb\tr1, [r0]\n\tbl\tFreeAllDecompBuffers\n\tldr\tr1, .L68+0x14\n\tldr\tr0, .L68+0x18\n\tstr\tr0, [r1, #0x4]\n\tb\t.L36\n.L69:\n\t.align\t2, 0\n.L68:\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03005284\n\t.word\tgUnk_03005220\n\t.word\t0x4000050\n\t.word\tgBlendValue\n\t.word\tgCallbackQueue\n\t.word\tTransitionToGameplayScreen\n.L49:\n\tldr\tr1, .L70\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tldr\tr1, .L70+0x4\n\tmov\tr2, #0x0\n\tmov\tr0, #0x9\n\tstrb\tr0, [r1, #0xc]\n\tldr\tr0, .L70+0x8\n\tstrb\tr2, [r0]\n\tbl\tInitOamEntries\n\tldr\tr1, .L70+0xc\n\tldr\tr0, .L70+0x10\n\tstr\tr0, [r1, #0x4]\n\tldr\tr4, .L70+0x14\n\tldr\tr0, [r4, #0x1c]\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x18]\n\tbl\tthunk_HeapFree\n.L36:\n\tadd\tsp, sp, #0xc\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.L71:\n\t.align\t2, 0\n.L70:\n\t.word\tgBlendValue\n\t.word\tgUnk_03004C20\n\t.word\tgUnk_03004D9C\n\t.word\tgCallbackQueue\n\t.word\tTransitionSoftReset\n\t.word\tgBgDataPtrs\n.Lfe1:\n\t.size\t ProcessInputAndUpdateEntities,.Lfe1-ProcessInputAndUpdateEntities\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 \"ProcessInputAndUpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessInputAndUpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","branch","bitwise","call","mmio"],"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"},{"name":"REG_KEYINPUT","shape":"scalar u16"}],"outcome":"nonmatch","source":"void ReadKeyInput(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = REG_KEYINPUT;\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 gAButtonHold = gAButtonHold + 1;\n }\n return;\n}\n","score":42,"maxScore":58,"compileErrors":null,"breakdown":{"insert":17,"delete":11,"replace":3,"opMismatch":1,"argMismatch":10},"quality":{"score":100,"lines":17,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","memory","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","memory","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","global","bitwise","call"],"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-iHbWd3/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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetupBG3WindowOverlay:agbcc","sym":"SetupBG3WindowOverlay","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","memory","loop","shift","bitwise","soft-div","call","mmio","dma"],"loc":56,"refSource":"void SetupBG3WindowOverlay(void) {\n s32 var_r5;\n s32 var_r6;\n s32 var_r7;\n\n if (gUnk_030034BC == 0) {\n var_r7 = gUnk_03000800;\n } else {\n var_r7 = 0;\n }\n\n REG_IE &= ~INTR_FLAG_VBLANK;\n REG_DISPSTAT &= ~DISPSTAT_VBLANK_INTR;\n m4aSoundVSyncOff();\n\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & 0x7FFFFFFF, 0);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & 0x7FFFFFFF, 0);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n\n for (var_r5 = 0, var_r6 = 0; var_r5 < 0x21C; var_r6++, var_r5++) {\n if (((var_r5 % 30) == 0) && (var_r5 != 0)) {\n var_r6 += 2;\n }\n gBgTilemapBufs[gUnk_030034BC][var_r6] = gBgDataPtrs.pBufBg3Tilemap[var_r5 + 2] + var_r7;\n }\n\n REG_WIN1H = WIN_RANGE(0, 0xF0);\n REG_WIN1V = WIN_RANGE(0x1E, 0x90);\n\n if (gUnk_030034BC == 0) {\n REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_CLR | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;\n } else {\n REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;\n }\n\n if (gUnk_03004C20.level == 8) {\n gCallbackQueue.next[2] = AnimatePaletteEffects;\n } else {\n gCallbackQueue.next[2] = VBlankCallback_Gameplay;\n }\n gCallbackQueue.next[0] = ReadKeyInput;\n gCallbackQueue.next[1] = UpdateWorldMapInput;\n gCallbackQueue.next[3] = NULL + 1;\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = 4;\n\n DmaCopy16(3, gBgDataPtrs.pBufBg3Tiles + 4, gBgInfo[gUnk_030034BC].pTiles + (var_r7 << 5), 0xB80);\n\n REG_DISPCNT |= DISPCNT_WIN1_ON;\n REG_IE |= INTR_FLAG_VBLANK;\n REG_DISPSTAT |= DISPSTAT_VBLANK_INTR;\n m4aSoundVSyncOn();\n\n gUnk_03004C20.sceneFrameCounter = 0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1635-L1690","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-13fbdb507b65.i.gz","proto":{"SetupBG3WindowOverlay":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Elem0 { s32 field_0; u8 _pad0[24]; };\nstruct Struct0 { s32 field_0; u8 _pad0[8]; u8 field_12; };\nvoid SetupBG3WindowOverlay(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * v7;\n s32 v8;\n s32 v9;\n u16 * p0;\n s32 * p1;\n s32 * p2;\n p0 = (u16 *)®_WIN1H;\n p1 = (s32 *)&gCallbackQueue;\n p2 = (s32 *)®_DMA3SAD;\n if (gUnk_030034BC != 0) {\n v6 = 0;\n } else {\n v6 = gUnk_03000800;\n }\n REG_IE = 65534 & REG_IE;\n v0 = REG_DISPSTAT;\n REG_DISPSTAT = 65527 & v0;\n m4aSoundVSyncOff(65527 & v0, v0, ®_DISPSTAT);\n v1 = 2147483647;\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & v1, 0, ®_DISPSTAT);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & v1, 0, ®_DISPSTAT);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n v4 = 0;\n v5 = 0;\n do {\n if (v4 % 30 == 0 && v4 != 0) v5 = v5 + 2;\n *(u16 *)((v5 << 1) + (gUnk_030034BC << 11) + (u32)&gBgTilemapBufs) = ((u16 *)((v4 << 1) + gBgDataPtrs.pBufBg3Tilemap))[2] + v6;\n v5 = v5 + 1;\n v4 = v4 + 1;\n } while (v4 <= 539);\n *p0 = 240;\n p0[2] = 7824;\n if (gUnk_030034BC != 0) {\n v7 = (u16 *)®_WININ;\n v8 = 13601;\n } else {\n v7 = (u16 *)((u32)®_WIN1H + 4 + 2);\n v8 = 13857;\n }\n *v7 = v8;\n if (gUnk_03004C20.level != 8) {\n v9 = &VBlankCallback_Gameplay;\n } else {\n v9 = &AnimatePaletteEffects;\n }\n p1[12] = v9;\n p1[10] = &ReadKeyInput;\n p1[11] = &UpdateWorldMapInput;\n p1[13] = 1;\n v2 = 0;\n p1[gCallbackQueue.currentCount - 1] = v2;\n gCallbackQueue.nextCount = 4;\n *p2 = gBgDataPtrs.pBufBg3Tiles + 4;\n p2[1] = ((struct Elem0 *)&gBgInfo)[gUnk_030034BC].field_0 + (v6 << 5);\n p2[2] = -2147482176;\n *(u16 *)((u32)®_DMA3SAD - 212) = *(u16 *)((u32)®_DMA3SAD - 212) | 128 << 7;\n REG_IE = REG_IE | 1;\n v3 = REG_DISPSTAT;\n REG_DISPSTAT = v3 | 8;\n m4aSoundVSyncOn(v3 | 8, 8, ®_DISPSTAT, 128 << 7);\n gUnk_03004C20.sceneFrameCounter = v2;\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":74,"gotos":0,"casts":9,"unkGlue":0,"rawMem":3,"addrDeref":0},"errorMarkers":["no scorable candidate for 'SetupBG3WindowOverlay': agbcc failed: /c.c:1455: too many arguments to function `m4aSoundVSyncOff'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? Decompress(void *, u32 *); /* extern */\nu16 *thunk_HeapAlloc(s32, s32); /* extern */\n\nvoid SetupBG3WindowOverlay(void) {\n s16 *var_r1;\n s16 var_r0;\n s32 var_r5;\n s32 var_r6;\n u8 var_r7;\n void (*var_r0_2)();\n\n if (gUnk_030034BC == 0) {\n var_r7 = gUnk_03000800;\n } else {\n var_r7 = 0;\n }\n *(u16 *)0x04000200 &= 0xFFFE;\n *(u16 *)0x04000004 &= 0xFFF7;\n m4aSoundVSyncOff();\n gBgDataPtrs.pBufBg3Tiles = thunk_HeapAlloc(gUnk_082EC8F4 & 0x7FFFFFFF, 0);\n gBgDataPtrs.pBufBg3Tilemap = thunk_HeapAlloc(gUnk_082ECD74 & 0x7FFFFFFF, 0);\n Decompress(gBgDataPtrs.pBufBg3Tiles, &gUnk_082EC8F4);\n Decompress(gBgDataPtrs.pBufBg3Tilemap, &gUnk_082ECD74);\n var_r5 = 0;\n var_r6 = 0;\n do {\n if (((var_r5 % 30) == 0) && (var_r5 != 0)) {\n var_r6 += 2;\n }\n *((var_r6 * 2) + (gUnk_030034BC << 0xB) + gBgTilemapBufs) = gBgDataPtrs.pBufBg3Tilemap[var_r5].unk4 + var_r7;\n var_r6 += 1;\n var_r5 += 1;\n } while (var_r5 <= 0x21B);\n (void *)0x04000042->unk0 = 0xF0;\n (void *)0x04000042->unk4 = 0x1E90;\n if (gUnk_030034BC == 0) {\n var_r1 = (void *)0x04000042 + 4 + 2;\n var_r0 = 0x3621;\n } else {\n var_r1 = (s16 *)0x04000048;\n var_r0 = 0x3521;\n }\n *var_r1 = var_r0;\n if (gUnk_03004C20.level == 8) {\n var_r0_2 = AnimatePaletteEffects;\n } else {\n var_r0_2 = VBlankCallback_Gameplay;\n }\n gCallbackQueue.next[2] = var_r0_2;\n gCallbackQueue.next[0] = ReadKeyInput;\n gCallbackQueue.next[1] = UpdateWorldMapInput;\n gCallbackQueue.next[3] = (void (*)())1;\n gCallbackQueue.current[gCallbackQueue.currentCount - 1] = NULL;\n gCallbackQueue.nextCount = 4;\n (void *)0x040000D4->unk0 = (void *) (gBgDataPtrs.pBufBg3Tiles + 4);\n (void *)0x040000D4->unk4 = (void *) (gBgInfo[gUnk_030034BC].pTiles + (var_r7 << 5));\n (void *)0x040000D4->unk8 = 0x800005C0;\n *(u16 *)0x04000000 |= 0x4000;\n *(void *)0x04000200 = (u16) (*(void *)0x04000200 | 1);\n *(void *)0x04000004 = (u16) (*(void *)0x04000004 | 8);\n m4aSoundVSyncOn();\n gUnk_03004C20.sceneFrameCounter = 0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":61,"gotos":0,"casts":19,"unkGlue":0,"rawMem":0,"addrDeref":7},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetupBG3WindowOverlay` — benchmark function kleod:SetupBG3WindowOverlay:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\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-13fbdb507b65.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid SetupBG3WindowOverlay(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetupBG3WindowOverlay # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBG3WindowOverlay` — benchmark function kleod:SetupBG3WindowOverlay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetupBG3WindowOverlay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBG3WindowOverlay\n\t.type\t SetupBG3WindowOverlay,function\n\t.thumb_func\nSetupBG3WindowOverlay:\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\tldr\tr0, .L18\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tldr\tr0, .L18+0x4\n\tldrb\tr7, [r0]\n\tb\t.L5\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgUnk_030034BC\n\t.word\tgUnk_03000800\n.L4:\n\tmov\tr7, #0x0\n.L5:\n\tldr\tr2, .L20\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L20+0x8\n\tldrh\tr1, [r2]\n\tldr\tr0, .L20+0xc\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOff\n\tldr\tr0, .L20+0x10\n\tmov\tr8, r0\n\tldr\tr0, [r0]\n\tldr\tr5, .L20+0x14\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tldr\tr4, .L20+0x18\n\tstr\tr0, [r4, #0x18]\n\tldr\tr6, .L20+0x1c\n\tldr\tr0, [r6]\n\tand\tr0, r0, r5\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tstr\tr0, [r4, #0x1c]\n\tldr\tr0, [r4, #0x18]\n\tmov\tr1, r8\n\tbl\tDecompress\n\tldr\tr0, [r4, #0x1c]\n\tadd\tr1, r6, #0\n\tbl\tDecompress\n\tmov\tr5, #0x0\n\tmov\tr6, #0x0\n\tlsl\tr1, r7, #0x5\n\tmov\tsl, r1\n\tldr\tr2, .L20+0x20\n\tmov\tr9, r2\n\tldr\tr3, .L20+0x24\n\tmov\tr8, r3\n.L9:\n\tadd\tr0, r5, #0\n\tmov\tr1, #0x1e\n\tbl\t__modsi3\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L10\t@cond_branch\n\tadd\tr6, r6, #0x2\n.L10:\n\tlsl\tr2, r6, #0x1\n\tldr\tr0, .L20+0x28\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0xb\n\tadd\tr2, r2, r0\n\tadd\tr2, r2, r9\n\tldr\tr0, .L20+0x18\n\tldr\tr1, [r0, #0x1c]\n\tlsl\tr0, r5, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr0, r0, r7\n\tstrh\tr0, [r2]\n\tadd\tr6, r6, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, r8\n\tble\t.L9\t@cond_branch\n\tldr\tr1, .L20+0x2c\n\tmov\tr0, #0xf0\n\tstrh\tr0, [r1]\n\tadd\tr1, r1, #0x4\n\tldr\tr2, .L20+0x30\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tldr\tr3, .L20+0x28\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbne\t.L12\t@cond_branch\n\tadd\tr1, r1, #0x2\n\tldr\tr2, .L20+0x34\n\tadd\tr0, r2, #0\n\tb\t.L16\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\t0x4000200\n\t.word\t0xfffe\n\t.word\t0x4000004\n\t.word\t0xfff7\n\t.word\tgUnk_082EC8F4\n\t.word\t0x7fffffff\n\t.word\tgBgDataPtrs\n\t.word\tgUnk_082ECD74\n\t.word\tgBgTilemapBufs\n\t.word\t0x21b\n\t.word\tgUnk_030034BC\n\t.word\t0x4000042\n\t.word\t0x1e90\n\t.word\t0x3621\n.L12:\n\tldr\tr1, .L22\n\tldr\tr3, .L22+0x4\n\tadd\tr0, r3, #0\n.L16:\n\tstrh\tr0, [r1]\n\tldr\tr0, .L22+0x8\n\tldrb\tr0, [r0, #0xc]\n\tcmp\tr0, #0x8\n\tbne\t.L14\t@cond_branch\n\tldr\tr1, .L22+0xc\n\tldr\tr0, .L22+0x10\n\tb\t.L17\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\t0x4000048\n\t.word\t0x3521\n\t.word\tgUnk_03004C20\n\t.word\tgCallbackQueue\n\t.word\tAnimatePaletteEffects\n.L14:\n\tldr\tr1, .L24\n\tldr\tr0, .L24+0x4\n.L17:\n\tstr\tr0, [r1, #0x30]\n\tldr\tr0, .L24+0x8\n\tstr\tr0, [r1, #0x28]\n\tldr\tr0, .L24+0xc\n\tstr\tr0, [r1, #0x2c]\n\tmov\tr0, #0x1\n\tstr\tr0, [r1, #0x34]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x78\n\tldrb\tr0, [r0]\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tmov\tr4, #0x0\n\tstr\tr4, [r0]\n\tadd\tr1, r1, #0x79\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n\tldr\tr2, .L24+0x10\n\tldr\tr1, .L24+0x14\n\tldr\tr0, [r1, #0x18]\n\tadd\tr0, r0, #0x4\n\tstr\tr0, [r2]\n\tldr\tr3, .L24+0x18\n\tldr\tr0, .L24+0x1c\n\tldrb\tr1, [r0]\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r3\n\tldr\tr0, [r0]\n\tadd\tr0, r0, sl\n\tstr\tr0, [r2, #0x4]\n\tldr\tr0, .L24+0x20\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr2, r2, #0xd4\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x80\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x24\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x1\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr2, .L24+0x28\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x8\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tbl\tm4aSoundVSyncOn\n\tldr\tr0, .L24+0x2c\n\tstr\tr4, [r0]\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.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgCallbackQueue\n\t.word\tVBlankCallback_Gameplay\n\t.word\tReadKeyInput\n\t.word\tUpdateWorldMapInput\n\t.word\t0x40000d4\n\t.word\tgBgDataPtrs\n\t.word\tgBgInfo\n\t.word\tgUnk_030034BC\n\t.word\t-0x7ffffa40\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\tgUnk_03004C20\n.Lfe1:\n\t.size\t SetupBG3WindowOverlay,.Lfe1-SetupBG3WindowOverlay\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 \"SetupBG3WindowOverlay\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBG3WindowOverlay # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","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":"match","source":"struct Elem0 { u8 _pad0[8]; u16 field_8; u16 field_10; u8 _pad1[16]; };\nvoid 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;\n}\n","score":0,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","shift","bitwise","mmio"],"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/raw-globals","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","arithmetic","switch","shift","bitwise","jump-table"],"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":"declined","source":"extern u16 gBg2XMag;\nextern u16 gBg2YMag;\nextern ? gUnk_03002920;\nextern ? gUnk_03003430;\nextern s32 gUnk_030051DC;\nextern ? gUnk_08078FC8;\n\nvoid TransformSingleEntityToScreen(u8 arg0, s8 arg1, s8 arg2) {\n s16 temp_r3;\n s16 temp_r5;\n s32 temp_r2;\n s32 temp_r7;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_4;\n s32 var_r1;\n u32 temp_r1;\n u8 temp_r0;\n void *temp_r0_2;\n void *temp_r4;\n void *var_r0_3;\n\n temp_r0 = arg0;\n temp_r7 = temp_r0 * 8;\n temp_r4 = (temp_r0 * 0x1C) + &gUnk_03002920;\n temp_r5 = (temp_r4->unk0 - arg1) - gUnk_03003430.unk40;\n temp_r4->unk4 = temp_r5;\n temp_r3 = (temp_r4->unk2 - arg2) - gUnk_03003430.unk42;\n temp_r4->unk6 = temp_r3;\n var_r0 = gBg2XMag * (s16) (gUnk_03003430.unk40 - temp_r5);\n if (var_r0 < 0) {\n var_r0 += 0xFF;\n }\n var_r0_2 = (s16) (u16) (gUnk_03003430.unk42 - temp_r3) * gBg2YMag;\n if (var_r0_2 < 0) {\n var_r0_2 += 0xFF;\n }\n temp_r2 = var_r0_2 >> 8;\n if ((u32) temp_r0 > 0xCU) {\n var_r0_3 = ((temp_r7 + gUnk_030051DC) - 0x68)->unk4;\n } else {\n var_r0_3 = *(temp_r7 + (&gUnk_08078FC8 + 4));\n }\n temp_r1 = 0xF & var_r0_3->unk5;\n switch (temp_r1) {\n case 3:\n case 11:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 3;\n break;\n case 1:\n case 6:\n case 8:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 5;\n break;\n case 0:\n case 4:\n case 5:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 6;\n break;\n default:\n var_r1 = gUnk_03003430.unk42 - temp_r2;\n var_r0_4 = (s32) (0x100 - gBg2YMag) >> 4;\n break;\n }\n temp_r0_2 = (temp_r0 * 0x1C) + &gUnk_03002920;\n temp_r0_2->unk4 = (s16) (gUnk_03003430.unk40 - (var_r0 >> 8));\n temp_r0_2->unk6 = (s16) (var_r1 + var_r0_4);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":84,"lines":69,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateCameraScroll:agbcc","sym":"UpdateCameraScroll","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","branch","global","shift","bitwise","call"],"loc":99,"refSource":"void UpdateCameraScroll(void) {\n s32 temp_r2;\n s32 temp_r3_2;\n u16 var_r8;\n struct ScrollBGLayer_Args var_r6;\n u8 var_r7;\n\n var_r8 = 0;\n var_r7 = 0;\n var_r6.unk2 = var_r6.unk0 = 0;\n\n if (!(gUnk_030051B8 & 0x30)) {\n if ((s16)gUnk_03002920[0].xPosBg2 > (s16)(gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) {\n var_r7 = 0x10;\n if ((gUnk_03002920[0].xPosBg2 - (gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) > 5) {\n var_r6.unk0 = 2;\n } else {\n var_r6.unk0 = 1;\n }\n if (gHeldKeys & DPAD_LEFT) {\n var_r7 = 0;\n var_r6.unk0 = 0;\n }\n } else if ((s16)gUnk_03002920[0].xPosBg2 < (s16)(gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER)) {\n var_r7 = 0x20;\n if (((gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER) - gUnk_03002920[0].xPosBg2) > 5) {\n var_r6.unk0 = -2;\n } else {\n var_r6.unk0 = -1;\n }\n if (gHeldKeys & DPAD_RIGHT) {\n var_r7 = 0;\n var_r6.unk0 = 0;\n }\n }\n }\n if (!(gUnk_030051B8 & 0xC0)) {\n if (gUnk_03002920[0].yPosScreen > 0xA0) {\n var_r8 = 0x44;\n }\n if ((u16)(var_r8 + gUnk_03002920[0].yPosScreen) > 0x63) {\n var_r7 |= 0x80;\n if ((u16)((var_r8 + gUnk_03002920[0].yPosScreen) - 0x64) > 0x1E) {\n var_r6.unk2 = 3;\n } else {\n var_r6.unk2 = 1;\n }\n } else if ((u16)(var_r8 + gUnk_03002920[0].yPosScreen) <= 0x46) {\n var_r7 |= 0x40;\n if ((u16)(var_r8 - (gUnk_03002920[0].yPosScreen - 0x46)) > 0x19U) {\n var_r6.unk2 = -3;\n } else {\n var_r6.unk2 = -1;\n }\n }\n }\n\n var_r7 |= gUnk_030051B8;\n temp_r3_2 = gUnk_03005480 + gUnk_030034E8.unk0;\n temp_r2 = gUnk_030007C0 + gUnk_030034E8.unk4;\n var_r6.unk0 += (temp_r3_2 >> 0x10);\n var_r6.unk2 += (temp_r2 >> 0x10);\n gUnk_03005480 = temp_r3_2 & 0xFFFF;\n gUnk_030007C0 = temp_r2 & 0xFFFF;\n\n if (gUnk_03005220.deathSequenceTimer != 0) {\n var_r7 &= 0x30;\n var_r6.unk2 = var_r6.unk0 = 0;\n }\n\n if (var_r7 != 0) {\n ScrollBGLayer(var_r7, var_r6);\n }\n\n gUnk_03003430.bg1HOfs = (gUnk_03003430.bg2HOfs >> 1);\n if (!(gUnk_03004C20.globalFrameCounter & 3) && (gUnk_03004660 == 0)) {\n if (gUnk_03003430.bg2VOfs >= gPrevBg2VOfs) {\n gUnk_03003430.bg1VOfs += ((gUnk_03003430.bg2VOfs - gPrevBg2VOfs) & 1);\n } else {\n gUnk_03003430.bg1VOfs -= ((gPrevBg2VOfs - gUnk_03003430.bg2VOfs) & 1);\n }\n\n if (gUnk_03003430.bg1VOfs & 0x8000) {\n gUnk_03003430.bg1VOfs = 0;\n } else if (gUnk_03003430.bg1VOfs > 0x50) {\n gUnk_03003430.bg1VOfs = 0x50;\n }\n }\n\n gPrevBg2VOfs = gUnk_03003430.bg2VOfs;\n gBg2PA = MultiplyQ8(COS(gBg2Alpha), ReciprocalQ8(gBg2XMag));\n gBg2PB = MultiplyQ8(SIN(gBg2Alpha), ReciprocalQ8(gBg2XMag));\n gBg2PC = MultiplyQ8(-SIN(gBg2Alpha), ReciprocalQ8(gBg2YMag));\n gBg2PD = MultiplyQ8(COS(gBg2Alpha), ReciprocalQ8(gBg2YMag));\n gBg2X\n = (((gUnk_03003430.bg2HOfs + DISPLAY_WIDTH_CENTER) << 8) - (gBg2PA * DISPLAY_WIDTH_CENTER)) - (gBg2PB * DISPLAY_HEIGHT_CENTER);\n gBg2Y = (((gUnk_03003430.bg2VOfs + DISPLAY_HEIGHT_CENTER) << 8) - (gBg2PC * DISPLAY_WIDTH_CENTER))\n - (gBg2PD * DISPLAY_HEIGHT_CENTER);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/engine.c#L571-L669","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-c68b94e46656.i.gz","proto":{"UpdateCameraScroll":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateCameraScroll' — lift: cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' 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\tUpdateCameraScroll */\n/* \t.type\t UpdateCameraScroll,function */\n/* \t.thumb_func */\n/* UpdateCameraScroll: */\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/* \tmov\tr0, #0x0 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr1, .L35 */\n/* \tmov\tsl, r1 */\n/* \tmov\tr6, #0x0 */\n/* \tldr\tr2, .L35+0x4 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x30 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldr\tr4, .L35+0x8 */\n/* \tldr\tr0, .L35+0xc */\n/* \tadd\tr3, r0, #0 */\n/* \tadd\tr3, r3, #0x40 */\n/* \tldrh\tr0, [r3] */\n/* \tmov\tr5, #0x78 */\n/* \tadd\tr5, r5, r0 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr1, [r4, r0] */\n/* \tlsl\tr5, r5, #0x10 */\n/* \tasr\tr0, r5, #0x10 */\n/* \tcmp\tr1, r0 */\n/* \tble\t.L4\t@cond_branch */\n/* \tmov\tr7, #0x10 */\n/* \tldrh\tr0, [r4] */\n/* \tsub\tr0, r0, #0x78 */\n/* \tldrh\tr1, [r3] */\n/* \tsub\tr0, r0, r1 */\n/* \tcmp\tr0, #0x5 */\n/* \tble\t.L5\t@cond_branch */\n/* \tmov\tr6, #0x2 */\n/* \tb\t.L6 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_030051B8 */\n/* \t.word\tgUnk_03002920 */\n/* \t.word\tgUnk_03003430 */\n/* .L5: */\n/* \tmov\tr1, sl */\n/* \tand\tr6, r6, r1 */\n/* \tmov\tr0, #0x1 */\n/* \torr\tr6, r6, r0 */\n/* .L6: */\n/* \tldr\tr0, .L37 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x20 */\n/* \tb\t.L30 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgHeldKeys */\n/* .L4: */\n/* \tcmp\tr1, r0 */\n/* \tbge\t.L3\t@cond_branch */\n/* \tmov\tr7, #0x20 */\n/* \tldrh\tr1, [r3] */\n/* \tldrh\tr0, [r4] */\n/* \tsub\tr0, r0, #0x78 */\n/* \tsub\tr1, r1, r0 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L10\t@cond_branch */\n/* \tmov\tr5, sl */\n/* \tand\tr6, r6, r5 */\n/* \tldr\tr0, .L39 */\n/* \tb\t.L31 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\t0xfffe */\n/* .L10: */\n/* \tldr\tr0, .L41 */\n/* .L31: */\n/* \torr\tr6, r6, r0 */\n/* \tldr\tr0, .L41+0x4 */\n/* \tldrh\tr1, [r0] */\n/* \tmov\tr0, #0x10 */\n/* .L30: */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tmov\tr7, #0x0 */\n/* \tldr\tr0, .L41+0x8 */\n/* \tand\tr6, r6, r0 */\n/* .L3: */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0xc0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L13\t@cond_branch */\n/* \tldr\tr0, .L41+0xc */\n/* \tldrh\tr1, [r0, #0x6] */\n/* \tcmp\tr1, #0xa0 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x44 */\n/* \tmov\tr8, r0 */\n/* .L14: */\n/* \tmov\tr5, r8 */\n/* \tadd\tr3, r5, r1 */\n/* \tlsl\tr0, r3, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x63 */\n/* \tbls\t.L15\t@cond_branch */\n/* \tmov\tr0, #0x80 */\n/* \torr\tr7, r7, r0 */\n/* \tadd\tr0, r3, #0 */\n/* \tsub\tr0, r0, #0x64 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x1e */\n/* \tbls\t.L16\t@cond_branch */\n/* \tldr\tr0, .L41 */\n/* \tand\tr6, r6, r0 */\n/* \tmov\tr0, #0xc0 */\n/* \tlsl\tr0, r0, #0xa */\n/* \tb\t.L32 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\t0xffff */\n/* \t.word\tgHeldKeys */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_03002920 */\n/* .L16: */\n/* \tldr\tr0, .L43 */\n/* \tand\tr6, r6, r0 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tb\t.L32 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\t0xffff */\n/* .L15: */\n/* \tcmp\tr0, #0x46 */\n/* \tbhi\t.L13\t@cond_branch */\n/* \tmov\tr0, #0x40 */\n/* \torr\tr7, r7, r0 */\n/* \tlsl\tr0, r7, #0x18 */\n/* \tlsr\tr7, r0, #0x18 */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, #0x46 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x19 */\n/* \tbls\t.L20\t@cond_branch */\n/* \tldr\tr0, .L45 */\n/* \tand\tr6, r6, r0 */\n/* \tldr\tr0, .L45+0x4 */\n/* \tb\t.L32 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\t0xffff */\n/* \t.word\t-0x30000 */\n/* .L20: */\n/* \tldr\tr0, .L47 */\n/* .L32: */\n/* \torr\tr6, r6, r0 */\n/* .L13: */\n/* \tldrb\tr0, [r2] */\n/* \torr\tr7, r7, r0 */\n/* \tldr\tr5, .L47+0x4 */\n/* \tldr\tr1, .L47+0x8 */\n/* \tldr\tr3, [r5] */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr3, r3, r0 */\n/* \tldr\tr4, .L47+0xc */\n/* \tldr\tr2, [r4] */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tadd\tr2, r2, r0 */\n/* \tasr\tr0, r3, #0x10 */\n/* \tadd\tr0, r6, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tldr\tr1, .L47 */\n/* \tmov\tr8, r1 */\n/* \tand\tr6, r6, r1 */\n/* \torr\tr6, r6, r0 */\n/* \tlsr\tr0, r6, #0x10 */\n/* \tasr\tr1, r2, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tldr\tr1, .L47+0x10 */\n/* \tand\tr6, r6, r1 */\n/* \torr\tr6, r6, r0 */\n/* \tand\tr3, r3, r1 */\n/* \tstr\tr3, [r5] */\n/* \tand\tr2, r2, r1 */\n/* \tstr\tr2, [r4] */\n/* \tldr\tr0, .L47+0x14 */\n/* \tadd\tr0, r0, #0x46 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L22\t@cond_branch */\n/* \tmov\tr0, #0x30 */\n/* \tand\tr7, r7, r0 */\n/* \tmov\tr6, #0x0 */\n/* .L22: */\n/* \tcmp\tr7, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr1, r6, #0 */\n/* \tbl\tScrollBGLayer */\n/* .L23: */\n/* \tldr\tr2, .L47+0x18 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x40 */\n/* \tldrh\tr0, [r0] */\n/* \tlsr\tr0, r0, #0x1 */\n/* \tstrh\tr0, [r2, #0x24] */\n/* \tldr\tr0, .L47+0x1c */\n/* \tldr\tr1, [r0, #0x4] */\n/* \tmov\tr0, #0x3 */\n/* \tand\tr1, r1, r0 */\n/* \tadd\tr7, r2, #0 */\n/* \tldr\tr2, .L47+0x20 */\n/* \tcmp\tr1, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tldr\tr0, .L47+0x24 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tldrh\tr0, [r2] */\n/* \tcmp\tr1, r0 */\n/* \tbcc\t.L25\t@cond_branch */\n/* \tsub\tr0, r1, r0 */\n/* \tmov\tr1, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tadd\tr1, r1, r0 */\n/* \tb\t.L33 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\t-0x10000 */\n/* \t.word\tgUnk_03005480 */\n/* \t.word\tgUnk_030034E8 */\n/* \t.word\tgUnk_030007C0 */\n/* \t.word\t0xffff */\n/* \t.word\tgUnk_03005220 */\n/* \t.word\tgUnk_03003430 */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\tgPrevBg2VOfs */\n/* \t.word\tgUnk_03004660 */\n/* .L25: */\n/* \tsub\tr0, r0, r1 */\n/* \tmov\tr1, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tsub\tr1, r1, r0 */\n/* .L33: */\n/* \tstrh\tr1, [r7, #0x26] */\n/* \tldrh\tr1, [r7, #0x26] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L34 */\n/* .L27: */\n/* \tlsl\tr0, r1, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x50 */\n/* \tbls\t.L24\t@cond_branch */\n/* \tmov\tr0, #0x50 */\n/* .L34: */\n/* \tstrh\tr0, [r7, #0x26] */\n/* .L24: */\n/* \tldr\tr5, .L49 */\n/* \tldrh\tr0, [r5] */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr0, .L49+0x4 */\n/* \tmov\tr8, r0 */\n/* \tldr\tr5, .L49+0x8 */\n/* \tldrb\tr0, [r5] */\n/* \tadd\tr0, r0, #0x40 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr4, [r0, r1] */\n/* \tldr\tr6, .L49+0xc */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x10 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr4, [r0, r1] */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x14 */\n/* \tmov\tsl, r1 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tldrh\tr4, [r0] */\n/* \tneg\tr4, r4 */\n/* \tlsl\tr4, r4, #0x10 */\n/* \tasr\tr4, r4, #0x10 */\n/* \tldr\tr6, .L49+0x18 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr1, .L49+0x1c */\n/* \tmov\tr9, r1 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr0, [r5] */\n/* \tadd\tr0, r0, #0x40 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r8 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr4, [r0, r5] */\n/* \tmov\tr1, #0x0 */\n/* \tldrsh\tr0, [r6, r1] */\n/* \tbl\tReciprocalQ8 */\n/* \tadd\tr1, r0, #0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tadd\tr0, r4, #0 */\n/* \tbl\tMultiplyQ8 */\n/* \tldr\tr4, .L49+0x20 */\n/* \tstrh\tr0, [r4] */\n/* \tldr\tr3, .L49+0x24 */\n/* \tadd\tr0, r7, #0 */\n/* \tadd\tr0, r0, #0x40 */\n/* \tldrh\tr1, [r0] */\n/* \tadd\tr1, r1, #0x78 */\n/* \tlsl\tr1, r1, #0x8 */\n/* \tldr\tr5, .L49+0x10 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r5, r0] */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tsub\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tsub\tr1, r1, r0 */\n/* \tmov\tr5, sl */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r5, r0] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tsub\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\n/* \tldr\tr3, .L49+0x28 */\n/* \tldr\tr5, .L49 */\n/* \tldrh\tr1, [r5] */\n/* \tadd\tr1, r1, #0x50 */\n/* \tlsl\tr1, r1, #0x8 */\n/* \tmov\tr0, r9 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr2, [r0, r5] */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tsub\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tsub\tr1, r1, r0 */\n/* \tmov\tr0, #0x0 */\n/* \tldrsh\tr2, [r4, r0] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tsub\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\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/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgUnk_03003430+0x42 */\n/* \t.word\tgSineTable */\n/* \t.word\tgBg2Alpha */\n/* \t.word\tgBg2XMag */\n/* \t.word\tgBg2PA */\n/* \t.word\tgBg2PB */\n/* \t.word\tgBg2YMag */\n/* \t.word\tgBg2PC */\n/* \t.word\tgBg2PD */\n/* \t.word\tgBg2X */\n/* \t.word\tgBg2Y */\n/* .Lfe1: */\n/* \t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateCameraScroll(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' is a symbol offset or code label — not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":434,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateCameraScroll': literal-pool load of pool word 'gUnk_03003430+0x42' is a symbol offset or code label — not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void UpdateCameraScroll(void) {\n s16 temp_r0;\n s16 temp_r4;\n s16 temp_r4_2;\n s16 temp_r4_3;\n s16 temp_r4_4;\n s32 temp_r2;\n s32 temp_r3_2;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r0_3;\n s32 var_r6_2;\n s32 var_r8;\n u16 temp_r0_2;\n u16 temp_r3;\n u16 temp_r6;\n u16 var_r0_4;\n u16 var_r1;\n u16 var_r6;\n u8 var_r7;\n u8 var_r7_2;\n\n var_r8 = 0;\n var_r7 = 0;\n var_r6 = 0;\n if (!(0x30 & gUnk_030051B8)) {\n temp_r0 = gUnk_03003430.bg2HOfs + 0x78;\n if ((s32) (s16) gUnk_03002920->xPosBg2 > (s32) temp_r0) {\n var_r7 = 0x10;\n if ((s32) ((gUnk_03002920->xPosBg2 - 0x78) - gUnk_03003430.bg2HOfs) > 5) {\n var_r6 = 2;\n } else {\n var_r6 = (0 & 0xFFFF0000) | 1;\n }\n var_r0 = 0x20;\n goto block_11;\n }\n if ((s32) (s16) gUnk_03002920->xPosBg2 < (s32) temp_r0) {\n var_r7 = 0x20;\n if ((s32) (gUnk_03003430.bg2HOfs - (gUnk_03002920->xPosBg2 - 0x78)) > 5) {\n var_r6 = 0 & 0xFFFF0000;\n var_r0_2 = 0xFFFE;\n } else {\n var_r0_2 = 0xFFFF;\n }\n var_r6 |= var_r0_2;\n var_r0 = 0x10;\nblock_11:\n if (var_r0 & gHeldKeys) {\n var_r7 = 0;\n var_r6 &= 0xFFFF0000;\n }\n }\n }\n if (!(0xC0 & gUnk_030051B8)) {\n if ((u32) gUnk_03002920->yPosScreen > 0xA0U) {\n var_r8 = 0x44;\n }\n temp_r3 = var_r8 + gUnk_03002920->yPosScreen;\n temp_r0_2 = temp_r3;\n if ((u32) temp_r0_2 > 0x63U) {\n var_r7 |= 0x80;\n if ((u32) (u16) (temp_r3 - 0x64) > 0x1EU) {\n var_r6 = var_r6;\n var_r0_3 = 0x30000;\n } else {\n var_r6 = var_r6;\n var_r0_3 = 0x10000;\n }\n goto block_24;\n }\n if ((u32) temp_r0_2 <= 0x46U) {\n var_r7 |= 0x40;\n if ((u32) (u16) ((var_r8 + 0x46) - gUnk_03002920->yPosScreen) > 0x19U) {\n var_r6 = var_r6;\n var_r0_3 = 0xFFFD0000;\n } else {\n var_r0_3 = 0xFFFF0000;\n }\nblock_24:\n var_r6 |= var_r0_3;\n }\n }\n var_r7_2 = var_r7 | gUnk_030051B8;\n temp_r3_2 = gUnk_03005480 + gUnk_030034E8.unk0;\n temp_r2 = gUnk_030007C0 + gUnk_030034E8.unk4;\n temp_r6 = (var_r6 & 0xFFFF0000) | (u16) (var_r6 + (temp_r3_2 >> 0x10));\n var_r6_2 = temp_r6 | (((temp_r6 >> 0x10) + (temp_r2 >> 0x10)) << 0x10);\n gUnk_03005480 = (s32) (u16) temp_r3_2;\n gUnk_030007C0 = (s32) (u16) temp_r2;\n if (gUnk_03005220.deathSequenceTimer != 0) {\n var_r7_2 &= 0x30;\n var_r6_2 = 0;\n }\n if (var_r7_2 != 0) {\n ScrollBGLayer(var_r7_2, (struct ScrollBGLayer_Args) var_r6_2);\n }\n gUnk_03003430.bg1HOfs = (u16) ((u16) gUnk_03003430.bg2HOfs >> 1);\n if (!(gUnk_03004C20.globalFrameCounter & 3) && (gUnk_03004660 == 0)) {\n if ((u32) gUnk_03003430.bg2VOfs >= (u32) gPrevBg2VOfs) {\n var_r1 = gUnk_03003430.bg1VOfs + ((gUnk_03003430.bg2VOfs - gPrevBg2VOfs) & 1);\n } else {\n var_r1 = gUnk_03003430.bg1VOfs - ((gPrevBg2VOfs - gUnk_03003430.bg2VOfs) & 1);\n }\n gUnk_03003430.bg1VOfs = var_r1;\n if (0x8000 & gUnk_03003430.bg1VOfs) {\n var_r0_4 = 0;\n goto block_38;\n }\n if ((u32) (u16) gUnk_03003430.bg1VOfs > 0x50U) {\n var_r0_4 = 0x50;\nblock_38:\n gUnk_03003430.bg1VOfs = var_r0_4;\n }\n }\n gPrevBg2VOfs = gUnk_03003430.bg2VOfs;\n temp_r4 = gSineTable[gBg2Alpha + 0x40];\n gBg2PA = MultiplyQ8(temp_r4, ReciprocalQ8((s16) gBg2XMag));\n temp_r4_2 = gSineTable[gBg2Alpha];\n gBg2PB = MultiplyQ8(temp_r4_2, ReciprocalQ8((s16) gBg2XMag));\n temp_r4_3 = 0 - (u16) gSineTable[gBg2Alpha];\n gBg2PC = MultiplyQ8(temp_r4_3, ReciprocalQ8((s16) gBg2YMag));\n temp_r4_4 = gSineTable[gBg2Alpha + 0x40];\n gBg2PD = MultiplyQ8(temp_r4_4, ReciprocalQ8((s16) gBg2YMag));\n gBg2X = (((gUnk_03003430.bg2HOfs + 0x78) << 8) - (gBg2PA * 0x78)) - (gBg2PB * 0x50);\n gBg2Y = (((gUnk_03003430.bg2VOfs + 0x50) << 8) - (gBg2PC * 0x78)) - (gBg2PD * 0x50);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":126,"gotos":3,"casts":29,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1200: conversion to non-scalar type requested"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateCameraScroll` — benchmark function kleod:UpdateCameraScroll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\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-c68b94e46656.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateCameraScroll(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateCameraScroll # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateCameraScroll` — benchmark function kleod:UpdateCameraScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateCameraScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateCameraScroll\n\t.type\t UpdateCameraScroll,function\n\t.thumb_func\nUpdateCameraScroll:\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\tmov\tr0, #0x0\n\tmov\tr8, r0\n\tmov\tr7, #0x0\n\tldr\tr1, .L35\n\tmov\tsl, r1\n\tmov\tr6, #0x0\n\tldr\tr2, .L35+0x4\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x30\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tldr\tr4, .L35+0x8\n\tldr\tr0, .L35+0xc\n\tadd\tr3, r0, #0\n\tadd\tr3, r3, #0x40\n\tldrh\tr0, [r3]\n\tmov\tr5, #0x78\n\tadd\tr5, r5, r0\n\tmov\tr0, #0x0\n\tldrsh\tr1, [r4, r0]\n\tlsl\tr5, r5, #0x10\n\tasr\tr0, r5, #0x10\n\tcmp\tr1, r0\n\tble\t.L4\t@cond_branch\n\tmov\tr7, #0x10\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tldrh\tr1, [r3]\n\tsub\tr0, r0, r1\n\tcmp\tr0, #0x5\n\tble\t.L5\t@cond_branch\n\tmov\tr6, #0x2\n\tb\t.L6\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\t-0x10000\n\t.word\tgUnk_030051B8\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n.L5:\n\tmov\tr1, sl\n\tand\tr6, r6, r1\n\tmov\tr0, #0x1\n\torr\tr6, r6, r0\n.L6:\n\tldr\tr0, .L37\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x20\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgHeldKeys\n.L4:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tmov\tr7, #0x20\n\tldrh\tr1, [r3]\n\tldrh\tr0, [r4]\n\tsub\tr0, r0, #0x78\n\tsub\tr1, r1, r0\n\tcmp\tr1, #0x5\n\tble\t.L10\t@cond_branch\n\tmov\tr5, sl\n\tand\tr6, r6, r5\n\tldr\tr0, .L39\n\tb\t.L31\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\t0xfffe\n.L10:\n\tldr\tr0, .L41\n.L31:\n\torr\tr6, r6, r0\n\tldr\tr0, .L41+0x4\n\tldrh\tr1, [r0]\n\tmov\tr0, #0x10\n.L30:\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr7, #0x0\n\tldr\tr0, .L41+0x8\n\tand\tr6, r6, r0\n.L3:\n\tldrb\tr1, [r2]\n\tmov\tr0, #0xc0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L13\t@cond_branch\n\tldr\tr0, .L41+0xc\n\tldrh\tr1, [r0, #0x6]\n\tcmp\tr1, #0xa0\n\tbls\t.L14\t@cond_branch\n\tmov\tr0, #0x44\n\tmov\tr8, r0\n.L14:\n\tmov\tr5, r8\n\tadd\tr3, r5, r1\n\tlsl\tr0, r3, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x63\n\tbls\t.L15\t@cond_branch\n\tmov\tr0, #0x80\n\torr\tr7, r7, r0\n\tadd\tr0, r3, #0\n\tsub\tr0, r0, #0x64\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x1e\n\tbls\t.L16\t@cond_branch\n\tldr\tr0, .L41\n\tand\tr6, r6, r0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0xa\n\tb\t.L32\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\t0xffff\n\t.word\tgHeldKeys\n\t.word\t-0x10000\n\t.word\tgUnk_03002920\n.L16:\n\tldr\tr0, .L43\n\tand\tr6, r6, r0\n\tadd\tr0, r0, #0x1\n\tb\t.L32\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\t0xffff\n.L15:\n\tcmp\tr0, #0x46\n\tbhi\t.L13\t@cond_branch\n\tmov\tr0, #0x40\n\torr\tr7, r7, r0\n\tlsl\tr0, r7, #0x18\n\tlsr\tr7, r0, #0x18\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x46\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x19\n\tbls\t.L20\t@cond_branch\n\tldr\tr0, .L45\n\tand\tr6, r6, r0\n\tldr\tr0, .L45+0x4\n\tb\t.L32\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\t0xffff\n\t.word\t-0x30000\n.L20:\n\tldr\tr0, .L47\n.L32:\n\torr\tr6, r6, r0\n.L13:\n\tldrb\tr0, [r2]\n\torr\tr7, r7, r0\n\tldr\tr5, .L47+0x4\n\tldr\tr1, .L47+0x8\n\tldr\tr3, [r5]\n\tldr\tr0, [r1]\n\tadd\tr3, r3, r0\n\tldr\tr4, .L47+0xc\n\tldr\tr2, [r4]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr2, r2, r0\n\tasr\tr0, r3, #0x10\n\tadd\tr0, r6, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L47\n\tmov\tr8, r1\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tlsr\tr0, r6, #0x10\n\tasr\tr1, r2, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tldr\tr1, .L47+0x10\n\tand\tr6, r6, r1\n\torr\tr6, r6, r0\n\tand\tr3, r3, r1\n\tstr\tr3, [r5]\n\tand\tr2, r2, r1\n\tstr\tr2, [r4]\n\tldr\tr0, .L47+0x14\n\tadd\tr0, r0, #0x46\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L22\t@cond_branch\n\tmov\tr0, #0x30\n\tand\tr7, r7, r0\n\tmov\tr6, #0x0\n.L22:\n\tcmp\tr7, #0\n\tbeq\t.L23\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr1, r6, #0\n\tbl\tScrollBGLayer\n.L23:\n\tldr\tr2, .L47+0x18\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x1\n\tstrh\tr0, [r2, #0x24]\n\tldr\tr0, .L47+0x1c\n\tldr\tr1, [r0, #0x4]\n\tmov\tr0, #0x3\n\tand\tr1, r1, r0\n\tadd\tr7, r2, #0\n\tldr\tr2, .L47+0x20\n\tcmp\tr1, #0\n\tbne\t.L24\t@cond_branch\n\tldr\tr0, .L47+0x24\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r2]\n\tcmp\tr1, r0\n\tbcc\t.L25\t@cond_branch\n\tsub\tr0, r1, r0\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tadd\tr1, r1, r0\n\tb\t.L33\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t-0x10000\n\t.word\tgUnk_03005480\n\t.word\tgUnk_030034E8\n\t.word\tgUnk_030007C0\n\t.word\t0xffff\n\t.word\tgUnk_03005220\n\t.word\tgUnk_03003430\n\t.word\tgUnk_03004C20\n\t.word\tgPrevBg2VOfs\n\t.word\tgUnk_03004660\n.L25:\n\tsub\tr0, r0, r1\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldrh\tr1, [r7, #0x26]\n\tsub\tr1, r1, r0\n.L33:\n\tstrh\tr1, [r7, #0x26]\n\tldrh\tr1, [r7, #0x26]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L34\n.L27:\n\tlsl\tr0, r1, #0x10\n\tlsr\tr0, r0, #0x10\n\tcmp\tr0, #0x50\n\tbls\t.L24\t@cond_branch\n\tmov\tr0, #0x50\n.L34:\n\tstrh\tr0, [r7, #0x26]\n.L24:\n\tldr\tr5, .L49\n\tldrh\tr0, [r5]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L49+0x4\n\tmov\tr8, r0\n\tldr\tr5, .L49+0x8\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tldr\tr6, .L49+0xc\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x10\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr1, #0x0\n\tldrsh\tr4, [r0, r1]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x14\n\tmov\tsl, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tldrh\tr4, [r0]\n\tneg\tr4, r4\n\tlsl\tr4, r4, #0x10\n\tasr\tr4, r4, #0x10\n\tldr\tr6, .L49+0x18\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr1, .L49+0x1c\n\tmov\tr9, r1\n\tstrh\tr0, [r1]\n\tldrb\tr0, [r5]\n\tadd\tr0, r0, #0x40\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r8\n\tmov\tr5, #0x0\n\tldrsh\tr4, [r0, r5]\n\tmov\tr1, #0x0\n\tldrsh\tr0, [r6, r1]\n\tbl\tReciprocalQ8\n\tadd\tr1, r0, #0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r4, #0\n\tbl\tMultiplyQ8\n\tldr\tr4, .L49+0x20\n\tstrh\tr0, [r4]\n\tldr\tr3, .L49+0x24\n\tadd\tr0, r7, #0\n\tadd\tr0, r0, #0x40\n\tldrh\tr1, [r0]\n\tadd\tr1, r1, #0x78\n\tlsl\tr1, r1, #0x8\n\tldr\tr5, .L49+0x10\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr5, sl\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r5, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\n\tldr\tr3, .L49+0x28\n\tldr\tr5, .L49\n\tldrh\tr1, [r5]\n\tadd\tr1, r1, #0x50\n\tlsl\tr1, r1, #0x8\n\tmov\tr0, r9\n\tmov\tr5, #0x0\n\tldrsh\tr2, [r0, r5]\n\tlsl\tr0, r2, #0x4\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x3\n\tsub\tr1, r1, r0\n\tmov\tr0, #0x0\n\tldrsh\tr2, [r4, r0]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x4\n\tsub\tr1, r1, r0\n\tstr\tr1, [r3]\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.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgUnk_03003430+0x42\n\t.word\tgSineTable\n\t.word\tgBg2Alpha\n\t.word\tgBg2XMag\n\t.word\tgBg2PA\n\t.word\tgBg2PB\n\t.word\tgBg2YMag\n\t.word\tgBg2PC\n\t.word\tgBg2PD\n\t.word\tgBg2X\n\t.word\tgBg2Y\n.Lfe1:\n\t.size\t UpdateCameraScroll,.Lfe1-UpdateCameraScroll\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 \"UpdateCameraScroll\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateCameraScroll # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["branch","cast","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","shift","bitwise","call","mmio"],"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/argbase","symbolsUsed":[{"name":"gEntityArray","shape":"u8[]"},{"name":"REG_BLDALPHA","shape":"scalar u16"}],"outcome":"match","source":"void UpdateFadeEffect(void) {\n s32 v0;\n u8 * p0;\n u8 * p1;\n p0 = (u8 *)67108870;\n p1 = (u8 *)gEntityArray;\n v0 = sub_08051A0C(*p0, p1[8]);\n if ((u8)v0 <= 16) REG_BLDALPHA = (u8)v0 << 8 | (u8)v0;\n return;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":92,"lines":10,"gotos":0,"casts":6,"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"loc":35,"refSource":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_sb;\n\n var_sb = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n if (var_r5 == gUnk_03005220.dreamStones) {\n var_sb = 1;\n }\n\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 1;\n if (gUnk_03005220.dreamStones > 0x63) {\n gBgTilemapBufs[0][0x252] += 0;\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] += 0;\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5 = 0;\n }\n\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][0x254 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x292];\n gBgTilemapBufs[0][0x274 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x2B2];\n }\n\n gBgTilemapBufs[0][0x255 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x292];\n gBgTilemapBufs[0][0x275 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x2B2];\n return var_sb;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1184-L1218","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/defsite/scopebase-coalesce-v2-v4","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-2duYZD/c.c:1085: incompatible types in assignment"},{"label":"unsigned/coalesce-v2-v3/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-IaZKL3/c.c:1084: incompatible types in assignment"},{"label":"unsigned/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-duAGNb/c.c:1084: incompatible types in assignment"},{"label":"unsigned/defsite/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-RWHHSI/c.c:1086: incompatible types in assignment"},{"label":"unsigned/defsite/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-tMRk9i/c.c:1085: incompatible types in assignment"},{"label":"signed/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-PczVje/c.c:1085: incompatible types in assignment"},{"label":"signed/coalesce-v2-v3/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-LRGxNi/c.c:1084: incompatible types in assignment"},{"label":"signed/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-kkGrTr/c.c:1084: incompatible types in assignment"},{"label":"signed/defsite/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-qYty7P/c.c:1086: incompatible types in assignment"},{"label":"signed/defsite/coalesce-v2-v4/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-Fl5PVX/c.c:1085: incompatible types in assignment"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03004C20","shape":"struct Unk_03004C20 (24 B)"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"match","source":"s32 UpdateHUDCounterDisplay(u32 a0, u32 a1) {\n s32 v3;\n s32 v4;\n u16 * p0;\n v3 = 0;\n if (gUnk_03004C20.unkA == 1 || gUnk_03004C20.level == 6) {\n v4 = 100;\n } else {\n v4 = 30;\n }\n if (v4 == gUnk_03005220.dreamStones) v3 = 1;\n if (gUnk_03004C20.unkA == 1 || gUnk_03004C20.level == 6) {\n v4 = 1;\n if (gUnk_03005220.dreamStones > 99) {\n p0 = (u16 *)&gBgTilemapBufs;\n p0[594] = p0[659];\n p0[626] = p0[691];\n }\n } else {\n v4 = 0;\n }\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][(149 << 2) - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones / 10 + 658];\n gBgTilemapBufs[0][(157 << 2) - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones / 10 + 690];\n }\n gBgTilemapBufs[0][597 - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones % 10 + 658];\n gBgTilemapBufs[0][629 - v4] = gBgTilemapBufs[0][gUnk_03005220.dreamStones % 10 + 690];\n return v3;\n}\n","score":0,"maxScore":136,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":29,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_r5_2;\n s32 var_r9;\n u32 temp_r0;\n u32 temp_r2;\n\n var_r9 = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n temp_r2 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if (var_r5 == temp_r2) {\n var_r9 = 1;\n }\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5_2 = 1;\n if ((s32) temp_r2 > 0x63) {\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5_2 = 0;\n }\n temp_r0 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if ((s32) temp_r0 > 9) {\n gBgTilemapBufs->unk0[0x254 - var_r5_2] = gBgTilemapBufs->unk0[((s32) temp_r0 / 10) + 0x292];\n gBgTilemapBufs->unk0[0x274 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) / 10) + 0x2B2];\n }\n gBgTilemapBufs->unk0[0x255 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x292];\n gBgTilemapBufs->unk0[0x275 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x2B2];\n return var_r9;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1085: invalid operands to binary <<","/c.c:1098: invalid operands to binary <<","/c.c:1100: request for member `unk0' in something not a structure or union","/c.c:1101: request for member `unk0' in something not a structure or union","/c.c:1101: invalid operands to binary <<"]},"gapSize":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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateWorldMapNodeAnim:agbcc","sym":"UpdateWorldMapNodeAnim","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","switch","shift","soft-div","call","mmio","dma","jump-table"],"loc":76,"refSource":"void UpdateWorldMapNodeAnim(void) {\n s32 var_r7;\n s32 temp_r6;\n\n if (gUnk_03004C08.unk0_0 < 4) {\n var_r7 = 0;\n temp_r6 = gUnk_08116880[gUnk_03004C08.unk0_0];\n } else {\n var_r7 = 4;\n temp_r6 = gUnk_08116880[gUnk_03004C08.unk0_0];\n }\n\n switch ((gUnk_03004C08.unk2 / 30) - 1) {\n case 0:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][0] + (gUnk_08116748[gUnk_03004C08.unk0_0][1] << 5)]\n = gBgTilemapBufs[1][0 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n break;\n\n case 1:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][2] + (gUnk_08116748[gUnk_03004C08.unk0_0][3] << 5)]\n = gBgTilemapBufs[1][1 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n break;\n\n case 2:\n if (gUnk_03004C08.unk0_0 == 6) {\n gUnk_03004C08.unk2 = 0x95;\n } else {\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][4] + (gUnk_08116748[gUnk_03004C08.unk0_0][5] << 5)]\n = gBgTilemapBufs[1][2 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n }\n break;\n\n case 3:\n if ((gUnk_03004C08.unk0_0 != 4) && (gUnk_03004C08.unk0_0 != 6)) {\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x89);\n }\n gBgTilemapBufs[1][gUnk_08116748[gUnk_03004C08.unk0_0][6] + (gUnk_08116748[gUnk_03004C08.unk0_0][7] << 5)]\n = gBgTilemapBufs[1][3 + var_r7 + ((temp_r6 + 0x1C) << 5)];\n }\n break;\n\n case 4:\n if ((gUnk_03004C08.unk2 % 30) == 0) {\n m4aSongNumStart(0x8A);\n }\n /* fallthrough */\n case 5:\n case 6:\n if (gUnk_03004C08.unk0_0 < 4) {\n if ((gUnk_03004C20.sceneFrameCounter % 4) == 0) {\n DmaCopy16(3, &gUnk_08116780[thunk_sub_080002A0() % 8], BG_PLTT + 0x160, 0x20);\n SetWorldMapTilePalette(gUnk_03004C08.unk0_0, 0xB);\n }\n } else {\n CopyWorldMapTiles(gUnk_03004C08.unk0_0);\n }\n break;\n\n case 7:\n CopyWorldMapTiles(gUnk_03004C08.unk0_0);\n gCallbackQueue.current[1] = CountCollectedGems;\n break;\n }\n\n gUnk_03004C08.unk2 += 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/704fd74330959112873665d790f911e3679770c0/src/code_3.c#L1980-L2055","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\n\n.text\n\t.align\t2, 0\n","proto":{"UpdateWorldMapNodeAnim":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateWorldMapNodeAnim' — lift: cannot lift 'UpdateWorldMapNodeAnim': 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\tUpdateWorldMapNodeAnim */\n/* \t.type\t UpdateWorldMapNodeAnim,function */\n/* \t.thumb_func */\n/* UpdateWorldMapNodeAnim: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tldr\tr0, .L31 */\n/* \tldr\tr1, [r0] */\n/* \tlsl\tr2, r1, #0x1c */\n/* \tlsr\tr1, r2, #0x1c */\n/* \tadd\tr3, r0, #0 */\n/* \tcmp\tr1, #0x3 */\n/* \tbhi\t.L4\t@cond_branch */\n/* \tmov\tr7, #0x0 */\n/* \tb\t.L28 */\n/* .L32: */\n/* \t.align\t2, 0 */\n/* .L31: */\n/* \t.word\tgUnk_03004C08 */\n/* .L4: */\n/* \tmov\tr7, #0x4 */\n/* .L28: */\n/* \tldr\tr1, .L33 */\n/* \tlsr\tr0, r2, #0x1c */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr6, [r0] */\n/* \tldrb\tr0, [r3, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__udivsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tsub\tr0, r0, #0x1 */\n/* \tcmp\tr0, #0x7 */\n/* \tbls\t.LCB48 */\n/* \tb\t.L6\t@long jump */\n/* .LCB48: */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tldr\tr1, .L33+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L34: */\n/* \t.align\t2, 0 */\n/* .L33: */\n/* \t.word\tgUnk_08116880 */\n/* \t.word\t.L26 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L26: */\n/* \t.word\t.L7 */\n/* \t.word\t.L9 */\n/* \t.word\t.L11 */\n/* \t.word\t.L15 */\n/* \t.word\t.L18 */\n/* \t.word\t.L21 */\n/* \t.word\t.L21 */\n/* \t.word\t.L25 */\n/* .L7: */\n/* \tldr\tr4, .L35 */\n/* \tldrb\tr0, [r4, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L8: */\n/* \tldr\tr3, .L35+0x4 */\n/* \tldr\tr1, .L35+0x8 */\n/* \tldr\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr2, r0, #0x19 */\n/* \tadd\tr2, r2, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr1, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\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\tr3, r3, r0 */\n/* \tadd\tr1, r1, r3 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r7, r0 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tb\t.L29 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L9: */\n/* \tldr\tr5, .L37 */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L10: */\n/* \tldr\tr4, .L37+0x4 */\n/* \tldr\tr2, .L37+0x8 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x2 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x3 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tb\t.L30 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L11: */\n/* \tldr\tr5, .L39 */\n/* \tldrb\tr1, [r5] */\n/* \tmov\tr0, #0xf */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x6 */\n/* \tbne\t.L12\t@cond_branch */\n/* \tmov\tr0, #0x95 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tb\t.L6 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgUnk_03004C08 */\n/* .L12: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L14\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L14: */\n/* \tldr\tr4, .L41 */\n/* \tldr\tr2, .L41+0x4 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x4 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x5 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x2 */\n/* \tb\t.L30 */\n/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L15: */\n/* \tldr\tr5, .L43 */\n/* \tldrb\tr0, [r5] */\n/* \tmov\tr1, #0xf */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0x4 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tcmp\tr1, #0x6 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0x89 */\n/* \tbl\tm4aSongNumStart */\n/* .L17: */\n/* \tldr\tr4, .L43+0x4 */\n/* \tldr\tr2, .L43+0x8 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr3, r0, #0x19 */\n/* \tadd\tr1, r2, #0x6 */\n/* \tadd\tr3, r3, r1 */\n/* \tlsr\tr0, r0, #0x19 */\n/* \tadd\tr2, r2, #0x7 */\n/* \tadd\tr0, r0, r2 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr3, [r3] */\n/* \tadd\tr1, r1, r3 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr4, r4, r0 */\n/* \tadd\tr1, r1, r4 */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x1c */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tadd\tr0, r0, #0x3 */\n/* .L30: */\n/* \tadd\tr0, r7, r0 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* .L29: */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tb\t.L6 */\n/* .L44: */\n/* \t.align\t2, 0 */\n/* .L43: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* .L18: */\n/* \tldr\tr0, .L45 */\n/* \tldrb\tr0, [r0, #0x2] */\n/* \tmov\tr1, #0x1e */\n/* \tbl\t__umodsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L21\t@cond_branch */\n/* \tmov\tr0, #0x8a */\n/* \tbl\tm4aSongNumStart */\n/* .L21: */\n/* \tldr\tr5, .L45 */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr1, r0, #0x1c */\n/* \tlsr\tr0, r1, #0x1c */\n/* \tcmp\tr0, #0x3 */\n/* \tbhi\t.L22\t@cond_branch */\n/* \tldr\tr0, .L45+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tr1, #0x3 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L6\t@cond_branch */\n/* \tldr\tr4, .L45+0x8 */\n/* \tbl\tthunk_sub_080002A0 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tmov\tr1, #0xe0 */\n/* \tlsl\tr1, r1, #0x13 */\n/* \tand\tr1, r1, r0 */\n/* \tlsr\tr1, r1, #0x13 */\n/* \tldr\tr0, .L45+0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tstr\tr1, [r4] */\n/* \tldr\tr0, .L45+0x10 */\n/* \tstr\tr0, [r4, #0x4] */\n/* \tldr\tr0, .L45+0x14 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr0, r0, #0x1c */\n/* \tmov\tr1, #0xb */\n/* \tbl\tSetWorldMapTilePalette */\n/* \tb\t.L6 */\n/* .L46: */\n/* \t.align\t2, 0 */\n/* .L45: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgUnk_03004C20 */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgUnk_08116780 */\n/* \t.word\t0x5000160 */\n/* \t.word\t-0x7ffffff0 */\n/* .L22: */\n/* \tlsr\tr0, r1, #0x1c */\n/* \tbl\tCopyWorldMapTiles */\n/* \tb\t.L6 */\n/* .L25: */\n/* \tldr\tr0, .L47 */\n/* \tldr\tr0, [r0] */\n/* \tlsl\tr0, r0, #0x1c */\n/* \tlsr\tr0, r0, #0x1c */\n/* \tbl\tCopyWorldMapTiles */\n/* \tldr\tr1, .L47+0x4 */\n/* \tldr\tr0, .L47+0x8 */\n/* \tstr\tr0, [r1, #0x4] */\n/* .L6: */\n/* \tldr\tr1, .L47 */\n/* \tldrb\tr0, [r1, #0x2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r1, #0x2] */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\tgUnk_03004C08 */\n/* \t.word\tgCallbackQueue */\n/* \t.word\tCountCollectedGems */\n/* .Lfe1: */\n/* \t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateWorldMapNodeAnim(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateWorldMapNodeAnim': 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":341,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateWorldMapNodeAnim': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? CopyWorldMapTiles(u32); /* extern */\n? SetWorldMapTilePalette(u32, s32); /* extern */\n? m4aSongNumStart(s32); /* extern */\ns32 thunk_sub_080002A0(); /* extern */\nextern ? CountCollectedGems;\nextern ? gBgTilemapBufs;\nextern ? gCallbackQueue;\nextern ? gUnk_03004C08;\nextern s32 gUnk_03004C20;\nextern ? gUnk_08116748;\nextern ? gUnk_08116780;\nextern ? gUnk_08116880;\n\nvoid UpdateWorldMapNodeAnim(void) {\n s32 temp_r1;\n s32 var_r0_2;\n s32 var_r7;\n u16 *var_r0;\n u16 *var_r1;\n u32 temp_r0;\n u32 temp_r0_2;\n u32 temp_r0_3;\n u32 temp_r0_4;\n u32 temp_r0_5;\n u32 temp_r1_2;\n u32 temp_r2;\n u8 temp_r6;\n void *temp_r3;\n void *var_r4;\n\n temp_r2 = gUnk_03004C08.unk0 << 0x1C;\n if ((u32) (temp_r2 >> 0x1C) <= 3U) {\n var_r7 = 0;\n } else {\n var_r7 = 4;\n }\n temp_r6 = *((temp_r2 >> 0x1C) + &gUnk_08116880);\n temp_r0 = (u8) ((u8) gUnk_03004C08.unk2 / 30U) - 1;\n switch (temp_r0) { /* irregular */\n case 0:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_2 = gUnk_03004C08.unk0 << 0x1C;\n temp_r3 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_2 >> 0x19) + (&gUnk_08116748 + 1)) << 5) + *((temp_r0_2 >> 0x19) + &gUnk_08116748)) * 2) + temp_r3;\n var_r0 = ((var_r7 + ((temp_r6 + 0x1C) << 5)) * 2) + temp_r3;\nblock_23:\n *var_r1 = *var_r0;\n break;\n case 1:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_3 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_3 >> 0x19) + (&gUnk_08116748 + 3)) << 5) + *((temp_r0_3 >> 0x19) + (&gUnk_08116748 + 2))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 1;\nblock_22:\n var_r0 = ((var_r7 + var_r0_2) * 2) + var_r4;\n goto block_23;\n case 2:\n if ((0xF & (u8) gUnk_03004C08.unk0) == 6) {\n gUnk_03004C08.unk2 = 0x95U;\n } else {\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_4 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_4 >> 0x19) + (&gUnk_08116748 + 5)) << 5) + *((temp_r0_4 >> 0x19) + (&gUnk_08116748 + 4))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 2;\n goto block_22;\n }\n break;\n case 3:\n temp_r1 = 0xF & (u8) gUnk_03004C08.unk0;\n if ((temp_r1 != 4) && (temp_r1 != 6)) {\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x89);\n }\n temp_r0_5 = gUnk_03004C08.unk0 << 0x1C;\n var_r4 = &gBgTilemapBufs + 0x800;\n var_r1 = (((*((temp_r0_5 >> 0x19) + (&gUnk_08116748 + 7)) << 5) + *((temp_r0_5 >> 0x19) + (&gUnk_08116748 + 6))) * 2) + var_r4;\n var_r0_2 = ((temp_r6 + 0x1C) << 5) + 3;\n goto block_22;\n }\n break;\n case 4:\n if ((((u8) gUnk_03004C08.unk2 % 30U) << 0x18) == 0) {\n m4aSongNumStart(0x8A);\n }\n /* fallthrough */\n case 5:\n case 6:\n temp_r1_2 = gUnk_03004C08.unk0 << 0x1C;\n if ((u32) (temp_r1_2 >> 0x1C) <= 3U) {\n if (!(gUnk_03004C20 & 3)) {\n (void *)0x040000D4->unk0 = (void *) (((u32) (0x07000000 & (thunk_sub_080002A0() << 0x18)) >> 0x13) + &gUnk_08116780);\n (void *)0x040000D4->unk4 = 0x05000160;\n (void *)0x040000D4->unk8 = 0x80000010;\n SetWorldMapTilePalette((u32) (gUnk_03004C08.unk0 << 0x1C) >> 0x1C, 0xB);\n }\n } else {\n CopyWorldMapTiles(temp_r1_2 >> 0x1C);\n }\n break;\n case 7:\n CopyWorldMapTiles((u32) (gUnk_03004C08.unk0 << 0x1C) >> 0x1C);\n gCallbackQueue.unk4 = &CountCollectedGems;\n break;\n }\n gUnk_03004C08.unk2 = (u8) (gUnk_03004C08.unk2 + 1);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":56,"lines":112,"gotos":3,"casts":22,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateWorldMapNodeAnim` — benchmark function kleod:UpdateWorldMapNodeAnim:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateWorldMapNodeAnim # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeAnim` — benchmark function kleod:UpdateWorldMapNodeAnim:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateWorldMapNodeAnim:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeAnim\n\t.type\t UpdateWorldMapNodeAnim,function\n\t.thumb_func\nUpdateWorldMapNodeAnim:\n\tpush\t{r4, r5, r6, r7, lr}\n\tldr\tr0, .L31\n\tldr\tr1, [r0]\n\tlsl\tr2, r1, #0x1c\n\tlsr\tr1, r2, #0x1c\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x3\n\tbhi\t.L4\t@cond_branch\n\tmov\tr7, #0x0\n\tb\t.L28\n.L32:\n\t.align\t2, 0\n.L31:\n\t.word\tgUnk_03004C08\n.L4:\n\tmov\tr7, #0x4\n.L28:\n\tldr\tr1, .L33\n\tlsr\tr0, r2, #0x1c\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0]\n\tldrb\tr0, [r3, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0x7\n\tbls\t.LCB48\n\tb\t.L6\t@long jump\n.LCB48:\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\tgUnk_08116880\n\t.word\t.L26\n\t.align\t2, 0\n\t.align\t2, 0\n.L26:\n\t.word\t.L7\n\t.word\t.L9\n\t.word\t.L11\n\t.word\t.L15\n\t.word\t.L18\n\t.word\t.L21\n\t.word\t.L21\n\t.word\t.L25\n.L7:\n\tldr\tr4, .L35\n\tldrb\tr0, [r4, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L8:\n\tldr\tr3, .L35+0x4\n\tldr\tr1, .L35+0x8\n\tldr\tr0, [r4]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr2, r0, #0x19\n\tadd\tr2, r2, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr1, r1, #0x1\n\tadd\tr0, r0, r1\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\tr3, r3, r0\n\tadd\tr1, r1, r3\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r3\n\tb\t.L29\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L9:\n\tldr\tr5, .L37\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L10:\n\tldr\tr4, .L37+0x4\n\tldr\tr2, .L37+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x2\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x3\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x1\n\tb\t.L30\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L11:\n\tldr\tr5, .L39\n\tldrb\tr1, [r5]\n\tmov\tr0, #0xf\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x6\n\tbne\t.L12\t@cond_branch\n\tmov\tr0, #0x95\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L6\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgUnk_03004C08\n.L12:\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L14:\n\tldr\tr4, .L41\n\tldr\tr2, .L41+0x4\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x4\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x5\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x2\n\tb\t.L30\n.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L15:\n\tldr\tr5, .L43\n\tldrb\tr0, [r5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0x4\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x6\n\tbeq\t.L6\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x89\n\tbl\tm4aSongNumStart\n.L17:\n\tldr\tr4, .L43+0x4\n\tldr\tr2, .L43+0x8\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr3, r0, #0x19\n\tadd\tr1, r2, #0x6\n\tadd\tr3, r3, r1\n\tlsr\tr0, r0, #0x19\n\tadd\tr2, r2, #0x7\n\tadd\tr0, r0, r2\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr3, [r3]\n\tadd\tr1, r1, r3\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr4, r4, r0\n\tadd\tr1, r1, r4\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x1c\n\tlsl\tr0, r0, #0x5\n\tadd\tr0, r0, #0x3\n.L30:\n\tadd\tr0, r7, r0\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n.L29:\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L6\n.L44:\n\t.align\t2, 0\n.L43:\n\t.word\tgUnk_03004C08\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n.L18:\n\tldr\tr0, .L45\n\tldrb\tr0, [r0, #0x2]\n\tmov\tr1, #0x1e\n\tbl\t__umodsi3\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L21\t@cond_branch\n\tmov\tr0, #0x8a\n\tbl\tm4aSongNumStart\n.L21:\n\tldr\tr5, .L45\n\tldr\tr0, [r5]\n\tlsl\tr1, r0, #0x1c\n\tlsr\tr0, r1, #0x1c\n\tcmp\tr0, #0x3\n\tbhi\t.L22\t@cond_branch\n\tldr\tr0, .L45+0x4\n\tldr\tr0, [r0]\n\tmov\tr1, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldr\tr4, .L45+0x8\n\tbl\tthunk_sub_080002A0\n\tlsl\tr0, r0, #0x18\n\tmov\tr1, #0xe0\n\tlsl\tr1, r1, #0x13\n\tand\tr1, r1, r0\n\tlsr\tr1, r1, #0x13\n\tldr\tr0, .L45+0xc\n\tadd\tr1, r1, r0\n\tstr\tr1, [r4]\n\tldr\tr0, .L45+0x10\n\tstr\tr0, [r4, #0x4]\n\tldr\tr0, .L45+0x14\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tldr\tr0, [r5]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tmov\tr1, #0xb\n\tbl\tSetWorldMapTilePalette\n\tb\t.L6\n.L46:\n\t.align\t2, 0\n.L45:\n\t.word\tgUnk_03004C08\n\t.word\tgUnk_03004C20\n\t.word\t0x40000d4\n\t.word\tgUnk_08116780\n\t.word\t0x5000160\n\t.word\t-0x7ffffff0\n.L22:\n\tlsr\tr0, r1, #0x1c\n\tbl\tCopyWorldMapTiles\n\tb\t.L6\n.L25:\n\tldr\tr0, .L47\n\tldr\tr0, [r0]\n\tlsl\tr0, r0, #0x1c\n\tlsr\tr0, r0, #0x1c\n\tbl\tCopyWorldMapTiles\n\tldr\tr1, .L47+0x4\n\tldr\tr0, .L47+0x8\n\tstr\tr0, [r1, #0x4]\n.L6:\n\tldr\tr1, .L47\n\tldrb\tr0, [r1, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r1, #0x2]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\tgUnk_03004C08\n\t.word\tgCallbackQueue\n\t.word\tCountCollectedGems\n.Lfe1:\n\t.size\t UpdateWorldMapNodeAnim,.Lfe1-UpdateWorldMapNodeAnim\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 \"UpdateWorldMapNodeAnim\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeAnim # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","shift","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","pointer","memory","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 64724e9812cc973d94eb48c08bf3eeaef39798744d75677004e524d908c44c5c\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel CameraScissorSet\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x3\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x4\n lui\t$v1, %hi(gCameraList)\n lw\t$v1, %lo(gCameraList)($v1)\n addu\t$v0, $v0, $v1\n lwc1\t$f0, 0($a1)\n swc1\t$f0, 144($v0)\n lwc1\t$f0, 4($a1)\n swc1\t$f0, 148($v0)\n lwc1\t$f0, 8($a1)\n swc1\t$f0, 152($v0)\n lwc1\t$f0, 12($a1)\n jr\t$ra\n swc1\t$f0, 156($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CameraScissorSet(s16 camIndex, RectF *arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CameraScissorSet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:ContDataUpdate:gcc2.7.2","sym":"ContDataUpdate","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["array","global","branch","loop","shift","bitwise"],"loc":50,"refSource":"void ContDataUpdate(void) {\n s16 i;\n s32 temp_v0_3;\n s32 temp_v0_5;\n u16 var_a2;\n s8 temp_v0_2;\n s8 temp_v0_4;\n\n for (i = 0; i < MAXCONTROLLERS; ++i) {\n D_800D1350_D1F50[i] = D_800D5546_D6146[i];\n var_a2 = D_800CDA7C_CE67C[i];\n temp_v0_2 = D_800CBB6E_CC76E[i];\n temp_v0_3 = ((temp_v0_2 >> 7) | 1);\n\n if (((temp_v0_2 * temp_v0_3) - 0x1E) > 0) {\n if (temp_v0_3 > 0) {\n var_a2 = (var_a2 & 0xFDFF) | 0x100;\n } else {\n var_a2 = (var_a2 & 0xFEFF) | 0x200;\n }\n }\n\n temp_v0_4 = D_800D20A1_D2CA1[i];\n temp_v0_5 = ((temp_v0_4 >> 7) | 1);\n\n if (((temp_v0_4 * temp_v0_5) - 0x1E) > 0) {\n if (temp_v0_5 > 0) {\n var_a2 = (var_a2 & 0xFBFF) | 0x800;\n } else {\n var_a2 = (var_a2 & 0xF7FF) | 0x400;\n }\n }\n\n D_800D5546_D6146[i] = var_a2;\n D_800C9520_CA120[i] = var_a2 & (var_a2 ^ D_800D1350_D1F50[i]);\n\n if ((var_a2 & 0xFFFF) != D_800D1350_D1F50[i]) {\n D_800D10F8_D1CF8[i] = 0xA;\n D_800D0590_D1190[i] = D_800C9520_CA120[i];\n } else {\n if (D_800D10F8_D1CF8[i] > 0) {\n D_800D10F8_D1CF8[i] = D_800D10F8_D1CF8[i] - 1;\n D_800D0590_D1190[i] = D_800C9520_CA120[i];\n } else {\n D_800D10F8_D1CF8[i] = 1;\n D_800D0590_D1190[i] = var_a2;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/input.c#L15-L64","targetAsm":"\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:\tlui\tt5,0x0\n c:\taddiu\tt5,t5,0\n 10:\tlui\tt4,0x0\n 14:\taddiu\tt4,t4,0\n 18:\tlui\tt6,0x0\n 1c:\taddiu\tt6,t6,0\n 20:\tlui\tt3,0x0\n 24:\taddiu\tt3,t3,0\n 28:\tlui\tt2,0x0\n 2c:\taddiu\tt2,t2,0\n 30:\tlui\tt1,0x0\n 34:\taddiu\tt1,t1,0\n 38:\tsll\ta0,t0,0x10\n 3c:\tsra\ta0,a0,0x10\n 40:\tsll\tv1,a0,0x1\n 44:\taddu\ta1,v1,t5\n 48:\taddu\tv0,v1,t4\n 4c:\tlhu\tv0,0(v0)\n 50:\tsh\tv0,0(a1)\n 54:\taddu\tv1,v1,t6\n 58:\tlhu\ta2,0(v1)\n 5c:\tlui\tv0,0x0\n 60:\taddu\tv0,v0,a0\n 64:\tlbu\tv0,0(v0)\n 68:\tsll\tv0,v0,0x18\n 6c:\tsra\tv1,v0,0x18\n 70:\tsra\tv0,v0,0x1f\n 74:\tori\tv0,v0,0x1\n 78:\tmult\tv1,v0\n 7c:\tmflo\tv1\n 80:\taddiu\tv1,v1,-30\n 84:\tnop\n 88:\tblezl\tv1,ac \n 8c:\tsll\tv0,t0,0x10\n 90:\tblez\tv0,a0 \n 94:\tandi\tv0,a2,0xfdff\n 98:\tj\ta8 \n 9c:\tori\ta2,v0,0x100\n a0:\tandi\tv0,a2,0xfeff\n a4:\tori\ta2,v0,0x200\n a8:\tsll\tv0,t0,0x10\n ac:\tsra\tv0,v0,0x10\n b0:\tlui\tat,0x0\n b4:\taddu\tat,at,v0\n b8:\tlbu\tv0,0(at)\n bc:\tsll\tv0,v0,0x18\n c0:\tsra\tv1,v0,0x18\n c4:\tsra\tv0,v0,0x1f\n c8:\tori\tv0,v0,0x1\n cc:\tmult\tv1,v0\n d0:\tmflo\tv1\n d4:\taddiu\tv1,v1,-30\n d8:\tnop\n dc:\tblezl\tv1,100 \n e0:\tsll\tv0,t0,0x10\n e4:\tblez\tv0,f4 \n e8:\tandi\tv0,a2,0xfbff\n ec:\tj\tfc \n f0:\tori\ta2,v0,0x800\n f4:\tandi\tv0,a2,0xf7ff\n f8:\tori\ta2,v0,0x400\n fc:\tsll\tv0,t0,0x10\n 100:\tsra\ta1,v0,0xf\n 104:\taddu\tv0,a1,t4\n 108:\tsh\ta2,0(v0)\n 10c:\taddu\ta3,a1,t3\n 110:\taddu\ta0,a1,t5\n 114:\tlhu\tv0,0(a0)\n 118:\txor\tv0,a2,v0\n 11c:\tand\tv0,a2,v0\n 120:\tsh\tv0,0(a3)\n 124:\tandi\tv1,a2,0xffff\n 128:\tlhu\tv0,0(a0)\n 12c:\tbeq\tv1,v0,14c \n 130:\tli\tv0,10\n 134:\taddu\tv1,a1,t2\n 138:\tsh\tv0,0(v1)\n 13c:\taddu\tv1,a1,t1\n 140:\tlhu\tv0,0(a3)\n 144:\tj\t19c \n 148:\tsh\tv0,0(v1)\n 14c:\tsll\tv0,t0,0x10\n 150:\tsra\ta0,v0,0xf\n 154:\taddu\ta1,a0,t2\n 158:\tlh\tv0,0(a1)\n 15c:\tblez\tv0,180 \n 160:\tmove\tv1,v0\n 164:\taddiu\tv0,v1,-1\n 168:\tsh\tv0,0(a1)\n 16c:\taddu\tv1,a0,t1\n 170:\taddu\tv0,a0,t3\n 174:\tlhu\tv0,0(v0)\n 178:\tj\t19c \n 17c:\tsh\tv0,0(v1)\n 180:\tsll\tv0,t0,0x10\n 184:\tsra\tv0,v0,0xf\n 188:\taddu\ta0,v0,t2\n 18c:\tli\tv1,1\n 190:\tsh\tv1,0(a0)\n 194:\taddu\tv0,v0,t1\n 198:\tsh\ta2,0(v0)\n 19c:\taddiu\tv0,t0,1\n 1a0:\tmove\tt0,v0\n 1a4:\tsll\tv0,v0,0x10\n 1a8:\tsra\tv0,v0,0x10\n 1ac:\tslti\tv0,v0,4\n 1b0:\tbnez\tv0,3c \n 1b4:\tsll\ta0,t0,0x10\n 1b8:\taddiu\tsp,sp,8\n 1bc:\tjr\tra\n 1c0:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"ContDataUpdate":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-2fc48a130813fa67/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 ContDataUpdate\n00000000 *UND*\t00000000 D_800D1350_D1F50\n00000000 *UND*\t00000000 D_800D5546_D6146\n00000000 *UND*\t00000000 D_800CDA7C_CE67C\n00000000 *UND*\t00000000 D_800C9520_CA120\n00000000 *UND*\t00000000 D_800D10F8_D1CF8\n00000000 *UND*\t00000000 D_800D0590_D1190\n00000000 *UND*\t00000000 D_800CBB6E_CC76E\n00000000 *UND*\t00000000 D_800D20A1_D2CA1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800D1350_D1F50\n0000000c R_MIPS_LO16 D_800D1350_D1F50\n00000010 R_MIPS_HI16 D_800D5546_D6146\n00000014 R_MIPS_LO16 D_800D5546_D6146\n00000018 R_MIPS_HI16 D_800CDA7C_CE67C\n0000001c R_MIPS_LO16 D_800CDA7C_CE67C\n00000020 R_MIPS_HI16 D_800C9520_CA120\n00000024 R_MIPS_LO16 D_800C9520_CA120\n00000028 R_MIPS_HI16 D_800D10F8_D1CF8\n0000002c R_MIPS_LO16 D_800D10F8_D1CF8\n00000030 R_MIPS_HI16 D_800D0590_D1190\n00000034 R_MIPS_LO16 D_800D0590_D1190\n0000005c R_MIPS_HI16 D_800CBB6E_CC76E\n00000064 R_MIPS_LO16 D_800CBB6E_CC76E\n00000098 R_MIPS_26 .text\n000000b0 R_MIPS_HI16 D_800D20A1_D2CA1\n000000b8 R_MIPS_LO16 D_800D20A1_D2CA1\n000000ec R_MIPS_26 .text\n00000144 R_MIPS_26 .text\n00000178 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 3c0d0000 25ad0000 '.....@!<...%...\n 0010 3c0c0000 258c0000 3c0e0000 25ce0000 <...%...<...%...\n 0020 3c0b0000 256b0000 3c0a0000 254a0000 <...%k..<...%J..\n 0030 3c090000 25290000 00082400 00042403 <...%)....$...$.\n 0040 00041840 006d2821 006c1021 94420000 ...@.m(!.l.!.B..\n 0050 a4a20000 006e1821 94660000 3c020000 .....n.!.f..<...\n 0060 00441021 90420000 00021600 00021e03 .D.!.B..........\n 0070 000217c3 34420001 00620018 00001812 ....4B...b......\n 0080 2463ffe2 00000000 58600008 00081400 $c......X`......\n 0090 18400003 30c2fdff 0800002a 34460100 .@..0......*4F..\n 00a0 30c2feff 34460200 00081400 00021403 0...4F..........\n 00b0 3c010000 00220821 90220000 00021600 <....\".!.\"......\n 00c0 00021e03 000217c3 34420001 00620018 ........4B...b..\n 00d0 00001812 2463ffe2 00000000 58600008 ....$c......X`..\n 00e0 00081400 18400003 30c2fbff 0800003f .....@..0......?\n 00f0 34460800 30c2f7ff 34460400 00081400 4F..0...4F......\n 0100 00022bc3 00ac1021 a4460000 00ab3821 ..+....!.F....8!\n 0110 00ad2021 94820000 00c21026 00c21024 .. !.......&...$\n 0120 a4e20000 30c3ffff 94820000 10620007 ....0........b..\n 0130 2402000a 00aa1821 a4620000 00a91821 $......!.b.....!\n 0140 94e20000 08000067 a4620000 00081400 .......g.b......\n 0150 000223c3 008a2821 84a20000 18400008 ..#...(!.....@..\n 0160 00401821 2462ffff a4a20000 00891821 .@.!$b.........!\n 0170 008b1021 94420000 08000067 a4620000 ...!.B.....g.b..\n 0180 00081400 000213c3 004a2021 24030001 .........J !$...\n 0190 a4830000 00491021 a4460000 25020001 .....I.!.F..%...\n 01a0 00404021 00021400 00021403 28420004 .@@!........(B..\n 01b0 1440ffa2 00082400 27bd0008 03e00008 .@....$.'.......\n 01c0 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0007ffe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'ContDataUpdate' — lift: cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — 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\tt0,zero */\n/* 8:\tlui\tt5,0x0 */\n/* c:\taddiu\tt5,t5,0 */\n/* 10:\tlui\tt4,0x0 */\n/* 14:\taddiu\tt4,t4,0 */\n/* 18:\tlui\tt6,0x0 */\n/* 1c:\taddiu\tt6,t6,0 */\n/* 20:\tlui\tt3,0x0 */\n/* 24:\taddiu\tt3,t3,0 */\n/* 28:\tlui\tt2,0x0 */\n/* 2c:\taddiu\tt2,t2,0 */\n/* 30:\tlui\tt1,0x0 */\n/* 34:\taddiu\tt1,t1,0 */\n/* 38:\tsll\ta0,t0,0x10 */\n/* 3c:\tsra\ta0,a0,0x10 */\n/* 40:\tsll\tv1,a0,0x1 */\n/* 44:\taddu\ta1,v1,t5 */\n/* 48:\taddu\tv0,v1,t4 */\n/* 4c:\tlhu\tv0,0(v0) */\n/* 50:\tsh\tv0,0(a1) */\n/* 54:\taddu\tv1,v1,t6 */\n/* 58:\tlhu\ta2,0(v1) */\n/* 5c:\tlui\tv0,0x0 */\n/* 60:\taddu\tv0,v0,a0 */\n/* 64:\tlbu\tv0,0(v0) */\n/* 68:\tsll\tv0,v0,0x18 */\n/* 6c:\tsra\tv1,v0,0x18 */\n/* 70:\tsra\tv0,v0,0x1f */\n/* 74:\tori\tv0,v0,0x1 */\n/* 78:\tmult\tv1,v0 */\n/* 7c:\tmflo\tv1 */\n/* 80:\taddiu\tv1,v1,-30 */\n/* 84:\tnop */\n/* 88:\tblezl\tv1,ac */\n/* 8c:\tsll\tv0,t0,0x10 */\n/* 90:\tblez\tv0,a0 */\n/* 94:\tandi\tv0,a2,0xfdff */\n/* 98:\tj\ta8 */\n/* 9c:\tori\ta2,v0,0x100 */\n/* a0:\tandi\tv0,a2,0xfeff */\n/* a4:\tori\ta2,v0,0x200 */\n/* a8:\tsll\tv0,t0,0x10 */\n/* ac:\tsra\tv0,v0,0x10 */\n/* b0:\tlui\tat,0x0 */\n/* b4:\taddu\tat,at,v0 */\n/* b8:\tlbu\tv0,0(at) */\n/* bc:\tsll\tv0,v0,0x18 */\n/* c0:\tsra\tv1,v0,0x18 */\n/* c4:\tsra\tv0,v0,0x1f */\n/* c8:\tori\tv0,v0,0x1 */\n/* cc:\tmult\tv1,v0 */\n/* d0:\tmflo\tv1 */\n/* d4:\taddiu\tv1,v1,-30 */\n/* d8:\tnop */\n/* dc:\tblezl\tv1,100 */\n/* e0:\tsll\tv0,t0,0x10 */\n/* e4:\tblez\tv0,f4 */\n/* e8:\tandi\tv0,a2,0xfbff */\n/* ec:\tj\tfc */\n/* f0:\tori\ta2,v0,0x800 */\n/* f4:\tandi\tv0,a2,0xf7ff */\n/* f8:\tori\ta2,v0,0x400 */\n/* fc:\tsll\tv0,t0,0x10 */\n/* 100:\tsra\ta1,v0,0xf */\n/* 104:\taddu\tv0,a1,t4 */\n/* 108:\tsh\ta2,0(v0) */\n/* 10c:\taddu\ta3,a1,t3 */\n/* 110:\taddu\ta0,a1,t5 */\n/* 114:\tlhu\tv0,0(a0) */\n/* 118:\txor\tv0,a2,v0 */\n/* 11c:\tand\tv0,a2,v0 */\n/* 120:\tsh\tv0,0(a3) */\n/* 124:\tandi\tv1,a2,0xffff */\n/* 128:\tlhu\tv0,0(a0) */\n/* 12c:\tbeq\tv1,v0,14c */\n/* 130:\tli\tv0,10 */\n/* 134:\taddu\tv1,a1,t2 */\n/* 138:\tsh\tv0,0(v1) */\n/* 13c:\taddu\tv1,a1,t1 */\n/* 140:\tlhu\tv0,0(a3) */\n/* 144:\tj\t19c */\n/* 148:\tsh\tv0,0(v1) */\n/* 14c:\tsll\tv0,t0,0x10 */\n/* 150:\tsra\ta0,v0,0xf */\n/* 154:\taddu\ta1,a0,t2 */\n/* 158:\tlh\tv0,0(a1) */\n/* 15c:\tblez\tv0,180 */\n/* 160:\tmove\tv1,v0 */\n/* 164:\taddiu\tv0,v1,-1 */\n/* 168:\tsh\tv0,0(a1) */\n/* 16c:\taddu\tv1,a0,t1 */\n/* 170:\taddu\tv0,a0,t3 */\n/* 174:\tlhu\tv0,0(v0) */\n/* 178:\tj\t19c */\n/* 17c:\tsh\tv0,0(v1) */\n/* 180:\tsll\tv0,t0,0x10 */\n/* 184:\tsra\tv0,v0,0xf */\n/* 188:\taddu\ta0,v0,t2 */\n/* 18c:\tli\tv1,1 */\n/* 190:\tsh\tv1,0(a0) */\n/* 194:\taddu\tv0,v0,t1 */\n/* 198:\tsh\ta2,0(v0) */\n/* 19c:\taddiu\tv0,t0,1 */\n/* 1a0:\tmove\tt0,v0 */\n/* 1a4:\tsll\tv0,v0,0x10 */\n/* 1a8:\tsra\tv0,v0,0x10 */\n/* 1ac:\tslti\tv0,v0,4 */\n/* 1b0:\tbnez\tv0,3c */\n/* 1b4:\tsll\ta0,t0,0x10 */\n/* 1b8:\taddiu\tsp,sp,8 */\n/* 1bc:\tjr\tra */\n/* 1c0:\tnop */\n/* \t... */\nvoid ContDataUpdate(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ContDataUpdate': unmodelled control transfer 'blezl' at 0x88 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void ContDataUpdate(void) {\n s16 *temp_a1_2;\n s16 temp_v0;\n s16 temp_v0_6;\n s16 var_t0;\n s32 temp_a0;\n s32 temp_a0_3;\n s32 temp_a1;\n s32 temp_v0_3;\n s32 temp_v0_5;\n s32 temp_v0_7;\n s32 var_a0;\n u16 *temp_a0_2;\n u16 *temp_a3;\n u16 var_a2;\n u8 temp_v0_2;\n u8 temp_v0_4;\n\n var_t0 = 0;\n var_a0 = 0 << 0x10;\n do {\n temp_a0 = var_a0 >> 0x10;\n D_800D1350_D1F50[temp_a0] = D_800D5546_D6146[temp_a0];\n var_a2 = (u16) D_800CDA7C_CE67C[temp_a0];\n temp_v0_2 = (u8) D_800CBB6E_CC76E[temp_a0];\n temp_v0_3 = ((s32) (temp_v0_2 << 0x18) >> 0x1F) | 1;\n if ((((s8) temp_v0_2 * temp_v0_3) - 0x1E) > 0) {\n if (temp_v0_3 > 0) {\n var_a2 = (var_a2 & 0xFDFF) | 0x100;\n } else {\n var_a2 = (var_a2 & 0xFEFF) | 0x200;\n }\n }\n temp_v0_4 = (u8) D_800D20A1_D2CA1[var_t0];\n temp_v0_5 = ((s32) (temp_v0_4 << 0x18) >> 0x1F) | 1;\n if ((((s8) temp_v0_4 * temp_v0_5) - 0x1E) > 0) {\n if (temp_v0_5 > 0) {\n var_a2 = (var_a2 & 0xFBFF) | 0x800;\n } else {\n var_a2 = (var_a2 & 0xF7FF) | 0x400;\n }\n }\n temp_a1 = (s32) (var_t0 << 0x10) >> 0xF;\n *(temp_a1 + D_800D5546_D6146) = var_a2;\n temp_a3 = temp_a1 + D_800C9520_CA120;\n temp_a0_2 = temp_a1 + D_800D1350_D1F50;\n *temp_a3 = var_a2 & (var_a2 ^ *temp_a0_2);\n if ((var_a2 & 0xFFFF) != *temp_a0_2) {\n *(temp_a1 + D_800D10F8_D1CF8) = 0xA;\n *(temp_a1 + D_800D0590_D1190) = *temp_a3;\n } else {\n temp_a0_3 = (s32) (var_t0 << 0x10) >> 0xF;\n temp_a1_2 = temp_a0_3 + D_800D10F8_D1CF8;\n temp_v0_6 = *temp_a1_2;\n if (temp_v0_6 > 0) {\n *temp_a1_2 = temp_v0_6 - 1;\n *(temp_a0_3 + D_800D0590_D1190) = *(temp_a0_3 + D_800C9520_CA120);\n } else {\n temp_v0_7 = (s32) (var_t0 << 0x10) >> 0xF;\n *(temp_v0_7 + D_800D10F8_D1CF8) = 1;\n *(temp_v0_7 + D_800D0590_D1190) = var_a2;\n }\n }\n temp_v0 = var_t0 + 1;\n var_t0 = temp_v0;\n var_a0 = var_t0 << 0x10;\n } while (temp_v0 < 4);\n}\n","score":37,"maxScore":120,"compileErrors":null,"breakdown":{"insert":7,"delete":5,"replace":1,"opMismatch":0,"argMismatch":24},"quality":{"score":88,"lines":67,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":37,"maxScore":120,"ratio":0.30833333333333335,"kinds":{"insert":7,"delete":5,"replace":1,"opMismatch":0,"argMismatch":24}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ContDataUpdate` — benchmark function marioparty3:ContDataUpdate:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 ContDataUpdate\n addiu\t$sp, $sp, -8\n move\t$t0, $zero\n lui\t$t5, %hi(D_800D1350_D1F50)\n addiu\t$t5, $t5, %lo(D_800D1350_D1F50)\n lui\t$t4, %hi(D_800D5546_D6146)\n addiu\t$t4, $t4, %lo(D_800D5546_D6146)\n lui\t$t6, %hi(D_800CDA7C_CE67C)\n addiu\t$t6, $t6, %lo(D_800CDA7C_CE67C)\n lui\t$t3, %hi(D_800C9520_CA120)\n addiu\t$t3, $t3, %lo(D_800C9520_CA120)\n lui\t$t2, %hi(D_800D10F8_D1CF8)\n addiu\t$t2, $t2, %lo(D_800D10F8_D1CF8)\n lui\t$t1, %hi(D_800D0590_D1190)\n addiu\t$t1, $t1, %lo(D_800D0590_D1190)\n sll\t$a0, $t0, 0x10\n.L3c:\n sra\t$a0, $a0, 0x10\n sll\t$v1, $a0, 0x1\n addu\t$a1, $v1, $t5\n addu\t$v0, $v1, $t4\n lhu\t$v0, 0($v0)\n sh\t$v0, 0($a1)\n addu\t$v1, $v1, $t6\n lhu\t$a2, 0($v1)\n lui\t$v0, %hi(D_800CBB6E_CC76E)\n addu\t$v0, $v0, $a0\n lbu\t$v0, %lo(D_800CBB6E_CC76E)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n sra\t$v0, $v0, 0x1f\n ori\t$v0, $v0, 0x1\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$v1, $v1, -30\n nop\n blezl\t$v1, .Lac\n sll\t$v0, $t0, 0x10\n blez\t$v0, .La0\n andi\t$v0, $a2, 0xfdff\n j\t.La8\n ori\t$a2, $v0, 0x100\n.La0:\n andi\t$v0, $a2, 0xfeff\n ori\t$a2, $v0, 0x200\n.La8:\n sll\t$v0, $t0, 0x10\n.Lac:\n sra\t$v0, $v0, 0x10\n lui\t$at, %hi(D_800D20A1_D2CA1)\n addu\t$at, $at, $v0\n lbu\t$v0, %lo(D_800D20A1_D2CA1)($at)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n sra\t$v0, $v0, 0x1f\n ori\t$v0, $v0, 0x1\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$v1, $v1, -30\n nop\n blezl\t$v1, .L100\n sll\t$v0, $t0, 0x10\n blez\t$v0, .Lf4\n andi\t$v0, $a2, 0xfbff\n j\t.Lfc\n ori\t$a2, $v0, 0x800\n.Lf4:\n andi\t$v0, $a2, 0xf7ff\n ori\t$a2, $v0, 0x400\n.Lfc:\n sll\t$v0, $t0, 0x10\n.L100:\n sra\t$a1, $v0, 0xf\n addu\t$v0, $a1, $t4\n sh\t$a2, 0($v0)\n addu\t$a3, $a1, $t3\n addu\t$a0, $a1, $t5\n lhu\t$v0, 0($a0)\n xor\t$v0, $a2, $v0\n and\t$v0, $a2, $v0\n sh\t$v0, 0($a3)\n andi\t$v1, $a2, 0xffff\n lhu\t$v0, 0($a0)\n beq\t$v1, $v0, .L14c\n li\t$v0, 10\n addu\t$v1, $a1, $t2\n sh\t$v0, 0($v1)\n addu\t$v1, $a1, $t1\n lhu\t$v0, 0($a3)\n j\t.L19c\n sh\t$v0, 0($v1)\n.L14c:\n sll\t$v0, $t0, 0x10\n sra\t$a0, $v0, 0xf\n addu\t$a1, $a0, $t2\n lh\t$v0, 0($a1)\n blez\t$v0, .L180\n move\t$v1, $v0\n addiu\t$v0, $v1, -1\n sh\t$v0, 0($a1)\n addu\t$v1, $a0, $t1\n addu\t$v0, $a0, $t3\n lhu\t$v0, 0($v0)\n j\t.L19c\n sh\t$v0, 0($v1)\n.L180:\n sll\t$v0, $t0, 0x10\n sra\t$v0, $v0, 0xf\n addu\t$a0, $v0, $t2\n li\t$v1, 1\n sh\t$v1, 0($a0)\n addu\t$v0, $v0, $t1\n sh\t$a2, 0($v0)\n.L19c:\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, 4\n bnez\t$v0, .L3c\n sll\t$a0, $t0, 0x10\n addiu\t$sp, $sp, 8\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 ContDataUpdate(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ContDataUpdate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ContDataUpdate` — benchmark function marioparty3:ContDataUpdate:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:ContDataUpdate: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:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tlui\tt5,0x0\n c:\taddiu\tt5,t5,0\n 10:\tlui\tt4,0x0\n 14:\taddiu\tt4,t4,0\n 18:\tlui\tt6,0x0\n 1c:\taddiu\tt6,t6,0\n 20:\tlui\tt3,0x0\n 24:\taddiu\tt3,t3,0\n 28:\tlui\tt2,0x0\n 2c:\taddiu\tt2,t2,0\n 30:\tlui\tt1,0x0\n 34:\taddiu\tt1,t1,0\n 38:\tsll\ta0,t0,0x10\n 3c:\tsra\ta0,a0,0x10\n 40:\tsll\tv1,a0,0x1\n 44:\taddu\ta1,v1,t5\n 48:\taddu\tv0,v1,t4\n 4c:\tlhu\tv0,0(v0)\n 50:\tsh\tv0,0(a1)\n 54:\taddu\tv1,v1,t6\n 58:\tlhu\ta2,0(v1)\n 5c:\tlui\tv0,0x0\n 60:\taddu\tv0,v0,a0\n 64:\tlbu\tv0,0(v0)\n 68:\tsll\tv0,v0,0x18\n 6c:\tsra\tv1,v0,0x18\n 70:\tsra\tv0,v0,0x1f\n 74:\tori\tv0,v0,0x1\n 78:\tmult\tv1,v0\n 7c:\tmflo\tv1\n 80:\taddiu\tv1,v1,-30\n 84:\tnop\n 88:\tblezl\tv1,ac \n 8c:\tsll\tv0,t0,0x10\n 90:\tblez\tv0,a0 \n 94:\tandi\tv0,a2,0xfdff\n 98:\tj\ta8 \n 9c:\tori\ta2,v0,0x100\n a0:\tandi\tv0,a2,0xfeff\n a4:\tori\ta2,v0,0x200\n a8:\tsll\tv0,t0,0x10\n ac:\tsra\tv0,v0,0x10\n b0:\tlui\tat,0x0\n b4:\taddu\tat,at,v0\n b8:\tlbu\tv0,0(at)\n bc:\tsll\tv0,v0,0x18\n c0:\tsra\tv1,v0,0x18\n c4:\tsra\tv0,v0,0x1f\n c8:\tori\tv0,v0,0x1\n cc:\tmult\tv1,v0\n d0:\tmflo\tv1\n d4:\taddiu\tv1,v1,-30\n d8:\tnop\n dc:\tblezl\tv1,100 \n e0:\tsll\tv0,t0,0x10\n e4:\tblez\tv0,f4 \n e8:\tandi\tv0,a2,0xfbff\n ec:\tj\tfc \n f0:\tori\ta2,v0,0x800\n f4:\tandi\tv0,a2,0xf7ff\n f8:\tori\ta2,v0,0x400\n fc:\tsll\tv0,t0,0x10\n 100:\tsra\ta1,v0,0xf\n 104:\taddu\tv0,a1,t4\n 108:\tsh\ta2,0(v0)\n 10c:\taddu\ta3,a1,t3\n 110:\taddu\ta0,a1,t5\n 114:\tlhu\tv0,0(a0)\n 118:\txor\tv0,a2,v0\n 11c:\tand\tv0,a2,v0\n 120:\tsh\tv0,0(a3)\n 124:\tandi\tv1,a2,0xffff\n 128:\tlhu\tv0,0(a0)\n 12c:\tbeq\tv1,v0,14c \n 130:\tli\tv0,10\n 134:\taddu\tv1,a1,t2\n 138:\tsh\tv0,0(v1)\n 13c:\taddu\tv1,a1,t1\n 140:\tlhu\tv0,0(a3)\n 144:\tj\t19c \n 148:\tsh\tv0,0(v1)\n 14c:\tsll\tv0,t0,0x10\n 150:\tsra\ta0,v0,0xf\n 154:\taddu\ta1,a0,t2\n 158:\tlh\tv0,0(a1)\n 15c:\tblez\tv0,180 \n 160:\tmove\tv1,v0\n 164:\taddiu\tv0,v1,-1\n 168:\tsh\tv0,0(a1)\n 16c:\taddu\tv1,a0,t1\n 170:\taddu\tv0,a0,t3\n 174:\tlhu\tv0,0(v0)\n 178:\tj\t19c \n 17c:\tsh\tv0,0(v1)\n 180:\tsll\tv0,t0,0x10\n 184:\tsra\tv0,v0,0xf\n 188:\taddu\ta0,v0,t2\n 18c:\tli\tv1,1\n 190:\tsh\tv1,0(a0)\n 194:\taddu\tv0,v0,t1\n 198:\tsh\ta2,0(v0)\n 19c:\taddiu\tv0,t0,1\n 1a0:\tmove\tt0,v0\n 1a4:\tsll\tv0,v0,0x10\n 1a8:\tsra\tv0,v0,0x10\n 1ac:\tslti\tv0,v0,4\n 1b0:\tbnez\tv0,3c \n 1b4:\tsll\ta0,t0,0x10\n 1b8:\taddiu\tsp,sp,8\n 1bc:\tjr\tra\n 1c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-2fc48a130813fa67/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 ContDataUpdate\n00000000 *UND*\t00000000 D_800D1350_D1F50\n00000000 *UND*\t00000000 D_800D5546_D6146\n00000000 *UND*\t00000000 D_800CDA7C_CE67C\n00000000 *UND*\t00000000 D_800C9520_CA120\n00000000 *UND*\t00000000 D_800D10F8_D1CF8\n00000000 *UND*\t00000000 D_800D0590_D1190\n00000000 *UND*\t00000000 D_800CBB6E_CC76E\n00000000 *UND*\t00000000 D_800D20A1_D2CA1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800D1350_D1F50\n0000000c R_MIPS_LO16 D_800D1350_D1F50\n00000010 R_MIPS_HI16 D_800D5546_D6146\n00000014 R_MIPS_LO16 D_800D5546_D6146\n00000018 R_MIPS_HI16 D_800CDA7C_CE67C\n0000001c R_MIPS_LO16 D_800CDA7C_CE67C\n00000020 R_MIPS_HI16 D_800C9520_CA120\n00000024 R_MIPS_LO16 D_800C9520_CA120\n00000028 R_MIPS_HI16 D_800D10F8_D1CF8\n0000002c R_MIPS_LO16 D_800D10F8_D1CF8\n00000030 R_MIPS_HI16 D_800D0590_D1190\n00000034 R_MIPS_LO16 D_800D0590_D1190\n0000005c R_MIPS_HI16 D_800CBB6E_CC76E\n00000064 R_MIPS_LO16 D_800CBB6E_CC76E\n00000098 R_MIPS_26 .text\n000000b0 R_MIPS_HI16 D_800D20A1_D2CA1\n000000b8 R_MIPS_LO16 D_800D20A1_D2CA1\n000000ec R_MIPS_26 .text\n00000144 R_MIPS_26 .text\n00000178 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 3c0d0000 25ad0000 '.....@!<...%...\n 0010 3c0c0000 258c0000 3c0e0000 25ce0000 <...%...<...%...\n 0020 3c0b0000 256b0000 3c0a0000 254a0000 <...%k..<...%J..\n 0030 3c090000 25290000 00082400 00042403 <...%)....$...$.\n 0040 00041840 006d2821 006c1021 94420000 ...@.m(!.l.!.B..\n 0050 a4a20000 006e1821 94660000 3c020000 .....n.!.f..<...\n 0060 00441021 90420000 00021600 00021e03 .D.!.B..........\n 0070 000217c3 34420001 00620018 00001812 ....4B...b......\n 0080 2463ffe2 00000000 58600008 00081400 $c......X`......\n 0090 18400003 30c2fdff 0800002a 34460100 .@..0......*4F..\n 00a0 30c2feff 34460200 00081400 00021403 0...4F..........\n 00b0 3c010000 00220821 90220000 00021600 <....\".!.\"......\n 00c0 00021e03 000217c3 34420001 00620018 ........4B...b..\n 00d0 00001812 2463ffe2 00000000 58600008 ....$c......X`..\n 00e0 00081400 18400003 30c2fbff 0800003f .....@..0......?\n 00f0 34460800 30c2f7ff 34460400 00081400 4F..0...4F......\n 0100 00022bc3 00ac1021 a4460000 00ab3821 ..+....!.F....8!\n 0110 00ad2021 94820000 00c21026 00c21024 .. !.......&...$\n 0120 a4e20000 30c3ffff 94820000 10620007 ....0........b..\n 0130 2402000a 00aa1821 a4620000 00a91821 $......!.b.....!\n 0140 94e20000 08000067 a4620000 00081400 .......g.b......\n 0150 000223c3 008a2821 84a20000 18400008 ..#...(!.....@..\n 0160 00401821 2462ffff a4a20000 00891821 .@.!$b.........!\n 0170 008b1021 94420000 08000067 a4620000 ...!.B.....g.b..\n 0180 00081400 000213c3 004a2021 24030001 .........J !$...\n 0190 a4830000 00491021 a4460000 25020001 .....I.!.F..%...\n 01a0 00404021 00021400 00021403 28420004 .@@!........(B..\n 01b0 1440ffa2 00082400 27bd0008 03e00008 .@....$.'.......\n 01c0 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0007ffe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ContDataUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 ContDataUpdate # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:DecodeData:gcc2.7.2","sym":"DecodeData","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","switch","call","jump-table"],"loc":34,"refSource":"void DecodeData(void *src, void *dest, s32 len, EDecodeType decodeType) {\n DecodeStruct decodeStruct;\n DecodeStruct *decodePtr = &decodeStruct;\n decodeStruct.src = (u8 *)src;\n decodeStruct.dest = (u8 *)dest;\n decodeStruct.len = len;\n decodeStruct.chunkLen = 1024;\n\n switch (decodeType) {\n case DECODE_NONE:\n HuDecodeNone(decodePtr);\n break;\n\n case DECODE_LZ:\n HuDecodeLZ(decodePtr);\n break;\n\n case DECODE_SLIDE:\n HuDecodeSlide(decodePtr);\n break;\n\n case DECODE_FSLIDE:\n case DECODE_FSLIDE_2:\n HuDecodeFslide(decodePtr);\n break;\n\n case DECODE_RLE:\n HuDecodeRLE(decodePtr);\n break;\n\n default:\n break;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/decode.c#L422-L455","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\tra,32(sp)\n 8:\tsw\ta0,20(sp)\n c:\tsw\ta1,24(sp)\n 10:\tsw\ta2,28(sp)\n 14:\tli\tv0,1024\n 18:\tsh\tv0,16(sp)\n 1c:\tsltiu\tv0,a3,6\n 20:\tbeqz\tv0,88 \n 24:\taddiu\tv1,sp,16\n 28:\tsll\tv0,a3,0x2\n 2c:\tlui\tat,0x0\n 30:\taddu\tat,at,v0\n 34:\tlw\tv0,0(at)\n 38:\tjr\tv0\n 3c:\tnop\n 40:\tjal\t0 \n 44:\tmove\ta0,v1\n 48:\tj\t88 \n 4c:\tnop\n 50:\tjal\t0 \n 54:\tmove\ta0,v1\n 58:\tj\t88 \n 5c:\tnop\n 60:\tjal\t0 \n 64:\tmove\ta0,v1\n 68:\tj\t88 \n 6c:\tnop\n 70:\tjal\t0 \n 74:\tmove\ta0,v1\n 78:\tj\t88 \n 7c:\tnop\n 80:\tjal\t0 \n 84:\tmove\ta0,v1\n 88:\tlw\tra,32(sp)\n 8c:\tjr\tra\n 90:\taddiu\tsp,sp,40\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0d7b2b9d8c52.i.gz","proto":{"DecodeData":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-642aa3e613f1830f/u.i\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\t00000094 DecodeData\n00000000 *UND*\t00000000 HuDecodeNone\n00000000 *UND*\t00000000 HuDecodeLZ\n00000000 *UND*\t00000000 HuDecodeSlide\n00000000 *UND*\t00000000 HuDecodeFslide\n00000000 *UND*\t00000000 HuDecodeRLE\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 .rodata\n00000034 R_MIPS_LO16 .rodata\n00000040 R_MIPS_26 HuDecodeNone\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 HuDecodeLZ\n00000058 R_MIPS_26 .text\n00000060 R_MIPS_26 HuDecodeSlide\n00000068 R_MIPS_26 .text\n00000070 R_MIPS_26 HuDecodeFslide\n00000078 R_MIPS_26 .text\n00000080 R_MIPS_26 HuDecodeRLE\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\n\n\nContents of section .text:\n 0000 27bdffd8 afbf0020 afa40014 afa50018 '...... ........\n 0010 afa6001c 24020400 a7a20010 2ce20006 ....$.......,...\n 0020 10400019 27a30010 00071080 3c010000 .@..'.......<...\n 0030 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0040 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0050 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0060 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0070 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0080 0c000000 00602021 8fbf0020 03e00008 .....` !... ....\n 0090 27bd0028 00000000 00000000 00000000 '..(............\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 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 00000040 00000050 00000060 00000070 ...@...P...`...p\n 0010 00000070 00000080 ...p.... \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 'DecodeData' — lift: cannot lift 'DecodeData': 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,-40 */\n/* 4:\tsw\tra,32(sp) */\n/* 8:\tsw\ta0,20(sp) */\n/* c:\tsw\ta1,24(sp) */\n/* 10:\tsw\ta2,28(sp) */\n/* 14:\tli\tv0,1024 */\n/* 18:\tsh\tv0,16(sp) */\n/* 1c:\tsltiu\tv0,a3,6 */\n/* 20:\tbeqz\tv0,88 */\n/* 24:\taddiu\tv1,sp,16 */\n/* 28:\tsll\tv0,a3,0x2 */\n/* 2c:\tlui\tat,0x0 */\n/* 30:\taddu\tat,at,v0 */\n/* 34:\tlw\tv0,0(at) */\n/* 38:\tjr\tv0 */\n/* 3c:\tnop */\n/* 40:\tjal\t0 */\n/* 44:\tmove\ta0,v1 */\n/* 48:\tj\t88 */\n/* 4c:\tnop */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ta0,v1 */\n/* 58:\tj\t88 */\n/* 5c:\tnop */\n/* 60:\tjal\t0 */\n/* 64:\tmove\ta0,v1 */\n/* 68:\tj\t88 */\n/* 6c:\tnop */\n/* 70:\tjal\t0 */\n/* 74:\tmove\ta0,v1 */\n/* 78:\tj\t88 */\n/* 7c:\tnop */\n/* 80:\tjal\t0 */\n/* 84:\tmove\ta0,v1 */\n/* 88:\tlw\tra,32(sp) */\n/* 8c:\tjr\tra */\n/* 90:\taddiu\tsp,sp,40 */\n/* \t... */\nvoid DecodeData(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'DecodeData': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":46,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'DecodeData': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void DecodeData(void *src, void *dest, s32 len, s32 decodeType) {\n s16 sp10;\n void *sp14;\n void *sp18;\n s32 sp1C;\n\n sp14 = src;\n sp18 = dest;\n sp1C = len;\n sp10 = 0x400;\n switch (decodeType) {\n case DECODE_NONE:\n HuDecodeNone((DecodeStruct *) &sp10);\n return;\n case DECODE_LZ:\n HuDecodeLZ((DecodeStruct *) &sp10);\n return;\n case DECODE_SLIDE:\n HuDecodeSlide((DecodeStruct *) &sp10);\n return;\n case DECODE_FSLIDE:\n case DECODE_FSLIDE_2:\n HuDecodeFslide((DecodeStruct *) &sp10);\n return;\n case DECODE_RLE:\n HuDecodeRLE((DecodeStruct *) &sp10);\n /* fallthrough */\n default:\n return;\n }\n}\n","score":13,"maxScore":37,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":5,"opMismatch":0,"argMismatch":4},"quality":{"score":96,"lines":30,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":13,"maxScore":37,"ratio":0.35135135135135137,"kinds":{"insert":0,"delete":4,"replace":5,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecodeData` — benchmark function marioparty3:DecodeData:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 DecodeData\n addiu\t$sp, $sp, -40\n sw\t$ra, 32($sp)\n sw\t$a0, 20($sp)\n sw\t$a1, 24($sp)\n sw\t$a2, 28($sp)\n li\t$v0, 1024\n sh\t$v0, 16($sp)\n sltiu\t$v0, $a3, 6\n beqz\t$v0, .L88\n addiu\t$v1, $sp, 16\n sll\t$v0, $a3, 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.L40:\n jal\tHuDecodeNone\n move\t$a0, $v1\n j\t.L88\n nop\n.L50:\n jal\tHuDecodeLZ\n move\t$a0, $v1\n j\t.L88\n nop\n.L60:\n jal\tHuDecodeSlide\n move\t$a0, $v1\n j\t.L88\n nop\n.L70:\n jal\tHuDecodeFslide\n move\t$a0, $v1\n j\t.L88\n nop\n.L80:\n jal\tHuDecodeRLE\n move\t$a0, $v1\n.L88:\n lw\t$ra, 32($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n.rodata\nglabel jtbl_rodata_0\n.word .L40\n.word .L50\n.word .L60\n.word .L70\n.word .L70\n.word .L80\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-0d7b2b9d8c52.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid DecodeData(void *src, void *dest, s32 len, EDecodeType decodeType);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecodeData # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecodeData` — benchmark function marioparty3:DecodeData:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:DecodeData: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:\taddiu\tsp,sp,-40\n 4:\tsw\tra,32(sp)\n 8:\tsw\ta0,20(sp)\n c:\tsw\ta1,24(sp)\n 10:\tsw\ta2,28(sp)\n 14:\tli\tv0,1024\n 18:\tsh\tv0,16(sp)\n 1c:\tsltiu\tv0,a3,6\n 20:\tbeqz\tv0,88 \n 24:\taddiu\tv1,sp,16\n 28:\tsll\tv0,a3,0x2\n 2c:\tlui\tat,0x0\n 30:\taddu\tat,at,v0\n 34:\tlw\tv0,0(at)\n 38:\tjr\tv0\n 3c:\tnop\n 40:\tjal\t0 \n 44:\tmove\ta0,v1\n 48:\tj\t88 \n 4c:\tnop\n 50:\tjal\t0 \n 54:\tmove\ta0,v1\n 58:\tj\t88 \n 5c:\tnop\n 60:\tjal\t0 \n 64:\tmove\ta0,v1\n 68:\tj\t88 \n 6c:\tnop\n 70:\tjal\t0 \n 74:\tmove\ta0,v1\n 78:\tj\t88 \n 7c:\tnop\n 80:\tjal\t0 \n 84:\tmove\ta0,v1\n 88:\tlw\tra,32(sp)\n 8c:\tjr\tra\n 90:\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-gcc272-642aa3e613f1830f/u.i\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\t00000094 DecodeData\n00000000 *UND*\t00000000 HuDecodeNone\n00000000 *UND*\t00000000 HuDecodeLZ\n00000000 *UND*\t00000000 HuDecodeSlide\n00000000 *UND*\t00000000 HuDecodeFslide\n00000000 *UND*\t00000000 HuDecodeRLE\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 .rodata\n00000034 R_MIPS_LO16 .rodata\n00000040 R_MIPS_26 HuDecodeNone\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 HuDecodeLZ\n00000058 R_MIPS_26 .text\n00000060 R_MIPS_26 HuDecodeSlide\n00000068 R_MIPS_26 .text\n00000070 R_MIPS_26 HuDecodeFslide\n00000078 R_MIPS_26 .text\n00000080 R_MIPS_26 HuDecodeRLE\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\n\n\nContents of section .text:\n 0000 27bdffd8 afbf0020 afa40014 afa50018 '...... ........\n 0010 afa6001c 24020400 a7a20010 2ce20006 ....$.......,...\n 0020 10400019 27a30010 00071080 3c010000 .@..'.......<...\n 0030 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0040 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0050 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0060 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0070 0c000000 00602021 08000022 00000000 .....` !...\"....\n 0080 0c000000 00602021 8fbf0020 03e00008 .....` !... ....\n 0090 27bd0028 00000000 00000000 00000000 '..(............\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 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 00000040 00000050 00000060 00000070 ...@...P...`...p\n 0010 00000070 00000080 ...p.... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecodeData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 DecodeData # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:FileSeek:gcc2.7.2","sym":"FileSeek","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","struct","pointer","switch","ternary","bitwise","comparison-tree"],"loc":25,"refSource":"void FileSeek(HuFileInfoD *info, s32 arg1, s32 arg2) {\n switch (arg2) {\n case 0:\n arg2 = (u32)(info->bytes + arg1);\n break;\n case 1:\n arg2 = (u32)(info->bytesCopy + info->unkE + arg1);\n break;\n case 2:\n arg2 = (u32)(info->bytes + info->size + arg1);\n break;\n default:\n return;\n }\n arg2 = ((u32)arg2 < (u32)info->bytes) ? (u32)info->bytes : (u32)arg2;\n arg2 = ((u32)arg2 >= (u32)(info->bytes + info->size)) ? (u32)(info->bytes + info->size - 1) : (u32)arg2;\n\n if (((u32)arg2 < (u32)info->bytesCopy) || ((u32)arg2 >= (u32)(info->bytesCopy + 0x400))) {\n info->unkC = 1;\n info->unkE = arg2 & 1;\n info->bytesCopy = (u8 *)(arg2 - info->unkE);\n } else {\n info->unkE = arg2 - (u32)info->bytesCopy;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/data.c#L304-L328","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta2,v0,40 \n 8:\tslti\tv0,a2,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta2,34 \n 18:\tnop\n 1c:\tj\td0 \n 20:\tnop\n 24:\tbeq\ta2,v0,50 \n 28:\tnop\n 2c:\tj\td0 \n 30:\tnop\n 34:\tlw\tv0,16(a0)\n 38:\tj\t60 \n 3c:\taddu\ta2,a1,v0\n 40:\tlh\tv1,14(a0)\n 44:\tlw\tv0,20(a0)\n 48:\tj\t5c \n 4c:\taddu\ta2,v1,v0\n 50:\tlw\tv1,16(a0)\n 54:\tlw\tv0,4(a0)\n 58:\taddu\ta2,v1,v0\n 5c:\taddu\ta2,a2,a1\n 60:\tlw\tv1,16(a0)\n 64:\tsltu\tv0,a2,v1\n 68:\tbnezl\tv0,70 \n 6c:\tmove\ta2,v1\n 70:\tlw\tv0,16(a0)\n 74:\tlw\tv1,4(a0)\n 78:\taddu\tv1,v0,v1\n 7c:\tsltu\tv0,a2,v1\n 80:\tbnez\tv0,8c \n 84:\tnop\n 88:\taddiu\ta2,v1,-1\n 8c:\tlw\tv1,20(a0)\n 90:\tsltu\tv0,a2,v1\n 94:\tbnez\tv0,ac \n 98:\tli\tv0,1\n 9c:\taddiu\tv0,v1,1024\n a0:\tsltu\tv0,a2,v0\n a4:\tbnez\tv0,c4 \n a8:\tli\tv0,1\n ac:\tsh\tv0,12(a0)\n b0:\tandi\tv0,a2,0x1\n b4:\tsh\tv0,14(a0)\n b8:\tsubu\tv0,a2,v0\n bc:\tj\td0 \n c0:\tsw\tv0,20(a0)\n c4:\tlhu\tv0,22(a0)\n c8:\tsubu\tv0,a2,v0\n cc:\tsh\tv0,14(a0)\n d0:\tjr\tra\n d4:\tnop\n\t...\n","proto":{"FileSeek":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9aacbde39fae8cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d8 FileSeek\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n0000002c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n000000bc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 10c2000e 28c20002 50400005 $.......(...P@..\n 0010 24020002 10c00007 00000000 08000034 $..............4\n 0020 00000000 10c2000a 00000000 08000034 ...............4\n 0030 00000000 8c820010 08000018 00a23021 ..............0!\n 0040 8483000e 8c820014 08000017 00623021 .............b0!\n 0050 8c830010 8c820004 00623021 00c53021 .........b0!..0!\n 0060 8c830010 00c3102b 54400001 00603021 .......+T@...`0!\n 0070 8c820010 8c830004 00431821 00c3102b .........C.!...+\n 0080 14400002 00000000 2466ffff 8c830014 .@......$f......\n 0090 00c3102b 14400005 24020001 24620400 ...+.@..$...$b..\n 00a0 00c2102b 14400007 24020001 a482000c ...+.@..$.......\n 00b0 30c20001 a482000e 00c21023 08000034 0..........#...4\n 00c0 ac820014 94820016 00c21023 a482000e ...........#....\n 00d0 03e00008 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,"outcome":"declined","source":"/* asmlift could not decompile 'FileSeek' — lift: cannot lift 'FileSeek': 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\ta2,v0,40 */\n/* 8:\tslti\tv0,a2,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta2,34 */\n/* 18:\tnop */\n/* 1c:\tj\td0 */\n/* 20:\tnop */\n/* 24:\tbeq\ta2,v0,50 */\n/* 28:\tnop */\n/* 2c:\tj\td0 */\n/* 30:\tnop */\n/* 34:\tlw\tv0,16(a0) */\n/* 38:\tj\t60 */\n/* 3c:\taddu\ta2,a1,v0 */\n/* 40:\tlh\tv1,14(a0) */\n/* 44:\tlw\tv0,20(a0) */\n/* 48:\tj\t5c */\n/* 4c:\taddu\ta2,v1,v0 */\n/* 50:\tlw\tv1,16(a0) */\n/* 54:\tlw\tv0,4(a0) */\n/* 58:\taddu\ta2,v1,v0 */\n/* 5c:\taddu\ta2,a2,a1 */\n/* 60:\tlw\tv1,16(a0) */\n/* 64:\tsltu\tv0,a2,v1 */\n/* 68:\tbnezl\tv0,70 */\n/* 6c:\tmove\ta2,v1 */\n/* 70:\tlw\tv0,16(a0) */\n/* 74:\tlw\tv1,4(a0) */\n/* 78:\taddu\tv1,v0,v1 */\n/* 7c:\tsltu\tv0,a2,v1 */\n/* 80:\tbnez\tv0,8c */\n/* 84:\tnop */\n/* 88:\taddiu\ta2,v1,-1 */\n/* 8c:\tlw\tv1,20(a0) */\n/* 90:\tsltu\tv0,a2,v1 */\n/* 94:\tbnez\tv0,ac */\n/* 98:\tli\tv0,1 */\n/* 9c:\taddiu\tv0,v1,1024 */\n/* a0:\tsltu\tv0,a2,v0 */\n/* a4:\tbnez\tv0,c4 */\n/* a8:\tli\tv0,1 */\n/* ac:\tsh\tv0,12(a0) */\n/* b0:\tandi\tv0,a2,0x1 */\n/* b4:\tsh\tv0,14(a0) */\n/* b8:\tsubu\tv0,a2,v0 */\n/* bc:\tj\td0 */\n/* c0:\tsw\tv0,20(a0) */\n/* c4:\tlhu\tv0,22(a0) */\n/* c8:\tsubu\tv0,a2,v0 */\n/* cc:\tsh\tv0,14(a0) */\n/* d0:\tjr\tra */\n/* d4:\tnop */\n/* \t... */\nvoid FileSeek(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'FileSeek': unmodelled control transfer 'beqzl' at 0xc — 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 'FileSeek': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void FileSeek(void *arg0, s32 arg1, s32 arg2) {\n s16 temp_v0;\n s32 var_a2_2;\n u32 temp_v1;\n u32 temp_v1_2;\n u32 temp_v1_3;\n u32 var_a2;\n\n switch (arg2) { /* irregular */\n case 0:\n var_a2 = arg1 + arg0->unk10;\nblock_12:\n temp_v1 = arg0->unk10;\n if (var_a2 < temp_v1) {\n var_a2 = temp_v1;\n }\n temp_v1_2 = arg0->unk10 + arg0->unk4;\n if (var_a2 >= temp_v1_2) {\n var_a2 = temp_v1_2 - 1;\n }\n temp_v1_3 = arg0->unk14;\n if ((var_a2 < temp_v1_3) || (var_a2 >= (u32) (temp_v1_3 + 0x400))) {\n arg0->unkC = 1;\n temp_v0 = var_a2 & 1;\n arg0->unkE = temp_v0;\n arg0->unk14 = (u32) (var_a2 - temp_v0);\n return;\n }\n arg0->unkE = (s16) (var_a2 - arg0->unk16);\n return;\n case 1:\n var_a2_2 = arg0->unkE + arg0->unk14;\nblock_11:\n var_a2 = var_a2_2 + arg1;\n goto block_12;\n case 2:\n var_a2_2 = arg0->unk10 + arg0->unk4;\n goto block_11;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":74,"lines":39,"gotos":2,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5582: warning: dereferencing `void *' pointer","/c.i:5582: request for member `unk10' in something not a structure or union","/c.i:5584: warning: dereferencing `void *' pointer","/c.i:5584: request for member `unk10' in something not a structure or union","/c.i:5588: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FileSeek` — benchmark function marioparty3:FileSeek:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel FileSeek\n li\t$v0, 1\n beq\t$a2, $v0, .L40\n slti\t$v0, $a2, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a2, .L34\n nop\n j\t.Ld0\n nop\n.L24:\n beq\t$a2, $v0, .L50\n nop\n j\t.Ld0\n nop\n.L34:\n lw\t$v0, 16($a0)\n j\t.L60\n addu\t$a2, $a1, $v0\n.L40:\n lh\t$v1, 14($a0)\n lw\t$v0, 20($a0)\n j\t.L5c\n addu\t$a2, $v1, $v0\n.L50:\n lw\t$v1, 16($a0)\n lw\t$v0, 4($a0)\n addu\t$a2, $v1, $v0\n.L5c:\n addu\t$a2, $a2, $a1\n.L60:\n lw\t$v1, 16($a0)\n sltu\t$v0, $a2, $v1\n bnezl\t$v0, .L70\n move\t$a2, $v1\n.L70:\n lw\t$v0, 16($a0)\n lw\t$v1, 4($a0)\n addu\t$v1, $v0, $v1\n sltu\t$v0, $a2, $v1\n bnez\t$v0, .L8c\n nop\n addiu\t$a2, $v1, -1\n.L8c:\n lw\t$v1, 20($a0)\n sltu\t$v0, $a2, $v1\n bnez\t$v0, .Lac\n li\t$v0, 1\n addiu\t$v0, $v1, 1024\n sltu\t$v0, $a2, $v0\n bnez\t$v0, .Lc4\n li\t$v0, 1\n.Lac:\n sh\t$v0, 12($a0)\n andi\t$v0, $a2, 0x1\n sh\t$v0, 14($a0)\n subu\t$v0, $a2, $v0\n j\t.Ld0\n sw\t$v0, 20($a0)\n.Lc4:\n lhu\t$v0, 22($a0)\n subu\t$v0, $a2, $v0\n sh\t$v0, 14($a0)\n.Ld0:\n jr\t$ra\n 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 FileSeek # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FileSeek` — benchmark function marioparty3:FileSeek:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:FileSeek: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:\tbeq\ta2,v0,40 \n 8:\tslti\tv0,a2,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta2,34 \n 18:\tnop\n 1c:\tj\td0 \n 20:\tnop\n 24:\tbeq\ta2,v0,50 \n 28:\tnop\n 2c:\tj\td0 \n 30:\tnop\n 34:\tlw\tv0,16(a0)\n 38:\tj\t60 \n 3c:\taddu\ta2,a1,v0\n 40:\tlh\tv1,14(a0)\n 44:\tlw\tv0,20(a0)\n 48:\tj\t5c \n 4c:\taddu\ta2,v1,v0\n 50:\tlw\tv1,16(a0)\n 54:\tlw\tv0,4(a0)\n 58:\taddu\ta2,v1,v0\n 5c:\taddu\ta2,a2,a1\n 60:\tlw\tv1,16(a0)\n 64:\tsltu\tv0,a2,v1\n 68:\tbnezl\tv0,70 \n 6c:\tmove\ta2,v1\n 70:\tlw\tv0,16(a0)\n 74:\tlw\tv1,4(a0)\n 78:\taddu\tv1,v0,v1\n 7c:\tsltu\tv0,a2,v1\n 80:\tbnez\tv0,8c \n 84:\tnop\n 88:\taddiu\ta2,v1,-1\n 8c:\tlw\tv1,20(a0)\n 90:\tsltu\tv0,a2,v1\n 94:\tbnez\tv0,ac \n 98:\tli\tv0,1\n 9c:\taddiu\tv0,v1,1024\n a0:\tsltu\tv0,a2,v0\n a4:\tbnez\tv0,c4 \n a8:\tli\tv0,1\n ac:\tsh\tv0,12(a0)\n b0:\tandi\tv0,a2,0x1\n b4:\tsh\tv0,14(a0)\n b8:\tsubu\tv0,a2,v0\n bc:\tj\td0 \n c0:\tsw\tv0,20(a0)\n c4:\tlhu\tv0,22(a0)\n c8:\tsubu\tv0,a2,v0\n cc:\tsh\tv0,14(a0)\n d0:\tjr\tra\n d4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-f9aacbde39fae8cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d8 FileSeek\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n0000002c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n000000bc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 10c2000e 28c20002 50400005 $.......(...P@..\n 0010 24020002 10c00007 00000000 08000034 $..............4\n 0020 00000000 10c2000a 00000000 08000034 ...............4\n 0030 00000000 8c820010 08000018 00a23021 ..............0!\n 0040 8483000e 8c820014 08000017 00623021 .............b0!\n 0050 8c830010 8c820004 00623021 00c53021 .........b0!..0!\n 0060 8c830010 00c3102b 54400001 00603021 .......+T@...`0!\n 0070 8c820010 8c830004 00431821 00c3102b .........C.!...+\n 0080 14400002 00000000 2466ffff 8c830014 .@......$f......\n 0090 00c3102b 14400005 24020001 24620400 ...+.@..$...$b..\n 00a0 00c2102b 14400007 24020001 a482000c ...+.@..$.......\n 00b0 30c20001 a482000e 00c21023 08000034 0..........#...4\n 00c0 ac820014 94820016 00c21023 a482000e ...........#....\n 00d0 03e00008 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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FileSeek\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 FileSeek # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","store","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F024_FC24\n lui\t$at, %hi(frameBufferPool)\n sw\t$a0, %lo(frameBufferPool)($at)\n lui\t$at, %hi(frameBufferCount)\n sh\t$a1, %lo(frameBufferCount)($at)\n lui\t$at, %hi(frameBufferSegmentID)\n jr\t$ra\n sh\t$a2, %lo(frameBufferSegmentID)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F024_FC24 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F04C_FC4C:gcc2.7.2","sym":"func_8000F04C_FC4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":6,"refSource":"void func_8000F04C_FC4C(u64 **threadStacks) {\n gThread3Stack = *threadStacks++;\n gThreadOutStack = *threadStacks++;\n gThreadOutStackSize = *threadStacks++;\n gThreadYieldStack = *threadStacks;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz","proto":{"func_8000F04C_FC4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gThread3Stack"},{"name":"gThreadOutStack"},{"name":"gThreadOutStackSize"},{"name":"gThreadYieldStack"}],"outcome":"nonmatch","source":"void func_8000F04C_FC4C(s32 * a0) {\n gThread3Stack = *a0;\n gThreadOutStack = *(a0 + 1);\n gThreadOutStackSize = *(a0 + 1 + 1);\n gThreadYieldStack = (a0 + 1 + 1)[1];\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_8000F04C_FC4C(u64 **threadStacks) {\n u64 **temp_a0;\n\n gThread3Stack = threadStacks->unk0;\n temp_a0 = threadStacks + 4;\n gThreadOutStack = threadStacks->unk4;\n gThreadOutStackSize = temp_a0->unk4;\n gThreadYieldStack = (temp_a0 + 4)->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5517: request for member `unk0' in something not a structure or union","/c.i:5519: request for member `unk4' in something not a structure or union","/c.i:5520: request for member `unk4' in something not a structure or union","/c.i:5521: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":15,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F04C_FC4C\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThread3Stack)\n sw\t$v0, %lo(gThread3Stack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStack)\n sw\t$v0, %lo(gThreadOutStack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStackSize)\n sw\t$v0, %lo(gThreadOutStackSize)($at)\n lw\t$v0, 4($a0)\n lui\t$at, %hi(gThreadYieldStack)\n jr\t$ra\n sw\t$v0, %lo(gThreadYieldStack)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F04C_FC4C(u64 **threadStacks);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F04C_FC4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F088_FC88:gcc2.7.2","sym":"func_8000F088_FC88","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F088_FC88\n lui\t$at, %hi(gUCodeAddresses)\n jr\t$ra\n sw\t$a0, %lo(gUCodeAddresses)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F088_FC88(s32 *uCodeAdresses);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F088_FC88 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80011460_12060:gcc2.7.2","sym":"func_80011460_12060","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80011460_12060\n move\t$a3, $zero\n li\t$a2, 1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L54\n move\t$a1, $v0\n sll\t$v0, $a2, 0x10\n.L18:\n sra\t$v0, $v0, 0x10\n mult\t$v0, $a1\n mflo\t$v0\n addu\t$a3, $a3, $v0\n addiu\t$a0, $a0, 1\n addiu\t$v0, $a2, 1\n move\t$a2, $v0\n lbu\t$a1, 0($a0)\n sltu\t$v1, $zero, $a1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 28\n and\t$v1, $v1, $v0\n bnezl\t$v1, .L18\n sll\t$v0, $a2, 0x10\n.L54:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80011460_12060 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800123F4_12FF4:gcc2.7.2","sym":"func_800123F4_12FF4","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz","proto":{"func_800123F4_12FF4":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800D2008_D2C08"},{"name":"D_800D418E_D4D8E"}],"outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = (s16) D_800D2008_D2C08;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800123F4_12FF4\n lui\t$v0, %hi(D_800D2008_D2C08)\n lbu\t$v0, %lo(D_800D2008_D2C08)($v0)\n lui\t$at, %hi(D_800D418E_D4D8E)\n jr\t$ra\n sh\t$v0, %lo(D_800D418E_D4D8E)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800123F4_12FF4(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800123F4_12FF4 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80012B14_13714:gcc2.7.2","sym":"func_80012B14_13714","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["float","array","arithmetic","struct","call"],"loc":41,"refSource":"void func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos) {\n f32 x;\n f32 y;\n f32 z;\n f32 projectedX;\n f32 projectedY;\n f32 projectedZ;\n HuCamera *camera;\n HuMtx4F viewMtx;\n f32 f2;\n f32 f4;\n\n camera = &gCameraList[camIndex];\n guLookAtF(\n viewMtx,\n camera->pos.x,\n camera->pos.y,\n camera->pos.z,\n camera->at.x,\n camera->at.y,\n camera->at.z,\n camera->up.x,\n camera->up.y,\n camera->up.z);\n\n x = worldPos->x;\n y = worldPos->y;\n z = worldPos->z;\n x -= camera->pos.x;\n y -= camera->pos.y;\n z -= camera->pos.z;\n projectedX = ((x * viewMtx[0][0]) + (y * viewMtx[1][0])) + (z * viewMtx[2][0]);\n projectedY = ((x * viewMtx[0][1]) + (y * viewMtx[1][1])) + (z * viewMtx[2][1]);\n projectedZ = ((x * viewMtx[0][2]) + (y * viewMtx[1][2])) + (z * viewMtx[2][2]);\n x = HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f) * projectedZ * (camera->screenScale.x / camera->screenScale.y);\n y = (HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f)) * projectedZ;\n f2 = camera->screenPos.x / 4.0f;\n outPos->x = (projectedX * (f2 / (-x))) + f2;\n f4 = camera->screenPos.y / 4.0f;\n outPos->y = ((projectedY * (f4 / y)) + f4);\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L173-L213","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlwc1\t$f0,52(s0)\n 158:\tlwc1\t$f2,56(s0)\n 15c:\tdiv.s\t$f0,$f0,$f2\n 160:\tmul.s\t$f30,$f30,$f0\n 164:\tlwc1\t$f12,80(s0)\n 168:\tjal\t0 \n 16c:\tdiv.s\t$f12,$f12,$f26\n 170:\tmov.s\t$f28,$f0\n 174:\tlwc1\t$f12,80(s0)\n 178:\tjal\t0 \n 17c:\tdiv.s\t$f12,$f12,$f26\n 180:\tdiv.s\t$f28,$f28,$f0\n 184:\tmul.s\t$f28,$f28,$f20\n 188:\tlwc1\t$f2,64(s0)\n 18c:\tlui\tat,0x4080\n 190:\tmtc1\tat,$f4\n 194:\tnop\n 198:\tdiv.s\t$f2,$f2,$f4\n 19c:\tneg.s\t$f0,$f30\n 1a0:\tdiv.s\t$f0,$f2,$f0\n 1a4:\tmul.s\t$f24,$f24,$f0\n 1a8:\tadd.s\t$f24,$f24,$f2\n 1ac:\tswc1\t$f24,0(s2)\n 1b0:\tlwc1\t$f0,68(s0)\n 1b4:\tdiv.s\t$f0,$f0,$f4\n 1b8:\tdiv.s\t$f2,$f0,$f28\n 1bc:\tmul.s\t$f22,$f22,$f2\n 1c0:\tadd.s\t$f22,$f22,$f0\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"func_80012B14_13714":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8d3657a65e5d5fc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 func_80012B14_13714\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n00000168 R_MIPS_26 HuMathSin\n00000178 R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 c6000034 c6020038 46020003 F......4...8F...\n 0160 4600f782 c60c0050 0c000000 461a6303 F......P....F.c.\n 0170 46000706 c60c0050 0c000000 461a6303 F......P....F.c.\n 0180 4600e703 4614e702 c6020040 3c014080 F...F......@<.@.\n 0190 44812000 00000000 46041083 4600f007 D. .....F...F...\n 01a0 46001003 4600c602 4602c600 e6580000 F...F...F....X..\n 01b0 c6000044 46040003 461c0083 4602b582 ...DF...F...F...\n 01c0 4600b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501015 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_80012B14_13714' — lift: cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — 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,-168 */\n/* 4:\tsw\tra,116(sp) */\n/* 8:\tsw\ts2,112(sp) */\n/* c:\tsw\ts1,108(sp) */\n/* 10:\tsw\ts0,104(sp) */\n/* 14:\tsdc1\t$f30,160(sp) */\n/* 18:\tsdc1\t$f28,152(sp) */\n/* 1c:\tsdc1\t$f26,144(sp) */\n/* 20:\tsdc1\t$f24,136(sp) */\n/* 24:\tsdc1\t$f22,128(sp) */\n/* 28:\tsdc1\t$f20,120(sp) */\n/* 2c:\tmove\ts1,a1 */\n/* 30:\tmove\ts2,a2 */\n/* 34:\tsll\ta0,a0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\tsll\ts0,a0,0x3 */\n/* 40:\taddu\ts0,s0,a0 */\n/* 44:\tsll\ts0,s0,0x2 */\n/* 48:\tsubu\ts0,s0,a0 */\n/* 4c:\tsll\ts0,s0,0x4 */\n/* 50:\tlui\tv0,0x0 */\n/* 54:\tlw\tv0,0(v0) */\n/* 58:\taddu\ts0,s0,v0 */\n/* 5c:\tlwc1\t$f0,28(s0) */\n/* 60:\tswc1\t$f0,16(sp) */\n/* 64:\tlwc1\t$f0,32(s0) */\n/* 68:\tswc1\t$f0,20(sp) */\n/* 6c:\tlwc1\t$f0,36(s0) */\n/* 70:\tswc1\t$f0,24(sp) */\n/* 74:\tlwc1\t$f0,40(s0) */\n/* 78:\tswc1\t$f0,28(sp) */\n/* 7c:\tlwc1\t$f0,44(s0) */\n/* 80:\tswc1\t$f0,32(sp) */\n/* 84:\tlwc1\t$f0,48(s0) */\n/* 88:\tswc1\t$f0,36(sp) */\n/* 8c:\tlw\ta1,16(s0) */\n/* 90:\tlw\ta2,20(s0) */\n/* 94:\tlw\ta3,24(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\taddiu\ta0,sp,40 */\n/* a0:\tlwc1\t$f30,0(s1) */\n/* a4:\tlwc1\t$f28,4(s1) */\n/* a8:\tlwc1\t$f2,8(s1) */\n/* ac:\tlwc1\t$f0,16(s0) */\n/* b0:\tsub.s\t$f30,$f30,$f0 */\n/* b4:\tlwc1\t$f0,20(s0) */\n/* b8:\tsub.s\t$f28,$f28,$f0 */\n/* bc:\tlwc1\t$f0,24(s0) */\n/* c0:\tsub.s\t$f2,$f2,$f0 */\n/* c4:\tlwc1\t$f24,40(sp) */\n/* c8:\tmul.s\t$f24,$f30,$f24 */\n/* cc:\tlwc1\t$f0,56(sp) */\n/* d0:\tmul.s\t$f0,$f28,$f0 */\n/* d4:\tadd.s\t$f24,$f24,$f0 */\n/* d8:\tlwc1\t$f0,72(sp) */\n/* dc:\tmul.s\t$f0,$f2,$f0 */\n/* e0:\tadd.s\t$f24,$f24,$f0 */\n/* e4:\tlwc1\t$f22,44(sp) */\n/* e8:\tmul.s\t$f22,$f30,$f22 */\n/* ec:\tlwc1\t$f0,60(sp) */\n/* f0:\tmul.s\t$f0,$f28,$f0 */\n/* f4:\tadd.s\t$f22,$f22,$f0 */\n/* f8:\tlwc1\t$f0,76(sp) */\n/* fc:\tmul.s\t$f0,$f2,$f0 */\n/* 100:\tadd.s\t$f22,$f22,$f0 */\n/* 104:\tlwc1\t$f20,48(sp) */\n/* 108:\tmul.s\t$f20,$f30,$f20 */\n/* 10c:\tlwc1\t$f0,64(sp) */\n/* 110:\tmul.s\t$f0,$f28,$f0 */\n/* 114:\tadd.s\t$f20,$f20,$f0 */\n/* 118:\tlwc1\t$f0,80(sp) */\n/* 11c:\tmul.s\t$f2,$f2,$f0 */\n/* 120:\tadd.s\t$f20,$f20,$f2 */\n/* 124:\tlwc1\t$f12,80(s0) */\n/* 128:\tlui\tat,0x4000 */\n/* 12c:\tmtc1\tat,$f26 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tdiv.s\t$f12,$f12,$f26 */\n/* 13c:\tmov.s\t$f28,$f0 */\n/* 140:\tlwc1\t$f12,80(s0) */\n/* 144:\tjal\t0 */\n/* 148:\tdiv.s\t$f12,$f12,$f26 */\n/* 14c:\tdiv.s\t$f30,$f28,$f0 */\n/* 150:\tmul.s\t$f30,$f30,$f20 */\n/* 154:\tlwc1\t$f0,52(s0) */\n/* 158:\tlwc1\t$f2,56(s0) */\n/* 15c:\tdiv.s\t$f0,$f0,$f2 */\n/* 160:\tmul.s\t$f30,$f30,$f0 */\n/* 164:\tlwc1\t$f12,80(s0) */\n/* 168:\tjal\t0 */\n/* 16c:\tdiv.s\t$f12,$f12,$f26 */\n/* 170:\tmov.s\t$f28,$f0 */\n/* 174:\tlwc1\t$f12,80(s0) */\n/* 178:\tjal\t0 */\n/* 17c:\tdiv.s\t$f12,$f12,$f26 */\n/* 180:\tdiv.s\t$f28,$f28,$f0 */\n/* 184:\tmul.s\t$f28,$f28,$f20 */\n/* 188:\tlwc1\t$f2,64(s0) */\n/* 18c:\tlui\tat,0x4080 */\n/* 190:\tmtc1\tat,$f4 */\n/* 194:\tnop */\n/* 198:\tdiv.s\t$f2,$f2,$f4 */\n/* 19c:\tneg.s\t$f0,$f30 */\n/* 1a0:\tdiv.s\t$f0,$f2,$f0 */\n/* 1a4:\tmul.s\t$f24,$f24,$f0 */\n/* 1a8:\tadd.s\t$f24,$f24,$f2 */\n/* 1ac:\tswc1\t$f24,0(s2) */\n/* 1b0:\tlwc1\t$f0,68(s0) */\n/* 1b4:\tdiv.s\t$f0,$f0,$f4 */\n/* 1b8:\tdiv.s\t$f2,$f0,$f28 */\n/* 1bc:\tmul.s\t$f22,$f22,$f2 */\n/* 1c0:\tadd.s\t$f22,$f22,$f0 */\n/* 1c4:\tswc1\t$f22,4(s2) */\n/* 1c8:\tlw\tra,116(sp) */\n/* 1cc:\tlw\ts2,112(sp) */\n/* 1d0:\tlw\ts1,108(sp) */\n/* 1d4:\tlw\ts0,104(sp) */\n/* 1d8:\tldc1\t$f30,160(sp) */\n/* 1dc:\tldc1\t$f28,152(sp) */\n/* 1e0:\tldc1\t$f26,144(sp) */\n/* 1e4:\tldc1\t$f24,136(sp) */\n/* 1e8:\tldc1\t$f22,128(sp) */\n/* 1ec:\tldc1\t$f20,120(sp) */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,168 */\n/* \t... */\nvoid func_80012B14_13714(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80012B14_13714': function call 'jal' at 0x98 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos) {\n HuCamera *temp_s0;\n f32 temp_f0;\n f32 temp_f20;\n f32 temp_f22;\n f32 temp_f24;\n f32 temp_f28;\n f32 temp_f28_2;\n f32 temp_f28_3;\n f32 temp_f28_4;\n f32 temp_f2;\n f32 temp_f2_2;\n f32 temp_f30;\n f32 temp_f30_2;\n\n temp_s0 = &gCameraList[camIndex];\n guLookAtF((f32 (*)[4]) &sp28[0], temp_s0->pos.x, temp_s0->pos.y, temp_s0->pos.z, temp_s0->at.x, temp_s0->at.y, temp_s0->at.z, temp_s0->up.x, temp_s0->up.y, temp_s0->up.z);\n temp_f30 = worldPos->x - temp_s0->pos.x;\n temp_f28 = worldPos->y - temp_s0->pos.y;\n temp_f2 = worldPos->z - temp_s0->pos.z;\n temp_f24 = (temp_f30 * sp28[0]) + (temp_f28 * sp38) + (temp_f2 * sp48);\n temp_f22 = (temp_f30 * sp28[1]) + (temp_f28 * sp3C) + (temp_f2 * sp4C);\n temp_f20 = (temp_f30 * sp28[2]) + (temp_f28 * sp40) + (temp_f2 * sp50);\n temp_f28_2 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f30_2 = (temp_f28_2 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20 * (temp_s0->screenScale.x / temp_s0->screenScale.y);\n temp_f28_3 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f28_4 = (temp_f28_3 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20;\n temp_f2_2 = temp_s0->screenPos.x / 4.0f;\n outPos->x = (temp_f24 * (temp_f2_2 / -temp_f30_2)) + temp_f2_2;\n temp_f0 = temp_s0->screenPos.y / 4.0f;\n outPos->y = (temp_f22 * (temp_f0 / temp_f28_4)) + temp_f0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5566: `sp28' undeclared (first use this function)","/c.i:5566: (Each undeclared identifier is reported only once","/c.i:5566: for each function it appears in.)","/c.i:5570: `sp38' undeclared (first use this function)","/c.i:5570: `sp48' undeclared (first use this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80012B14_13714` — benchmark function marioparty3:func_80012B14_13714:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_80012B14_13714\n addiu\t$sp, $sp, -168\n sw\t$ra, 116($sp)\n sw\t$s2, 112($sp)\n sw\t$s1, 108($sp)\n sw\t$s0, 104($sp)\n sdc1\t$f30, 160($sp)\n sdc1\t$f28, 152($sp)\n sdc1\t$f26, 144($sp)\n sdc1\t$f24, 136($sp)\n sdc1\t$f22, 128($sp)\n sdc1\t$f20, 120($sp)\n move\t$s1, $a1\n move\t$s2, $a2\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$s0, $a0, 0x3\n addu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x2\n subu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x4\n lui\t$v0, %hi(gCameraList)\n lw\t$v0, %lo(gCameraList)($v0)\n addu\t$s0, $s0, $v0\n lwc1\t$f0, 28($s0)\n swc1\t$f0, 16($sp)\n lwc1\t$f0, 32($s0)\n swc1\t$f0, 20($sp)\n lwc1\t$f0, 36($s0)\n swc1\t$f0, 24($sp)\n lwc1\t$f0, 40($s0)\n swc1\t$f0, 28($sp)\n lwc1\t$f0, 44($s0)\n swc1\t$f0, 32($sp)\n lwc1\t$f0, 48($s0)\n swc1\t$f0, 36($sp)\n lw\t$a1, 16($s0)\n lw\t$a2, 20($s0)\n lw\t$a3, 24($s0)\n jal\tguLookAtF\n addiu\t$a0, $sp, 40\n lwc1\t$f30, 0($s1)\n lwc1\t$f28, 4($s1)\n lwc1\t$f2, 8($s1)\n lwc1\t$f0, 16($s0)\n sub.s\t$f30, $f30, $f0\n lwc1\t$f0, 20($s0)\n sub.s\t$f28, $f28, $f0\n lwc1\t$f0, 24($s0)\n sub.s\t$f2, $f2, $f0\n lwc1\t$f24, 40($sp)\n mul.s\t$f24, $f30, $f24\n lwc1\t$f0, 56($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f0, 72($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f22, 44($sp)\n mul.s\t$f22, $f30, $f22\n lwc1\t$f0, 60($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f0, 76($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f20, 48($sp)\n mul.s\t$f20, $f30, $f20\n lwc1\t$f0, 64($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f20, $f20, $f0\n lwc1\t$f0, 80($sp)\n mul.s\t$f2, $f2, $f0\n add.s\t$f20, $f20, $f2\n lwc1\t$f12, 80($s0)\n lui\t$at, 0x4000\n mtc1\t$at, $f26\n nop\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f30, $f28, $f0\n mul.s\t$f30, $f30, $f20\n lwc1\t$f0, 52($s0)\n lwc1\t$f2, 56($s0)\n div.s\t$f0, $f0, $f2\n mul.s\t$f30, $f30, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f28, $f28, $f0\n mul.s\t$f28, $f28, $f20\n lwc1\t$f2, 64($s0)\n lui\t$at, 0x4080\n mtc1\t$at, $f4\n nop\n div.s\t$f2, $f2, $f4\n neg.s\t$f0, $f30\n div.s\t$f0, $f2, $f0\n mul.s\t$f24, $f24, $f0\n add.s\t$f24, $f24, $f2\n swc1\t$f24, 0($s2)\n lwc1\t$f0, 68($s0)\n div.s\t$f0, $f0, $f4\n div.s\t$f2, $f0, $f28\n mul.s\t$f22, $f22, $f2\n add.s\t$f22, $f22, $f0\n swc1\t$f22, 4($s2)\n lw\t$ra, 116($sp)\n lw\t$s2, 112($sp)\n lw\t$s1, 108($sp)\n lw\t$s0, 104($sp)\n ldc1\t$f30, 160($sp)\n ldc1\t$f28, 152($sp)\n ldc1\t$f26, 144($sp)\n ldc1\t$f24, 136($sp)\n ldc1\t$f22, 128($sp)\n ldc1\t$f20, 120($sp)\n jr\t$ra\n addiu\t$sp, $sp, 168\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80012B14_13714(s16 camIndex, Vec *worldPos, Vec *outPos);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80012B14_13714 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80012B14_13714` — benchmark function marioparty3:func_80012B14_13714:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80012B14_13714: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:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlwc1\t$f0,52(s0)\n 158:\tlwc1\t$f2,56(s0)\n 15c:\tdiv.s\t$f0,$f0,$f2\n 160:\tmul.s\t$f30,$f30,$f0\n 164:\tlwc1\t$f12,80(s0)\n 168:\tjal\t0 \n 16c:\tdiv.s\t$f12,$f12,$f26\n 170:\tmov.s\t$f28,$f0\n 174:\tlwc1\t$f12,80(s0)\n 178:\tjal\t0 \n 17c:\tdiv.s\t$f12,$f12,$f26\n 180:\tdiv.s\t$f28,$f28,$f0\n 184:\tmul.s\t$f28,$f28,$f20\n 188:\tlwc1\t$f2,64(s0)\n 18c:\tlui\tat,0x4080\n 190:\tmtc1\tat,$f4\n 194:\tnop\n 198:\tdiv.s\t$f2,$f2,$f4\n 19c:\tneg.s\t$f0,$f30\n 1a0:\tdiv.s\t$f0,$f2,$f0\n 1a4:\tmul.s\t$f24,$f24,$f0\n 1a8:\tadd.s\t$f24,$f24,$f2\n 1ac:\tswc1\t$f24,0(s2)\n 1b0:\tlwc1\t$f0,68(s0)\n 1b4:\tdiv.s\t$f0,$f0,$f4\n 1b8:\tdiv.s\t$f2,$f0,$f28\n 1bc:\tmul.s\t$f22,$f22,$f2\n 1c0:\tadd.s\t$f22,$f22,$f0\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-8d3657a65e5d5fc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 func_80012B14_13714\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n00000168 R_MIPS_26 HuMathSin\n00000178 R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 c6000034 c6020038 46020003 F......4...8F...\n 0160 4600f782 c60c0050 0c000000 461a6303 F......P....F.c.\n 0170 46000706 c60c0050 0c000000 461a6303 F......P....F.c.\n 0180 4600e703 4614e702 c6020040 3c014080 F...F......@<.@.\n 0190 44812000 00000000 46041083 4600f007 D. .....F...F...\n 01a0 46001003 4600c602 4602c600 e6580000 F...F...F....X..\n 01b0 c6000044 46040003 461c0083 4602b582 ...DF...F...F...\n 01c0 4600b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501015 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_80012B14_13714\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_80012B14_13714 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001D330_1DF30\n lui\t$at, %hi(D_800A0A78_A1678)\n jr\t$ra\n sh\t$a0, %lo(D_800A0A78_A1678)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001D330_1DF30(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001D330_1DF30 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001FBBC_207BC:gcc2.7.2","sym":"func_8001FBBC_207BC","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *other;\n\n other = HmfModelData[arg0].unkB4;\n if (other != NULL) {\n other->unk00 = arg1;\n other->unk01 = arg2;\n other->unk02 = arg3;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8001FBBC_207BC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"HmfModelData","shape":"pointer"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[180]; s32 field_180; u8 _pad1[8]; };\nvoid func_8001FBBC_207BC(s32 a0, s32 a1, s32 a2, s32 a3) {\n u8 * v0;\n v0 = (u8 *)((struct Elem0 *)HmfModelData)[a0 << 16 >> 16].field_180;\n if (v0 != 0) {\n *v0 = a1;\n v0[1] = a2;\n v0[2] = a3;\n }\n return;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *temp_v0;\n\n temp_v0 = HmfModelData[arg0].unkB4;\n if (temp_v0 != NULL) {\n temp_v0->unk00 = arg1;\n temp_v0->unk01 = (u8) arg2;\n temp_v0->unk02 = (u8) arg3;\n }\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001FBBC_207BC\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n lui\t$v1, %hi(HmfModelData)\n lw\t$v1, %lo(HmfModelData)($v1)\n sll\t$v0, $a0, 0x1\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x6\n addu\t$v0, $v0, $v1\n lw\t$v0, 180($v0)\n beqz\t$v0, .L38\n nop\n sb\t$a1, 0($v0)\n sb\t$a2, 1($v0)\n sb\t$a3, 2($v0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001FBBC_207BC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800230F8_23CF8:gcc2.7.2","sym":"func_800230F8_23CF8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","loop","nested-loop","call"],"loc":36,"refSource":"void func_800230F8_23CF8(HmfData *arg0) {\n s16 textureIndex;\n s16 i, j;\n\n textureIndex = 4; // TODO: why does this start at 4?\n\n for (i = 0; i < arg0->unk12; i++) {\n /* Skip entries marked as 0xFF */\n if (arg0->unk84[i].unk9 == 0xFF) {\n continue;\n }\n\n /* Find first entry with different unkC value */\n for (j = 0; j < i; j++) {\n if (arg0->unk84[i].unkC == arg0->unk84[j].unkC) {\n break;\n }\n }\n\n /* Copy or assign texture indices */\n if (j != i) {\n arg0->unk84[i].unk3 = arg0->unk84[j].unk3;\n arg0->unk84[i].unk4 = arg0->unk84[j].unk4;\n } else {\n arg0->unk84[i].unk3 = textureIndex++;\n if (arg0->unk84[i].unkC->unk_30 != NULL) {\n arg0->unk84[i].unk4 = textureIndex++;\n }\n\n if (textureIndex > 16) {\n osSyncPrintf(\"Texture Anime Over\\n\");\n return;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L22-L57","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:\tmove\tt0,a0\n c:\tli\tt1,4\n 10:\tlh\tv0,18(t0)\n 14:\tblez\tv0,160 \n 18:\tmove\tt2,zero\n 1c:\tsll\tv0,t2,0x10\n 20:\tmove\ta2,v0\n 24:\tsra\ta1,v0,0x10\n 28:\tlw\tv1,132(t0)\n 2c:\tsll\tv0,a1,0x4\n 30:\taddu\tv0,v0,v1\n 34:\tlbu\tv1,9(v0)\n 38:\tli\tv0,255\n 3c:\tbeql\tv1,v0,144 \n 40:\taddiu\tv0,t2,1\n 44:\tblez\ta1,90 \n 48:\tmove\ta0,zero\n 4c:\tlw\ta3,132(t0)\n 50:\tsra\ta1,a2,0x10\n 54:\tsll\tv1,a1,0x4\n 58:\taddu\tv1,v1,a3\n 5c:\tsll\tv0,a0,0x10\n 60:\tsra\tv0,v0,0xc\n 64:\taddu\tv0,v0,a3\n 68:\tlw\tv1,12(v1)\n 6c:\tlw\tv0,12(v0)\n 70:\tbeq\tv1,v0,90 \n 74:\taddiu\tv0,a0,1\n 78:\tmove\ta0,v0\n 7c:\tsll\tv0,v0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tslt\tv0,v0,a1\n 88:\tbnez\tv0,58 \n 8c:\tsll\tv1,a1,0x4\n 90:\tsll\tv0,a0,0x10\n 94:\tsra\tv1,v0,0x10\n 98:\tsll\tv0,t2,0x10\n 9c:\tsra\ta0,v0,0x10\n a0:\tbeq\tv1,a0,d8 \n a4:\tsll\ta0,a0,0x4\n a8:\tlw\tv0,132(t0)\n ac:\taddu\ta1,a0,v0\n b0:\tsll\tv1,v1,0x4\n b4:\taddu\tv0,v1,v0\n b8:\tlbu\tv0,3(v0)\n bc:\tsb\tv0,3(a1)\n c0:\tlw\tv0,132(t0)\n c4:\taddu\ta0,a0,v0\n c8:\taddu\tv1,v1,v0\n cc:\tlbu\tv0,4(v1)\n d0:\tj\t140 \n d4:\tsb\tv0,4(a0)\n d8:\tsll\tv1,t2,0x10\n dc:\tlw\tv0,132(t0)\n e0:\tsra\tv1,v1,0xc\n e4:\taddu\tv0,v1,v0\n e8:\tmove\ta0,t1\n ec:\taddiu\ta1,t1,1\n f0:\tsb\ta0,3(v0)\n f4:\tlw\tv0,132(t0)\n f8:\taddu\tv1,v1,v0\n fc:\tlw\tv0,12(v1)\n 100:\tlw\tv0,48(v0)\n 104:\tbeqz\tv0,118 \n 108:\tmove\tt1,a1\n 10c:\tmove\tv0,t1\n 110:\taddiu\tt1,a1,1\n 114:\tsb\tv0,4(v1)\n 118:\tsll\tv0,t1,0x10\n 11c:\tsra\tv0,v0,0x10\n 120:\tslti\tv0,v0,17\n 124:\tbnez\tv0,144 \n 128:\taddiu\tv0,t2,1\n 12c:\tlui\ta0,0x0\n 130:\tjal\t0 \n 134:\taddiu\ta0,a0,0\n 138:\tj\t160 \n 13c:\tnop\n 140:\taddiu\tv0,t2,1\n 144:\tmove\tt2,v0\n 148:\tsll\tv0,v0,0x10\n 14c:\tsra\tv0,v0,0x10\n 150:\tlh\tv1,18(t0)\n 154:\tslt\tv0,v0,v1\n 158:\tbnez\tv0,20 \n 15c:\tsll\tv0,t2,0x10\n 160:\tlw\tra,16(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,24\n 16c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"func_800230F8_23CF8":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9020ed8430fedb07/u.i\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\t0000016c func_800230F8_23CF8\n00000000 *UND*\t00000000 osSyncPrintf\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n000000d0 R_MIPS_26 .text\n0000012c R_MIPS_HI16 .rodata\n00000134 R_MIPS_LO16 .rodata\n00000130 R_MIPS_26 osSyncPrintf\n00000138 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 00804021 24090004 '.........@!$...\n 0010 85020012 18400052 00005021 000a1400 .....@.R..P!....\n 0020 00403021 00022c03 8d030084 00051100 .@0!..,.........\n 0030 00431021 90430009 240200ff 50620041 .C.!.C..$...Pb.A\n 0040 25420001 18a00012 00002021 8d070084 %B........ !....\n 0050 00062c03 00051900 00671821 00041400 ..,......g.!....\n 0060 00021303 00471021 8c63000c 8c42000c .....G.!.c...B..\n 0070 10620007 24820001 00402021 00021400 .b..$....@ !....\n 0080 00021403 0045102a 1440fff3 00051900 .....E.*.@......\n 0090 00041400 00021c03 000a1400 00022403 ..............$.\n 00a0 1064000d 00042100 8d020084 00822821 .d....!.......(!\n 00b0 00031900 00621021 90420003 a0a20003 .....b.!.B......\n 00c0 8d020084 00822021 00621821 90620004 ...... !.b.!.b..\n 00d0 08000050 a0820004 000a1c00 8d020084 ...P............\n 00e0 00031b03 00621021 01202021 25250001 .....b.!. !%%..\n 00f0 a0440003 8d020084 00621821 8c62000c .D.......b.!.b..\n 0100 8c420030 10400004 00a04821 01201021 .B.0.@....H!. .!\n 0110 24a90001 a0620004 00091400 00021403 $....b..........\n 0120 28420011 14400007 25420001 3c040000 (B...@..%B..<...\n 0130 0c000000 24840000 08000058 00000000 ....$......X....\n 0140 25420001 00405021 00021400 00021403 %B...@P!........\n 0150 85030012 0043102a 1440ffb1 000a1400 .....C.*.@......\n 0160 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a00007fc 00000000 00000000 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 54657874 75726520 416e696d 65204f76 Texture Anime Ov\n 0010 65720a00 er.. \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_800230F8_23CF8' — lift: cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' 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:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tmove\tt0,a0 */\n/* c:\tli\tt1,4 */\n/* 10:\tlh\tv0,18(t0) */\n/* 14:\tblez\tv0,160 */\n/* 18:\tmove\tt2,zero */\n/* 1c:\tsll\tv0,t2,0x10 */\n/* 20:\tmove\ta2,v0 */\n/* 24:\tsra\ta1,v0,0x10 */\n/* 28:\tlw\tv1,132(t0) */\n/* 2c:\tsll\tv0,a1,0x4 */\n/* 30:\taddu\tv0,v0,v1 */\n/* 34:\tlbu\tv1,9(v0) */\n/* 38:\tli\tv0,255 */\n/* 3c:\tbeql\tv1,v0,144 */\n/* 40:\taddiu\tv0,t2,1 */\n/* 44:\tblez\ta1,90 */\n/* 48:\tmove\ta0,zero */\n/* 4c:\tlw\ta3,132(t0) */\n/* 50:\tsra\ta1,a2,0x10 */\n/* 54:\tsll\tv1,a1,0x4 */\n/* 58:\taddu\tv1,v1,a3 */\n/* 5c:\tsll\tv0,a0,0x10 */\n/* 60:\tsra\tv0,v0,0xc */\n/* 64:\taddu\tv0,v0,a3 */\n/* 68:\tlw\tv1,12(v1) */\n/* 6c:\tlw\tv0,12(v0) */\n/* 70:\tbeq\tv1,v0,90 */\n/* 74:\taddiu\tv0,a0,1 */\n/* 78:\tmove\ta0,v0 */\n/* 7c:\tsll\tv0,v0,0x10 */\n/* 80:\tsra\tv0,v0,0x10 */\n/* 84:\tslt\tv0,v0,a1 */\n/* 88:\tbnez\tv0,58 */\n/* 8c:\tsll\tv1,a1,0x4 */\n/* 90:\tsll\tv0,a0,0x10 */\n/* 94:\tsra\tv1,v0,0x10 */\n/* 98:\tsll\tv0,t2,0x10 */\n/* 9c:\tsra\ta0,v0,0x10 */\n/* a0:\tbeq\tv1,a0,d8 */\n/* a4:\tsll\ta0,a0,0x4 */\n/* a8:\tlw\tv0,132(t0) */\n/* ac:\taddu\ta1,a0,v0 */\n/* b0:\tsll\tv1,v1,0x4 */\n/* b4:\taddu\tv0,v1,v0 */\n/* b8:\tlbu\tv0,3(v0) */\n/* bc:\tsb\tv0,3(a1) */\n/* c0:\tlw\tv0,132(t0) */\n/* c4:\taddu\ta0,a0,v0 */\n/* c8:\taddu\tv1,v1,v0 */\n/* cc:\tlbu\tv0,4(v1) */\n/* d0:\tj\t140 */\n/* d4:\tsb\tv0,4(a0) */\n/* d8:\tsll\tv1,t2,0x10 */\n/* dc:\tlw\tv0,132(t0) */\n/* e0:\tsra\tv1,v1,0xc */\n/* e4:\taddu\tv0,v1,v0 */\n/* e8:\tmove\ta0,t1 */\n/* ec:\taddiu\ta1,t1,1 */\n/* f0:\tsb\ta0,3(v0) */\n/* f4:\tlw\tv0,132(t0) */\n/* f8:\taddu\tv1,v1,v0 */\n/* fc:\tlw\tv0,12(v1) */\n/* 100:\tlw\tv0,48(v0) */\n/* 104:\tbeqz\tv0,118 */\n/* 108:\tmove\tt1,a1 */\n/* 10c:\tmove\tv0,t1 */\n/* 110:\taddiu\tt1,a1,1 */\n/* 114:\tsb\tv0,4(v1) */\n/* 118:\tsll\tv0,t1,0x10 */\n/* 11c:\tsra\tv0,v0,0x10 */\n/* 120:\tslti\tv0,v0,17 */\n/* 124:\tbnez\tv0,144 */\n/* 128:\taddiu\tv0,t2,1 */\n/* 12c:\tlui\ta0,0x0 */\n/* 130:\tjal\t0 */\n/* 134:\taddiu\ta0,a0,0 */\n/* 138:\tj\t160 */\n/* 13c:\tnop */\n/* 140:\taddiu\tv0,t2,1 */\n/* 144:\tmove\tt2,v0 */\n/* 148:\tsll\tv0,v0,0x10 */\n/* 14c:\tsra\tv0,v0,0x10 */\n/* 150:\tlh\tv1,18(t0) */\n/* 154:\tslt\tv0,v0,v1 */\n/* 158:\tbnez\tv0,20 */\n/* 15c:\tsll\tv0,t2,0x10 */\n/* 160:\tlw\tra,16(sp) */\n/* 164:\tjr\tra */\n/* 168:\taddiu\tsp,sp,24 */\n/* 16c:\tnop */\nvoid func_800230F8_23CF8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' at 0x3c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":100,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800230F8_23CF8': unmodelled control transfer 'beql' at 0x3c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"static s8 data_rodata_0[0x14] = {\n 0x54,\n 0x65,\n 0x78,\n 0x74,\n 0x75,\n 0x72,\n 0x65,\n 0x20,\n 0x41,\n 0x6E,\n 0x69,\n 0x6D,\n 0x65,\n 0x20,\n 0x4F,\n 0x76,\n 0x65,\n 0x72,\n 0xA,\n 0,\n}; /* const */\n\nvoid func_800230F8_23CF8(HmfData *arg0) {\n HmfData_Unk84_Entry *temp_a3;\n HmfData_Unk84_Entry *temp_v0_2;\n HmfData_Unk84_Entry *temp_v0_3;\n s16 temp_v0;\n s16 var_a0;\n s16 var_t2;\n s16 var_v0_2;\n s32 temp_a1;\n s32 temp_a1_2;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n s8 temp_a1_3;\n s8 temp_v0_4;\n s8 var_t1;\n u8 *temp_v1_2;\n\n var_t1 = 4;\n var_t2 = 0;\n if (arg0->unk12 > 0) {\n var_v0 = 0 << 0x10;\nloop_2:\n temp_a1 = var_v0 >> 0x10;\n if (arg0->unk84[temp_a1].unk9 != 0xFF) {\n var_a0 = 0;\n if (temp_a1 > 0) {\n temp_a3 = arg0->unk84;\n temp_a1_2 = var_v0 >> 0x10;\n var_v1 = temp_a1_2 * 0x10;\nloop_5:\n temp_v0 = var_a0 + 1;\n if (temp_a3->unk0[var_v1].unkC != temp_a3->unk0[(s32) (var_a0 << 0x10) >> 0xC].unkC) {\n var_a0 = temp_v0;\n var_v1 = temp_a1_2 * 0x10;\n if (temp_v0 < temp_a1_2) {\n goto loop_5;\n }\n }\n }\n if (var_a0 != var_t2) {\n temp_v0_2 = arg0->unk84;\n temp_v0_2[var_t2].unk3 = temp_v0_2[var_a0].unk3;\n temp_v0_3 = arg0->unk84;\n temp_v0_3[var_t2].unk4 = temp_v0_3[var_a0].unk4;\n goto block_13;\n }\n temp_v1 = (s32) (var_t2 << 0x10) >> 0xC;\n temp_a1_3 = var_t1 + 1;\n arg0->unk84->unk0[temp_v1].unk3 = var_t1;\n temp_v1_2 = &arg0->unk84->unk0[temp_v1];\n var_t1 = temp_a1_3;\n if (temp_v1_2->unkC->unk30 != 0) {\n temp_v0_4 = var_t1;\n var_t1 = temp_a1_3 + 1;\n temp_v1_2->unk4 = temp_v0_4;\n }\n var_v0_2 = var_t2 + 1;\n if ((s16) var_t1 >= 0x11) {\n osSyncPrintf(data_rodata_0, temp_a1_3, var_v0);\n return;\n }\n goto block_14;\n }\nblock_13:\n var_v0_2 = var_t2 + 1;\nblock_14:\n var_t2 = var_v0_2;\n var_v0 = var_t2 << 0x10;\n if (var_v0_2 >= arg0->unk12) {\n\n } else {\n goto loop_2;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":62,"lines":96,"gotos":4,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5604: request for member `unkC' in something not a structure or union","/c.i:5621: request for member `unk3' in something not a structure or union","/c.i:5624: request for member `unkC' in something not a structure or union","/c.i:5627: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800230F8_23CF8` — benchmark function marioparty3:func_800230F8_23CF8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800230F8_23CF8\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n move\t$t0, $a0\n li\t$t1, 4\n lh\t$v0, 18($t0)\n blez\t$v0, .L160\n move\t$t2, $zero\n sll\t$v0, $t2, 0x10\n.L20:\n move\t$a2, $v0\n sra\t$a1, $v0, 0x10\n lw\t$v1, 132($t0)\n sll\t$v0, $a1, 0x4\n addu\t$v0, $v0, $v1\n lbu\t$v1, 9($v0)\n li\t$v0, 255\n beql\t$v1, $v0, .L144\n addiu\t$v0, $t2, 1\n blez\t$a1, .L90\n move\t$a0, $zero\n lw\t$a3, 132($t0)\n sra\t$a1, $a2, 0x10\n sll\t$v1, $a1, 0x4\n.L58:\n addu\t$v1, $v1, $a3\n sll\t$v0, $a0, 0x10\n sra\t$v0, $v0, 0xc\n addu\t$v0, $v0, $a3\n lw\t$v1, 12($v1)\n lw\t$v0, 12($v0)\n beq\t$v1, $v0, .L90\n addiu\t$v0, $a0, 1\n move\t$a0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$v0, $v0, $a1\n bnez\t$v0, .L58\n sll\t$v1, $a1, 0x4\n.L90:\n sll\t$v0, $a0, 0x10\n sra\t$v1, $v0, 0x10\n sll\t$v0, $t2, 0x10\n sra\t$a0, $v0, 0x10\n beq\t$v1, $a0, .Ld8\n sll\t$a0, $a0, 0x4\n lw\t$v0, 132($t0)\n addu\t$a1, $a0, $v0\n sll\t$v1, $v1, 0x4\n addu\t$v0, $v1, $v0\n lbu\t$v0, 3($v0)\n sb\t$v0, 3($a1)\n lw\t$v0, 132($t0)\n addu\t$a0, $a0, $v0\n addu\t$v1, $v1, $v0\n lbu\t$v0, 4($v1)\n j\t.L140\n sb\t$v0, 4($a0)\n.Ld8:\n sll\t$v1, $t2, 0x10\n lw\t$v0, 132($t0)\n sra\t$v1, $v1, 0xc\n addu\t$v0, $v1, $v0\n move\t$a0, $t1\n addiu\t$a1, $t1, 1\n sb\t$a0, 3($v0)\n lw\t$v0, 132($t0)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($v1)\n lw\t$v0, 48($v0)\n beqz\t$v0, .L118\n move\t$t1, $a1\n move\t$v0, $t1\n addiu\t$t1, $a1, 1\n sb\t$v0, 4($v1)\n.L118:\n sll\t$v0, $t1, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 17\n bnez\t$v0, .L144\n addiu\t$v0, $t2, 1\n lui\t$a0, %hi(data_rodata_0)\n jal\tosSyncPrintf\n addiu\t$a0, $a0, %lo(data_rodata_0)\n j\t.L160\n nop\n.L140:\n addiu\t$v0, $t2, 1\n.L144:\n move\t$t2, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n lh\t$v1, 18($t0)\n slt\t$v0, $v0, $v1\n bnez\t$v0, .L20\n sll\t$v0, $t2, 0x10\n.L160:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\n.rodata\nglabel data_rodata_0\n.word 0x54657874\n.word 0x75726520\n.word 0x416E696D\n.word 0x65204F76\n.word 0x65720A00\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800230F8_23CF8(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800230F8_23CF8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800230F8_23CF8` — benchmark function marioparty3:func_800230F8_23CF8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800230F8_23CF8: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:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tmove\tt0,a0\n c:\tli\tt1,4\n 10:\tlh\tv0,18(t0)\n 14:\tblez\tv0,160 \n 18:\tmove\tt2,zero\n 1c:\tsll\tv0,t2,0x10\n 20:\tmove\ta2,v0\n 24:\tsra\ta1,v0,0x10\n 28:\tlw\tv1,132(t0)\n 2c:\tsll\tv0,a1,0x4\n 30:\taddu\tv0,v0,v1\n 34:\tlbu\tv1,9(v0)\n 38:\tli\tv0,255\n 3c:\tbeql\tv1,v0,144 \n 40:\taddiu\tv0,t2,1\n 44:\tblez\ta1,90 \n 48:\tmove\ta0,zero\n 4c:\tlw\ta3,132(t0)\n 50:\tsra\ta1,a2,0x10\n 54:\tsll\tv1,a1,0x4\n 58:\taddu\tv1,v1,a3\n 5c:\tsll\tv0,a0,0x10\n 60:\tsra\tv0,v0,0xc\n 64:\taddu\tv0,v0,a3\n 68:\tlw\tv1,12(v1)\n 6c:\tlw\tv0,12(v0)\n 70:\tbeq\tv1,v0,90 \n 74:\taddiu\tv0,a0,1\n 78:\tmove\ta0,v0\n 7c:\tsll\tv0,v0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tslt\tv0,v0,a1\n 88:\tbnez\tv0,58 \n 8c:\tsll\tv1,a1,0x4\n 90:\tsll\tv0,a0,0x10\n 94:\tsra\tv1,v0,0x10\n 98:\tsll\tv0,t2,0x10\n 9c:\tsra\ta0,v0,0x10\n a0:\tbeq\tv1,a0,d8 \n a4:\tsll\ta0,a0,0x4\n a8:\tlw\tv0,132(t0)\n ac:\taddu\ta1,a0,v0\n b0:\tsll\tv1,v1,0x4\n b4:\taddu\tv0,v1,v0\n b8:\tlbu\tv0,3(v0)\n bc:\tsb\tv0,3(a1)\n c0:\tlw\tv0,132(t0)\n c4:\taddu\ta0,a0,v0\n c8:\taddu\tv1,v1,v0\n cc:\tlbu\tv0,4(v1)\n d0:\tj\t140 \n d4:\tsb\tv0,4(a0)\n d8:\tsll\tv1,t2,0x10\n dc:\tlw\tv0,132(t0)\n e0:\tsra\tv1,v1,0xc\n e4:\taddu\tv0,v1,v0\n e8:\tmove\ta0,t1\n ec:\taddiu\ta1,t1,1\n f0:\tsb\ta0,3(v0)\n f4:\tlw\tv0,132(t0)\n f8:\taddu\tv1,v1,v0\n fc:\tlw\tv0,12(v1)\n 100:\tlw\tv0,48(v0)\n 104:\tbeqz\tv0,118 \n 108:\tmove\tt1,a1\n 10c:\tmove\tv0,t1\n 110:\taddiu\tt1,a1,1\n 114:\tsb\tv0,4(v1)\n 118:\tsll\tv0,t1,0x10\n 11c:\tsra\tv0,v0,0x10\n 120:\tslti\tv0,v0,17\n 124:\tbnez\tv0,144 \n 128:\taddiu\tv0,t2,1\n 12c:\tlui\ta0,0x0\n 130:\tjal\t0 \n 134:\taddiu\ta0,a0,0\n 138:\tj\t160 \n 13c:\tnop\n 140:\taddiu\tv0,t2,1\n 144:\tmove\tt2,v0\n 148:\tsll\tv0,v0,0x10\n 14c:\tsra\tv0,v0,0x10\n 150:\tlh\tv1,18(t0)\n 154:\tslt\tv0,v0,v1\n 158:\tbnez\tv0,20 \n 15c:\tsll\tv0,t2,0x10\n 160:\tlw\tra,16(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,24\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-gcc272-9020ed8430fedb07/u.i\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\t0000016c func_800230F8_23CF8\n00000000 *UND*\t00000000 osSyncPrintf\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n000000d0 R_MIPS_26 .text\n0000012c R_MIPS_HI16 .rodata\n00000134 R_MIPS_LO16 .rodata\n00000130 R_MIPS_26 osSyncPrintf\n00000138 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 00804021 24090004 '.........@!$...\n 0010 85020012 18400052 00005021 000a1400 .....@.R..P!....\n 0020 00403021 00022c03 8d030084 00051100 .@0!..,.........\n 0030 00431021 90430009 240200ff 50620041 .C.!.C..$...Pb.A\n 0040 25420001 18a00012 00002021 8d070084 %B........ !....\n 0050 00062c03 00051900 00671821 00041400 ..,......g.!....\n 0060 00021303 00471021 8c63000c 8c42000c .....G.!.c...B..\n 0070 10620007 24820001 00402021 00021400 .b..$....@ !....\n 0080 00021403 0045102a 1440fff3 00051900 .....E.*.@......\n 0090 00041400 00021c03 000a1400 00022403 ..............$.\n 00a0 1064000d 00042100 8d020084 00822821 .d....!.......(!\n 00b0 00031900 00621021 90420003 a0a20003 .....b.!.B......\n 00c0 8d020084 00822021 00621821 90620004 ...... !.b.!.b..\n 00d0 08000050 a0820004 000a1c00 8d020084 ...P............\n 00e0 00031b03 00621021 01202021 25250001 .....b.!. !%%..\n 00f0 a0440003 8d020084 00621821 8c62000c .D.......b.!.b..\n 0100 8c420030 10400004 00a04821 01201021 .B.0.@....H!. .!\n 0110 24a90001 a0620004 00091400 00021403 $....b..........\n 0120 28420011 14400007 25420001 3c040000 (B...@..%B..<...\n 0130 0c000000 24840000 08000058 00000000 ....$......X....\n 0140 25420001 00405021 00021400 00021403 %B...@P!........\n 0150 85030012 0043102a 1440ffb1 000a1400 .....C.*.@......\n 0160 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a00007fc 00000000 00000000 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 54657874 75726520 416e696d 65204f76 Texture Anime Ov\n 0010 65720a00 er.. \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_800230F8_23CF8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_800230F8_23CF8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002FD48_30948\n jr\t$ra\n sw\t$zero, 160($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002FD48_30948(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002FD48_30948 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045314_45F14:gcc2.7.2","sym":"func_80045314_45F14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","arithmetic","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045314_45F14\n lui\t$v1, %hi(omovl)\n lw\t$v1, %lo(omovl)($v1)\n li\t$v0, 2\n beq\t$v1, $v0, .L24\n li\t$v0, 3\n beq\t$v1, $v0, .L28\n li\t$v0, -20\n j\t.L28\n move\t$v0, $zero\n.L24:\n li\t$v0, 20\n.L28:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045314_45F14 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045350_45F50:gcc2.7.2","sym":"func_80045350_45F50","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045350_45F50\n lui\t$v1, %hi(GwSystem)\n lb\t$v1, %lo(GwSystem)($v1)\n addiu\t$v1, $v1, -1\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800A6D44_A7944)\n addu\t$v1, $v1, $v0\n lbu\t$v1, %lo(D_800A6D44_A7944)($v1)\n li\t$v0, 6\n beq\t$v1, $v0, .L64\n nop\n move\t$v1, $zero\n lui\t$a0, %hi(GwPlayer)\n addiu\t$a0, $a0, %lo(GwPlayer)\n sll\t$v0, $v1, 0x3\n.L40:\n subu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x3\n addu\t$v0, $v0, $a0\n sh\t$zero, 6($v0)\n sh\t$zero, 8($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 4\n bnez\t$v0, .L40\n sll\t$v0, $v1, 0x3\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80045350_45F50(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045350_45F50 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045BF0_467F0:gcc2.7.2","sym":"func_80045BF0_467F0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","arithmetic","loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045BF0_467F0\n move\t$v1, $zero\n andi\t$a0, $a0, 0xff\n.L8:\n lui\t$v0, %hi(D_800A1590_A2190)\n addu\t$v0, $v0, $v1\n lbu\t$v0, %lo(D_800A1590_A2190)($v0)\n beq\t$a0, $v0, .L2c\n sltiu\t$v0, $v1, 9\n addiu\t$v1, $v1, 1\n sltiu\t$v0, $v1, 9\n bnez\t$v0, .L8\n nop\n.L2c:\n beqzl\t$v0, .L34\n li\t$v1, -1\n.L34:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_80045BF0_467F0(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045BF0_467F0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80047E90_48A90:gcc2.7.2","sym":"func_80047E90_48A90","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80047E90_48A90\n lw\t$v0, 16($a0)\n or\t$a1, $a1, $v0\n jr\t$ra\n sw\t$a1, 16($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80047E90_48A90(omObjData *obj, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80047E90_48A90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A444_4B044:gcc2.7.2","sym":"func_8004A444_4B044","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":5,"refSource":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz","proto":{"func_8004A444_4B044":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D1710_D2310"}],"outcome":"match","source":"void func_8004A444_4B044(u32 a0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = a0;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = (s8) arg0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A444_4B044\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\n lui\t$at, %hi(D_800D1710_D2310)\n jr\t$ra\n sb\t$a0, %lo(D_800D1710_D2310)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A444_4B044(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A444_4B044 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A468_4B068:gcc2.7.2","sym":"func_8004A468_4B068","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":7,"refSource":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz","proto":{"func_8004A468_4B068":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800CD2F4_CDEF4"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D4082_D4C82"},{"name":"D_800D6A56_D7656"}],"outcome":"match","source":"void func_8004A468_4B068(u32 a0, u32 a1, u32 a2) {\n D_800D4082_D4C82 = a0;\n D_800CD2F4_CDEF4 = a1;\n D_800D6A56_D7656 = a2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A468_4B068\n lui\t$at, %hi(D_800D4082_D4C82)\n sh\t$a0, %lo(D_800D4082_D4C82)($at)\n lui\t$at, %hi(D_800CD2F4_CDEF4)\n sh\t$a1, %lo(D_800CD2F4_CDEF4)($at)\n lui\t$at, %hi(D_800D6A56_D7656)\n sh\t$a2, %lo(D_800D6A56_D7656)($at)\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n jr\t$ra\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A468_4B068 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80052E14_53A14:gcc2.7.2","sym":"func_80052E14_53A14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80052E14_53A14\n lw\t$v0, 132($a0)\n sw\t$v0, 104($a0)\n lbu\t$v0, 136($a0)\n sb\t$v0, 108($a0)\n lhu\t$v0, 14($a0)\n sh\t$v0, 110($a0)\n lhu\t$v0, 138($a0)\n sh\t$v0, 114($a0)\n lhu\t$v0, 12($a0)\n sh\t$v0, 112($a0)\n lwc1\t$f0, 140($a0)\n swc1\t$f0, 116($a0)\n lwc1\t$f0, 16($a0)\n swc1\t$f0, 120($a0)\n lbu\t$v0, 146($a0)\n sb\t$v0, 126($a0)\n lhu\t$v0, 144($a0)\n sh\t$v0, 124($a0)\n sb\t$zero, 128($a0)\n jr\t$ra\n sb\t$zero, 127($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80052E14_53A14(HuSprite *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80052E14_53A14 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800560D8_56CD8:gcc2.7.2","sym":"func_800560D8_56CD8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800560D8_56CD8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nHuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800560D8_56CD8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005614C_56D4C:gcc2.7.2","sym":"func_8005614C_56D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":5,"refSource":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n HuSprite_Unk84_Unk00_Struct *entry = &D_800C9530_CA130[arg0]->unk00[arg1];\n\n return entry->unk00;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_8005614C_56D4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005614C_56D4C' — lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\taddu\tv0,v0,v1 */\n/* 2c:\tjr\tra */\n/* 30:\tlw\tv0,0(v0) */\n/* \t... */\nvoid func_8005614C_56D4C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n return *(((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005614C_56D4C\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n addu\t$v0, $v0, $v1\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_8005614C_56D4C(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005614C_56D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056254_56E54:gcc2.7.2","sym":"func_80056254_56E54","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80056254_56E54":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void func_80056254_56E54(s32 * a0) {\n return;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056254_56E54\n lw\t$v0, 0($a0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056254_56E54(HuSprite_Unk84_Struct **arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056254_56E54 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056260_56E60:gcc2.7.2","sym":"func_80056260_56E60","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056260_56E60\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(D_800C9530_CA130)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(D_800C9530_CA130)($v0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056260_56E60(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056260_56E60 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056C98_57898:gcc2.7.2","sym":"func_80056C98_57898","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056C98_57898\n lw\t$a1, 0($a0)\n lbu\t$v0, 0($a1)\n sll\t$v0, $v0, 0x18\n lbu\t$v1, 1($a1)\n sll\t$v1, $v1, 0x10\n addu\t$v0, $v0, $v1\n lbu\t$v1, 2($a1)\n sll\t$v1, $v1, 0x8\n addu\t$v0, $v0, $v1\n lbu\t$v1, 3($a1)\n addiu\t$a1, $a1, 4\n sw\t$a1, 0($a0)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056C98_57898 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800570A8_57CA8:gcc2.7.2","sym":"func_800570A8_57CA8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic","union","float","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800570A8_57CA8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(HuSprGrpData)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(HuSprGrpData)($v0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0xe\n addu\t$a1, $a1, $v0\n lw\t$a0, 16($a1)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0xe\n lui\t$v0, %hi(D_800D0A50_D1650)\n addu\t$v0, $v0, $a2\n lw\t$v0, %lo(D_800D0A50_D1650)($v0)\n sw\t$v0, 152($a0)\n lui\t$at, 0x3f80\n mtc1\t$at, $f0\n nop\n swc1\t$f0, 252($a0)\n move\t$v1, $zero\n li\t$a1, 0xffff\n sll\t$v0, $v1, 0x1\n.L58:\n addu\t$v0, $v0, $a0\n sh\t$a1, 156($v0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $a0\n sw\t$zero, 188($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 16\n bnezl\t$v0, .L58\n sll\t$v0, $v1, 0x1\n jr\t$ra\n sw\t$zero, 260($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800570A8_57CA8(s16 group, s16 member, s16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800570A8_57CA8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005FA90_60690:gcc2.7.2","sym":"func_8005FA90_60690","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","global","arithmetic","loop","nested-loop","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005FA90_60690\n move\t$t0, $zero\n lbu\t$a3, 0($a0)\n sll\t$a2, $t0, 0x10\n.Lc:\n sra\t$a1, $a2, 0x10\n lui\t$v0, %hi(D_800A232C_A2F2C)\n addu\t$v0, $v0, $a1\n lbu\t$v0, %lo(D_800A232C_A2F2C)($v0)\n bne\t$v0, $a3, .L50\n addiu\t$v0, $t0, 2\n lui\t$v1, %hi(D_800A232C_A2F2C)\n addu\t$v1, $v1, $a1\n lbu\t$v1, %lo(D_800A232C_A2F2C)($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .L50\n addiu\t$v0, $t0, 2\n srl\t$v0, $a2, 0x1f\n addu\t$v0, $a1, $v0\n srl\t$v0, $v0, 0x1\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.L50:\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 10\n bnez\t$v0, .Lc\n sll\t$a2, $t0, 0x10\n move\t$t0, $zero\n lui\t$t4, %hi(D_800A2344_A2F44)\n addiu\t$t4, $t4, %lo(D_800A2344_A2F44)\n lbu\t$t3, 0($a0)\n move\t$a3, $zero\n.L7c:\n sll\t$v1, $t0, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $t4\n lw\t$t1, 0($v0)\n sll\t$t2, $v1, 0x4\n sll\t$a1, $a3, 0x10\n.L98:\n sra\t$a2, $a1, 0x10\n addu\t$v1, $t1, $a2\n lbu\t$v0, 0($v1)\n bne\t$v0, $t3, .Ld4\n addiu\t$v0, $a3, 2\n lbu\t$v1, 1($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .Ld4\n addiu\t$v0, $a3, 2\n srl\t$v0, $a1, 0x1f\n addu\t$v0, $a2, $v0\n sra\t$v0, $v0, 0x1\n addu\t$v0, $v0, $t2\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.Ld4:\n move\t$a3, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 32\n bnez\t$v0, .L98\n sll\t$a1, $a3, 0x10\n addiu\t$v0, $t0, 1\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 16\n bnezl\t$v0, .L7c\n move\t$a3, $zero\n li\t$v0, 16\n.L10c:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 func_8005FA90_60690(u8 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005FA90_60690 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800600C0_60CC0:gcc2.7.2","sym":"func_800600C0_60CC0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic","bitwise"],"loc":10,"refSource":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *window;\n\n window = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n window->unk_38 |= 0x10;\n } else {\n window->unk_38 &= ~0x10;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","proto":{"func_800600C0_60CC0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"void func_800600C0_60CC0(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n","score":41,"maxScore":42,"compileErrors":null,"breakdown":{"insert":23,"delete":7,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":98,"lines":12,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *temp_a0;\n u32 var_v0;\n\n temp_a0 = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n var_v0 = temp_a0->unk_38 | 0x10;\n } else {\n var_v0 = temp_a0->unk_38 & ~0x10;\n }\n temp_a0->unk_38 = var_v0;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800600C0_60CC0\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n beqz\t$a1, .L38\n addu\t$a0, $v0, $v1\n lw\t$v0, 56($a0)\n j\t.L44\n ori\t$v0, $v0, 0x10\n.L38:\n lw\t$v0, 56($a0)\n li\t$v1, -17\n and\t$v0, $v0, $v1\n.L44:\n jr\t$ra\n sw\t$v0, 56($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800600C0_60CC0(s16 winId, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800600C0_60CC0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8006014C_60D4C:gcc2.7.2","sym":"func_8006014C_60D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_8006014C_60D4C(u32 a0) {\n return ((s8 *)((a0 * 160 - a0 << 2) + D_800CC69C_CD29C))[49];\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8006014C_60D4C\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n addu\t$v0, $v0, $v1\n jr\t$ra\n lb\t$v0, 49($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns8 func_8006014C_60D4C(s32 winId);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8006014C_60D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80071B40_72740:gcc2.7.2","sym":"func_80071B40_72740","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80071B40_72740\n jr\t$ra\n sh\t$a1, 22($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80071B40_72740(ALVoice *voice, s16 priority);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80071B40_72740 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8008A0D0_8ACD0:gcc2.7.2","sym":"func_8008A0D0_8ACD0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","union","array","field"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8008A0D0_8ACD0\n sw\t$zero, 60($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 48($a0)\n sw\t$zero, 44($a0)\n sw\t$zero, 40($a0)\n sw\t$zero, 36($a0)\n sw\t$zero, 32($a0)\n sw\t$zero, 24($a0)\n sw\t$zero, 16($a0)\n sw\t$zero, 12($a0)\n sw\t$zero, 4($a0)\n lui\t$v0, 0x1\n sw\t$v0, 20($a0)\n sw\t$v0, 0($a0)\n li\t$v0, 1\n sw\t$v0, 28($a0)\n jr\t$ra\n sw\t$v0, 8($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8008A0D0_8ACD0(Mtx *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8008A0D0_8ACD0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWBoardRecordGet:gcc2.7.2","sym":"GWBoardRecordGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","arithmetic","bitwise","strength-reduce"],"loc":12,"refSource":"u8 *GWBoardRecordGet(s16 arg0) {\n s16 idx = arg0;\n\n if (arg0 < 0) {\n idx = GwSystem.current_board_index;\n }\n\n if (GwSystem.playMode & 1) {\n return (u8 *)&GwCommon.unk_1D[2] + idx * 9;\n }\n return (u8 *)&GwCommon.unk_1D[0x38] + idx * 9;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"GwCommon","shape":"struct GwCommon_s (164 B)"},{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"nonmatch","source":"s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = (s32)(GwSystem.current_board_index << 24) >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n","score":20,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? GwCommon;\nextern u8 GwSystem;\n\nvoid *GWBoardRecordGet(s8 arg0) {\n s32 var_v0;\n s8 var_v1;\n\n var_v1 = arg0;\n if (arg0 & 0x8000) {\n var_v1 = (s8) GwSystem;\n }\n if (!(GwSystem & 1)) {\n var_v0 = (s16) var_v1 * 9;\n } else {\n var_v0 = (s16) var_v1 * 9;\n }\n return var_v0 + &GwCommon;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":16,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":20,"maxScore":26,"ratio":0.7692307692307693,"kinds":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWBoardRecordGet\n move\t$v1, $a0\n sll\t$a0, $a0, 0x10\n bgez\t$a0, .L20\n nop\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n.L20:\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L4c\n sll\t$v1, $v1, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n j\t.L60\n addiu\t$v1, $v1, %lo(GwCommon)\n.L4c:\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n addiu\t$v1, $v1, %lo(GwCommon)\n.L60:\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWBoardRecordGet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWMgNoSet:gcc2.7.2","sym":"GWMgNoSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global","struct","field","store"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWMgNoSet\n lui\t$at, %hi(GwSystem)\n jr\t$ra\n sb\t$a0, %lo(GwSystem)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWMgNoSet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:Hu3DCam3DToScreen:gcc2.7.2","sym":"Hu3DCam3DToScreen","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["float","array","arithmetic","struct","call"],"loc":37,"refSource":"void Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos) {\n f32 x;\n f32 y;\n f32 z;\n f32 projectedX;\n f32 projectedY;\n f32 projectedZ;\n HuCamera *camera;\n HuMtx4F viewMtx;\n\n camera = &gCameraList[camIndex];\n guLookAtF(\n viewMtx,\n camera->pos.x,\n camera->pos.y,\n camera->pos.z,\n camera->at.x,\n camera->at.y,\n camera->at.z,\n camera->up.x,\n camera->up.y,\n camera->up.z);\n\n x = worldPos->x;\n y = worldPos->y;\n z = worldPos->z;\n x -= camera->pos.x;\n y -= camera->pos.y;\n z -= camera->pos.z;\n projectedX = ((x * viewMtx[0][0]) + (y * viewMtx[1][0])) + (z * viewMtx[2][0]);\n projectedY = ((x * viewMtx[0][1]) + (y * viewMtx[1][1])) + (z * viewMtx[2][1]);\n projectedZ = ((x * viewMtx[0][2]) + (y * viewMtx[1][2])) + (z * viewMtx[2][2]);\n x = HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f) * projectedZ * ASPECT_RATIO;\n y = (HuMathSin(camera->fov[0] / 2.0f) / HuMathCos(camera->fov[0] / 2.0f)) * projectedZ;\n outPos->x = (projectedX * (SCREEN_WIDTH_CENTER / (-x))) + SCREEN_WIDTH_CENTER;\n outPos->y = ((projectedY * (SCREEN_HEIGHT_CENTER / y)) + SCREEN_HEIGHT_CENTER);\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L135-L171","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlui\tat,0x3faa\n 158:\tori\tat,at,0xaaab\n 15c:\tmtc1\tat,$f0\n 160:\tnop\n 164:\tmul.s\t$f30,$f30,$f0\n 168:\tlwc1\t$f12,80(s0)\n 16c:\tjal\t0 \n 170:\tdiv.s\t$f12,$f12,$f26\n 174:\tmov.s\t$f28,$f0\n 178:\tlwc1\t$f12,80(s0)\n 17c:\tjal\t0 \n 180:\tdiv.s\t$f12,$f12,$f26\n 184:\tdiv.s\t$f28,$f28,$f0\n 188:\tmul.s\t$f28,$f28,$f20\n 18c:\tneg.s\t$f0,$f30\n 190:\tlui\tat,0x4320\n 194:\tmtc1\tat,$f2\n 198:\tnop\n 19c:\tdiv.s\t$f0,$f2,$f0\n 1a0:\tmul.s\t$f24,$f24,$f0\n 1a4:\tadd.s\t$f24,$f24,$f2\n 1a8:\tswc1\t$f24,0(s2)\n 1ac:\tlui\tat,0x42f0\n 1b0:\tmtc1\tat,$f2\n 1b4:\tnop\n 1b8:\tdiv.s\t$f0,$f2,$f28\n 1bc:\tmul.s\t$f22,$f22,$f0\n 1c0:\tadd.s\t$f22,$f22,$f2\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","proto":{"Hu3DCam3DToScreen":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f1f2d05701a38846/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 Hu3DCam3DToScreen\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n0000016c R_MIPS_26 HuMathSin\n0000017c R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 3c013faa 3421aaab 44810000 F...<.?.4!..D...\n 0160 00000000 4600f782 c60c0050 0c000000 ....F......P....\n 0170 461a6303 46000706 c60c0050 0c000000 F.c.F......P....\n 0180 461a6303 4600e703 4614e702 4600f007 F.c.F...F...F...\n 0190 3c014320 44811000 00000000 46001003 <.C D.......F...\n 01a0 4600c602 4602c600 e6580000 3c0142f0 F...F....X..<.B.\n 01b0 44811000 00000000 461c1003 4600b582 D.......F...F...\n 01c0 4602b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501005 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'Hu3DCam3DToScreen' — lift: cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — 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,-168 */\n/* 4:\tsw\tra,116(sp) */\n/* 8:\tsw\ts2,112(sp) */\n/* c:\tsw\ts1,108(sp) */\n/* 10:\tsw\ts0,104(sp) */\n/* 14:\tsdc1\t$f30,160(sp) */\n/* 18:\tsdc1\t$f28,152(sp) */\n/* 1c:\tsdc1\t$f26,144(sp) */\n/* 20:\tsdc1\t$f24,136(sp) */\n/* 24:\tsdc1\t$f22,128(sp) */\n/* 28:\tsdc1\t$f20,120(sp) */\n/* 2c:\tmove\ts1,a1 */\n/* 30:\tmove\ts2,a2 */\n/* 34:\tsll\ta0,a0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\tsll\ts0,a0,0x3 */\n/* 40:\taddu\ts0,s0,a0 */\n/* 44:\tsll\ts0,s0,0x2 */\n/* 48:\tsubu\ts0,s0,a0 */\n/* 4c:\tsll\ts0,s0,0x4 */\n/* 50:\tlui\tv0,0x0 */\n/* 54:\tlw\tv0,0(v0) */\n/* 58:\taddu\ts0,s0,v0 */\n/* 5c:\tlwc1\t$f0,28(s0) */\n/* 60:\tswc1\t$f0,16(sp) */\n/* 64:\tlwc1\t$f0,32(s0) */\n/* 68:\tswc1\t$f0,20(sp) */\n/* 6c:\tlwc1\t$f0,36(s0) */\n/* 70:\tswc1\t$f0,24(sp) */\n/* 74:\tlwc1\t$f0,40(s0) */\n/* 78:\tswc1\t$f0,28(sp) */\n/* 7c:\tlwc1\t$f0,44(s0) */\n/* 80:\tswc1\t$f0,32(sp) */\n/* 84:\tlwc1\t$f0,48(s0) */\n/* 88:\tswc1\t$f0,36(sp) */\n/* 8c:\tlw\ta1,16(s0) */\n/* 90:\tlw\ta2,20(s0) */\n/* 94:\tlw\ta3,24(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\taddiu\ta0,sp,40 */\n/* a0:\tlwc1\t$f30,0(s1) */\n/* a4:\tlwc1\t$f28,4(s1) */\n/* a8:\tlwc1\t$f2,8(s1) */\n/* ac:\tlwc1\t$f0,16(s0) */\n/* b0:\tsub.s\t$f30,$f30,$f0 */\n/* b4:\tlwc1\t$f0,20(s0) */\n/* b8:\tsub.s\t$f28,$f28,$f0 */\n/* bc:\tlwc1\t$f0,24(s0) */\n/* c0:\tsub.s\t$f2,$f2,$f0 */\n/* c4:\tlwc1\t$f24,40(sp) */\n/* c8:\tmul.s\t$f24,$f30,$f24 */\n/* cc:\tlwc1\t$f0,56(sp) */\n/* d0:\tmul.s\t$f0,$f28,$f0 */\n/* d4:\tadd.s\t$f24,$f24,$f0 */\n/* d8:\tlwc1\t$f0,72(sp) */\n/* dc:\tmul.s\t$f0,$f2,$f0 */\n/* e0:\tadd.s\t$f24,$f24,$f0 */\n/* e4:\tlwc1\t$f22,44(sp) */\n/* e8:\tmul.s\t$f22,$f30,$f22 */\n/* ec:\tlwc1\t$f0,60(sp) */\n/* f0:\tmul.s\t$f0,$f28,$f0 */\n/* f4:\tadd.s\t$f22,$f22,$f0 */\n/* f8:\tlwc1\t$f0,76(sp) */\n/* fc:\tmul.s\t$f0,$f2,$f0 */\n/* 100:\tadd.s\t$f22,$f22,$f0 */\n/* 104:\tlwc1\t$f20,48(sp) */\n/* 108:\tmul.s\t$f20,$f30,$f20 */\n/* 10c:\tlwc1\t$f0,64(sp) */\n/* 110:\tmul.s\t$f0,$f28,$f0 */\n/* 114:\tadd.s\t$f20,$f20,$f0 */\n/* 118:\tlwc1\t$f0,80(sp) */\n/* 11c:\tmul.s\t$f2,$f2,$f0 */\n/* 120:\tadd.s\t$f20,$f20,$f2 */\n/* 124:\tlwc1\t$f12,80(s0) */\n/* 128:\tlui\tat,0x4000 */\n/* 12c:\tmtc1\tat,$f26 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tdiv.s\t$f12,$f12,$f26 */\n/* 13c:\tmov.s\t$f28,$f0 */\n/* 140:\tlwc1\t$f12,80(s0) */\n/* 144:\tjal\t0 */\n/* 148:\tdiv.s\t$f12,$f12,$f26 */\n/* 14c:\tdiv.s\t$f30,$f28,$f0 */\n/* 150:\tmul.s\t$f30,$f30,$f20 */\n/* 154:\tlui\tat,0x3faa */\n/* 158:\tori\tat,at,0xaaab */\n/* 15c:\tmtc1\tat,$f0 */\n/* 160:\tnop */\n/* 164:\tmul.s\t$f30,$f30,$f0 */\n/* 168:\tlwc1\t$f12,80(s0) */\n/* 16c:\tjal\t0 */\n/* 170:\tdiv.s\t$f12,$f12,$f26 */\n/* 174:\tmov.s\t$f28,$f0 */\n/* 178:\tlwc1\t$f12,80(s0) */\n/* 17c:\tjal\t0 */\n/* 180:\tdiv.s\t$f12,$f12,$f26 */\n/* 184:\tdiv.s\t$f28,$f28,$f0 */\n/* 188:\tmul.s\t$f28,$f28,$f20 */\n/* 18c:\tneg.s\t$f0,$f30 */\n/* 190:\tlui\tat,0x4320 */\n/* 194:\tmtc1\tat,$f2 */\n/* 198:\tnop */\n/* 19c:\tdiv.s\t$f0,$f2,$f0 */\n/* 1a0:\tmul.s\t$f24,$f24,$f0 */\n/* 1a4:\tadd.s\t$f24,$f24,$f2 */\n/* 1a8:\tswc1\t$f24,0(s2) */\n/* 1ac:\tlui\tat,0x42f0 */\n/* 1b0:\tmtc1\tat,$f2 */\n/* 1b4:\tnop */\n/* 1b8:\tdiv.s\t$f0,$f2,$f28 */\n/* 1bc:\tmul.s\t$f22,$f22,$f0 */\n/* 1c0:\tadd.s\t$f22,$f22,$f2 */\n/* 1c4:\tswc1\t$f22,4(s2) */\n/* 1c8:\tlw\tra,116(sp) */\n/* 1cc:\tlw\ts2,112(sp) */\n/* 1d0:\tlw\ts1,108(sp) */\n/* 1d4:\tlw\ts0,104(sp) */\n/* 1d8:\tldc1\t$f30,160(sp) */\n/* 1dc:\tldc1\t$f28,152(sp) */\n/* 1e0:\tldc1\t$f26,144(sp) */\n/* 1e4:\tldc1\t$f24,136(sp) */\n/* 1e8:\tldc1\t$f22,128(sp) */\n/* 1ec:\tldc1\t$f20,120(sp) */\n/* 1f0:\tjr\tra */\n/* 1f4:\taddiu\tsp,sp,168 */\n/* \t... */\nvoid Hu3DCam3DToScreen(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":135,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Hu3DCam3DToScreen': function call 'jal' at 0x98 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos) {\n HuCamera *temp_s0;\n f32 temp_f20;\n f32 temp_f22;\n f32 temp_f24;\n f32 temp_f28;\n f32 temp_f28_2;\n f32 temp_f28_3;\n f32 temp_f28_4;\n f32 temp_f2;\n f32 temp_f30;\n f32 temp_f30_2;\n\n temp_s0 = &gCameraList[camIndex];\n guLookAtF((f32 (*)[4]) &sp28[0], temp_s0->pos.x, temp_s0->pos.y, temp_s0->pos.z, temp_s0->at.x, temp_s0->at.y, temp_s0->at.z, temp_s0->up.x, temp_s0->up.y, temp_s0->up.z);\n temp_f30 = worldPos->x - temp_s0->pos.x;\n temp_f28 = worldPos->y - temp_s0->pos.y;\n temp_f2 = worldPos->z - temp_s0->pos.z;\n temp_f24 = (temp_f30 * sp28[0]) + (temp_f28 * sp38) + (temp_f2 * sp48);\n temp_f22 = (temp_f30 * sp28[1]) + (temp_f28 * sp3C) + (temp_f2 * sp4C);\n temp_f20 = (temp_f30 * sp28[2]) + (temp_f28 * sp40) + (temp_f2 * sp50);\n temp_f28_2 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f30_2 = (temp_f28_2 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20 * 1.3333334f;\n temp_f28_3 = HuMathSin(temp_s0->fov[0] / 2.0f);\n temp_f28_4 = (temp_f28_3 / HuMathCos(temp_s0->fov[0] / 2.0f)) * temp_f20;\n outPos->x = (temp_f24 * (160.0f / -temp_f30_2)) + 160.0f;\n outPos->y = (temp_f22 * (120.0f / temp_f28_4)) + 120.0f;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":27,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5563: `sp28' undeclared (first use this function)","/c.i:5563: (Each undeclared identifier is reported only once","/c.i:5563: for each function it appears in.)","/c.i:5567: `sp38' undeclared (first use this function)","/c.i:5567: `sp48' undeclared (first use this function)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Hu3DCam3DToScreen` — benchmark function marioparty3:Hu3DCam3DToScreen:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 Hu3DCam3DToScreen\n addiu\t$sp, $sp, -168\n sw\t$ra, 116($sp)\n sw\t$s2, 112($sp)\n sw\t$s1, 108($sp)\n sw\t$s0, 104($sp)\n sdc1\t$f30, 160($sp)\n sdc1\t$f28, 152($sp)\n sdc1\t$f26, 144($sp)\n sdc1\t$f24, 136($sp)\n sdc1\t$f22, 128($sp)\n sdc1\t$f20, 120($sp)\n move\t$s1, $a1\n move\t$s2, $a2\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$s0, $a0, 0x3\n addu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x2\n subu\t$s0, $s0, $a0\n sll\t$s0, $s0, 0x4\n lui\t$v0, %hi(gCameraList)\n lw\t$v0, %lo(gCameraList)($v0)\n addu\t$s0, $s0, $v0\n lwc1\t$f0, 28($s0)\n swc1\t$f0, 16($sp)\n lwc1\t$f0, 32($s0)\n swc1\t$f0, 20($sp)\n lwc1\t$f0, 36($s0)\n swc1\t$f0, 24($sp)\n lwc1\t$f0, 40($s0)\n swc1\t$f0, 28($sp)\n lwc1\t$f0, 44($s0)\n swc1\t$f0, 32($sp)\n lwc1\t$f0, 48($s0)\n swc1\t$f0, 36($sp)\n lw\t$a1, 16($s0)\n lw\t$a2, 20($s0)\n lw\t$a3, 24($s0)\n jal\tguLookAtF\n addiu\t$a0, $sp, 40\n lwc1\t$f30, 0($s1)\n lwc1\t$f28, 4($s1)\n lwc1\t$f2, 8($s1)\n lwc1\t$f0, 16($s0)\n sub.s\t$f30, $f30, $f0\n lwc1\t$f0, 20($s0)\n sub.s\t$f28, $f28, $f0\n lwc1\t$f0, 24($s0)\n sub.s\t$f2, $f2, $f0\n lwc1\t$f24, 40($sp)\n mul.s\t$f24, $f30, $f24\n lwc1\t$f0, 56($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f0, 72($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f24, $f24, $f0\n lwc1\t$f22, 44($sp)\n mul.s\t$f22, $f30, $f22\n lwc1\t$f0, 60($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f0, 76($sp)\n mul.s\t$f0, $f2, $f0\n add.s\t$f22, $f22, $f0\n lwc1\t$f20, 48($sp)\n mul.s\t$f20, $f30, $f20\n lwc1\t$f0, 64($sp)\n mul.s\t$f0, $f28, $f0\n add.s\t$f20, $f20, $f0\n lwc1\t$f0, 80($sp)\n mul.s\t$f2, $f2, $f0\n add.s\t$f20, $f20, $f2\n lwc1\t$f12, 80($s0)\n lui\t$at, 0x4000\n mtc1\t$at, $f26\n nop\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f30, $f28, $f0\n mul.s\t$f30, $f30, $f20\n lui\t$at, 0x3faa\n ori\t$at, $at, 0xaaab\n mtc1\t$at, $f0\n nop\n mul.s\t$f30, $f30, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathSin\n div.s\t$f12, $f12, $f26\n mov.s\t$f28, $f0\n lwc1\t$f12, 80($s0)\n jal\tHuMathCos\n div.s\t$f12, $f12, $f26\n div.s\t$f28, $f28, $f0\n mul.s\t$f28, $f28, $f20\n neg.s\t$f0, $f30\n lui\t$at, 0x4320\n mtc1\t$at, $f2\n nop\n div.s\t$f0, $f2, $f0\n mul.s\t$f24, $f24, $f0\n add.s\t$f24, $f24, $f2\n swc1\t$f24, 0($s2)\n lui\t$at, 0x42f0\n mtc1\t$at, $f2\n nop\n div.s\t$f0, $f2, $f28\n mul.s\t$f22, $f22, $f0\n add.s\t$f22, $f22, $f2\n swc1\t$f22, 4($s2)\n lw\t$ra, 116($sp)\n lw\t$s2, 112($sp)\n lw\t$s1, 108($sp)\n lw\t$s0, 104($sp)\n ldc1\t$f30, 160($sp)\n ldc1\t$f28, 152($sp)\n ldc1\t$f26, 144($sp)\n ldc1\t$f24, 136($sp)\n ldc1\t$f22, 128($sp)\n ldc1\t$f20, 120($sp)\n jr\t$ra\n addiu\t$sp, $sp, 168\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid Hu3DCam3DToScreen(s16 camIndex, Vec *worldPos, Vec *outPos);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Hu3DCam3DToScreen # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Hu3DCam3DToScreen` — benchmark function marioparty3:Hu3DCam3DToScreen:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:Hu3DCam3DToScreen: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:\taddiu\tsp,sp,-168\n 4:\tsw\tra,116(sp)\n 8:\tsw\ts2,112(sp)\n c:\tsw\ts1,108(sp)\n 10:\tsw\ts0,104(sp)\n 14:\tsdc1\t$f30,160(sp)\n 18:\tsdc1\t$f28,152(sp)\n 1c:\tsdc1\t$f26,144(sp)\n 20:\tsdc1\t$f24,136(sp)\n 24:\tsdc1\t$f22,128(sp)\n 28:\tsdc1\t$f20,120(sp)\n 2c:\tmove\ts1,a1\n 30:\tmove\ts2,a2\n 34:\tsll\ta0,a0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\tsll\ts0,a0,0x3\n 40:\taddu\ts0,s0,a0\n 44:\tsll\ts0,s0,0x2\n 48:\tsubu\ts0,s0,a0\n 4c:\tsll\ts0,s0,0x4\n 50:\tlui\tv0,0x0\n 54:\tlw\tv0,0(v0)\n 58:\taddu\ts0,s0,v0\n 5c:\tlwc1\t$f0,28(s0)\n 60:\tswc1\t$f0,16(sp)\n 64:\tlwc1\t$f0,32(s0)\n 68:\tswc1\t$f0,20(sp)\n 6c:\tlwc1\t$f0,36(s0)\n 70:\tswc1\t$f0,24(sp)\n 74:\tlwc1\t$f0,40(s0)\n 78:\tswc1\t$f0,28(sp)\n 7c:\tlwc1\t$f0,44(s0)\n 80:\tswc1\t$f0,32(sp)\n 84:\tlwc1\t$f0,48(s0)\n 88:\tswc1\t$f0,36(sp)\n 8c:\tlw\ta1,16(s0)\n 90:\tlw\ta2,20(s0)\n 94:\tlw\ta3,24(s0)\n 98:\tjal\t0 \n 9c:\taddiu\ta0,sp,40\n a0:\tlwc1\t$f30,0(s1)\n a4:\tlwc1\t$f28,4(s1)\n a8:\tlwc1\t$f2,8(s1)\n ac:\tlwc1\t$f0,16(s0)\n b0:\tsub.s\t$f30,$f30,$f0\n b4:\tlwc1\t$f0,20(s0)\n b8:\tsub.s\t$f28,$f28,$f0\n bc:\tlwc1\t$f0,24(s0)\n c0:\tsub.s\t$f2,$f2,$f0\n c4:\tlwc1\t$f24,40(sp)\n c8:\tmul.s\t$f24,$f30,$f24\n cc:\tlwc1\t$f0,56(sp)\n d0:\tmul.s\t$f0,$f28,$f0\n d4:\tadd.s\t$f24,$f24,$f0\n d8:\tlwc1\t$f0,72(sp)\n dc:\tmul.s\t$f0,$f2,$f0\n e0:\tadd.s\t$f24,$f24,$f0\n e4:\tlwc1\t$f22,44(sp)\n e8:\tmul.s\t$f22,$f30,$f22\n ec:\tlwc1\t$f0,60(sp)\n f0:\tmul.s\t$f0,$f28,$f0\n f4:\tadd.s\t$f22,$f22,$f0\n f8:\tlwc1\t$f0,76(sp)\n fc:\tmul.s\t$f0,$f2,$f0\n 100:\tadd.s\t$f22,$f22,$f0\n 104:\tlwc1\t$f20,48(sp)\n 108:\tmul.s\t$f20,$f30,$f20\n 10c:\tlwc1\t$f0,64(sp)\n 110:\tmul.s\t$f0,$f28,$f0\n 114:\tadd.s\t$f20,$f20,$f0\n 118:\tlwc1\t$f0,80(sp)\n 11c:\tmul.s\t$f2,$f2,$f0\n 120:\tadd.s\t$f20,$f20,$f2\n 124:\tlwc1\t$f12,80(s0)\n 128:\tlui\tat,0x4000\n 12c:\tmtc1\tat,$f26\n 130:\tnop\n 134:\tjal\t0 \n 138:\tdiv.s\t$f12,$f12,$f26\n 13c:\tmov.s\t$f28,$f0\n 140:\tlwc1\t$f12,80(s0)\n 144:\tjal\t0 \n 148:\tdiv.s\t$f12,$f12,$f26\n 14c:\tdiv.s\t$f30,$f28,$f0\n 150:\tmul.s\t$f30,$f30,$f20\n 154:\tlui\tat,0x3faa\n 158:\tori\tat,at,0xaaab\n 15c:\tmtc1\tat,$f0\n 160:\tnop\n 164:\tmul.s\t$f30,$f30,$f0\n 168:\tlwc1\t$f12,80(s0)\n 16c:\tjal\t0 \n 170:\tdiv.s\t$f12,$f12,$f26\n 174:\tmov.s\t$f28,$f0\n 178:\tlwc1\t$f12,80(s0)\n 17c:\tjal\t0 \n 180:\tdiv.s\t$f12,$f12,$f26\n 184:\tdiv.s\t$f28,$f28,$f0\n 188:\tmul.s\t$f28,$f28,$f20\n 18c:\tneg.s\t$f0,$f30\n 190:\tlui\tat,0x4320\n 194:\tmtc1\tat,$f2\n 198:\tnop\n 19c:\tdiv.s\t$f0,$f2,$f0\n 1a0:\tmul.s\t$f24,$f24,$f0\n 1a4:\tadd.s\t$f24,$f24,$f2\n 1a8:\tswc1\t$f24,0(s2)\n 1ac:\tlui\tat,0x42f0\n 1b0:\tmtc1\tat,$f2\n 1b4:\tnop\n 1b8:\tdiv.s\t$f0,$f2,$f28\n 1bc:\tmul.s\t$f22,$f22,$f0\n 1c0:\tadd.s\t$f22,$f22,$f2\n 1c4:\tswc1\t$f22,4(s2)\n 1c8:\tlw\tra,116(sp)\n 1cc:\tlw\ts2,112(sp)\n 1d0:\tlw\ts1,108(sp)\n 1d4:\tlw\ts0,104(sp)\n 1d8:\tldc1\t$f30,160(sp)\n 1dc:\tldc1\t$f28,152(sp)\n 1e0:\tldc1\t$f26,144(sp)\n 1e4:\tldc1\t$f24,136(sp)\n 1e8:\tldc1\t$f22,128(sp)\n 1ec:\tldc1\t$f20,120(sp)\n 1f0:\tjr\tra\n 1f4:\taddiu\tsp,sp,168\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-f1f2d05701a38846/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001f8 Hu3DCam3DToScreen\n00000000 *UND*\t00000000 gCameraList\n00000000 *UND*\t00000000 guLookAtF\n00000000 *UND*\t00000000 HuMathSin\n00000000 *UND*\t00000000 HuMathCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000050 R_MIPS_HI16 gCameraList\n00000054 R_MIPS_LO16 gCameraList\n00000098 R_MIPS_26 guLookAtF\n00000134 R_MIPS_26 HuMathSin\n00000144 R_MIPS_26 HuMathCos\n0000016c R_MIPS_26 HuMathSin\n0000017c R_MIPS_26 HuMathCos\n\n\nContents of section .text:\n 0000 27bdff58 afbf0074 afb20070 afb1006c '..X...t...p...l\n 0010 afb00068 f7be00a0 f7bc0098 f7ba0090 ...h............\n 0020 f7b80088 f7b60080 f7b40078 00a08821 ...........x...!\n 0030 00c09021 00042400 00042403 000480c0 ...!..$...$.....\n 0040 02048021 00108080 02048023 00108100 ...!.......#....\n 0050 3c020000 8c420000 02028021 c600001c <....B.....!....\n 0060 e7a00010 c6000020 e7a00014 c6000024 ....... .......$\n 0070 e7a00018 c6000028 e7a0001c c600002c .......(.......,\n 0080 e7a00020 c6000030 e7a00024 8e050010 ... ...0...$....\n 0090 8e060014 8e070018 0c000000 27a40028 ............'..(\n 00a0 c63e0000 c63c0004 c6220008 c6000010 .>...<...\"......\n 00b0 4600f781 c6000014 4600e701 c6000018 F.......F.......\n 00c0 46001081 c7b80028 4618f602 c7a00038 F......(F......8\n 00d0 4600e002 4600c600 c7a00048 46001002 F...F......HF...\n 00e0 4600c600 c7b6002c 4616f582 c7a0003c F......,F......<\n 00f0 4600e002 4600b580 c7a0004c 46001002 F...F......LF...\n 0100 4600b580 c7b40030 4614f502 c7a00040 F......0F......@\n 0110 4600e002 4600a500 c7a00050 46001082 F...F......PF...\n 0120 4602a500 c60c0050 3c014000 4481d000 F......P<.@.D...\n 0130 00000000 0c000000 461a6303 46000706 ........F.c.F...\n 0140 c60c0050 0c000000 461a6303 4600e783 ...P....F.c.F...\n 0150 4614f782 3c013faa 3421aaab 44810000 F...<.?.4!..D...\n 0160 00000000 4600f782 c60c0050 0c000000 ....F......P....\n 0170 461a6303 46000706 c60c0050 0c000000 F.c.F......P....\n 0180 461a6303 4600e703 4614e702 4600f007 F.c.F...F...F...\n 0190 3c014320 44811000 00000000 46001003 <.C D.......F...\n 01a0 4600c602 4602c600 e6580000 3c0142f0 F...F....X..<.B.\n 01b0 44811000 00000000 461c1003 4600b582 D.......F...F...\n 01c0 4602b580 e6560004 8fbf0074 8fb20070 F....V.....t...p\n 01d0 8fb1006c 8fb00068 d7be00a0 d7bc0098 ...l...h........\n 01e0 d7ba0090 d7b80088 d7b60080 d7b40078 ...............x\n 01f0 03e00008 27bd00a8 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a00700f6 00000000 55501005 00000000 ........UP......\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Hu3DCam3DToScreen\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 Hu3DCam3DToScreen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:HuMemAllocTag:gcc2.7.2","sym":"HuMemAllocTag","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","struct","fnptr","global","sizeof","bitwise","call"],"loc":24,"refSource":"void *HuMemAllocTag(s32 size, s16 tag) {\n s32 alignedSize;\n void *data;\n HuMallocHeader *firstBlk;\n HuMallocHeader *newBlk;\n\n alignedSize = (size + 7) & ~7;\n data = gMallocFunc(alignedSize + sizeof(HuMallocHeader));\n newBlk = (HuMallocHeader *)((s32)data + alignedSize);\n\n firstBlk = gFirstMallocBlock;\n\n newBlk->prev = firstBlk;\n newBlk->next = firstBlk->next;\n firstBlk->next->prev = newBlk;\n firstBlk->next = newBlk;\n\n newBlk->tag = tag;\n newBlk->size = alignedSize;\n newBlk->data = data;\n newBlk->creationFrame = D_800D20AC_D2CAC;\n\n return newBlk->data;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/mallocblock.c#L30-L53","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:\tsw\ts1,20(sp)\n c:\tsw\ts0,16(sp)\n 10:\tmove\ts1,a1\n 14:\taddiu\ts0,a0,7\n 18:\tli\tv0,-8\n 1c:\tand\ts0,s0,v0\n 20:\tlui\tv0,0x0\n 24:\tlw\tv0,0(v0)\n 28:\tjalr\tv0\n 2c:\taddiu\ta0,s0,24\n 30:\taddu\tv1,v0,s0\n 34:\tlui\ta1,0x0\n 38:\tlw\ta1,0(a1)\n 3c:\tsw\ta1,16(v1)\n 40:\tlw\ta0,20(a1)\n 44:\tsw\ta0,20(v1)\n 48:\tlw\ta0,20(a1)\n 4c:\tsw\tv1,16(a0)\n 50:\tsw\tv1,20(a1)\n 54:\tsh\ts1,6(v1)\n 58:\tsw\ts0,8(v1)\n 5c:\tsw\tv0,0(v1)\n 60:\tlui\tv0,0x0\n 64:\tlw\tv0,0(v0)\n 68:\tsw\tv0,12(v1)\n 6c:\tlw\tv0,0(v1)\n 70:\tlw\tra,24(sp)\n 74:\tlw\ts1,20(sp)\n 78:\tlw\ts0,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,32\n\t...\n","proto":{"HuMemAllocTag":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a7c11b4b92162de0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 HuMemAllocTag\n00000000 *UND*\t00000000 gMallocFunc\n00000000 *UND*\t00000000 gFirstMallocBlock\n00000000 *UND*\t00000000 D_800D20AC_D2CAC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 gMallocFunc\n00000024 R_MIPS_LO16 gMallocFunc\n00000034 R_MIPS_HI16 gFirstMallocBlock\n00000038 R_MIPS_LO16 gFirstMallocBlock\n00000060 R_MIPS_HI16 D_800D20AC_D2CAC\n00000064 R_MIPS_LO16 D_800D20AC_D2CAC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 afb10014 afb00010 '...............\n 0010 00a08821 24900007 2402fff8 02028024 ...!$...$......$\n 0020 3c020000 8c420000 0040f809 26040018 <....B...@..&...\n 0030 00501821 3c050000 8ca50000 ac650010 .P.!<........e..\n 0040 8ca40014 ac640014 8ca40014 ac830010 .....d..........\n 0050 aca30014 a4710006 ac700008 ac620000 .....q...p...b..\n 0060 3c020000 8c420000 ac62000c 8c620000 <....B...b...b..\n 0070 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 0080 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .reginfo:\n 0000 a003003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'HuMemAllocTag' — lift: cannot lift 'HuMemAllocTag': function call 'jalr' 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,-32 */\n/* 4:\tsw\tra,24(sp) */\n/* 8:\tsw\ts1,20(sp) */\n/* c:\tsw\ts0,16(sp) */\n/* 10:\tmove\ts1,a1 */\n/* 14:\taddiu\ts0,a0,7 */\n/* 18:\tli\tv0,-8 */\n/* 1c:\tand\ts0,s0,v0 */\n/* 20:\tlui\tv0,0x0 */\n/* 24:\tlw\tv0,0(v0) */\n/* 28:\tjalr\tv0 */\n/* 2c:\taddiu\ta0,s0,24 */\n/* 30:\taddu\tv1,v0,s0 */\n/* 34:\tlui\ta1,0x0 */\n/* 38:\tlw\ta1,0(a1) */\n/* 3c:\tsw\ta1,16(v1) */\n/* 40:\tlw\ta0,20(a1) */\n/* 44:\tsw\ta0,20(v1) */\n/* 48:\tlw\ta0,20(a1) */\n/* 4c:\tsw\tv1,16(a0) */\n/* 50:\tsw\tv1,20(a1) */\n/* 54:\tsh\ts1,6(v1) */\n/* 58:\tsw\ts0,8(v1) */\n/* 5c:\tsw\tv0,0(v1) */\n/* 60:\tlui\tv0,0x0 */\n/* 64:\tlw\tv0,0(v0) */\n/* 68:\tsw\tv0,12(v1) */\n/* 6c:\tlw\tv0,0(v1) */\n/* 70:\tlw\tra,24(sp) */\n/* 74:\tlw\ts1,20(sp) */\n/* 78:\tlw\ts0,16(sp) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid HuMemAllocTag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'HuMemAllocTag': function call 'jalr' at 0x28 — 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 'HuMemAllocTag': function call 'jalr' at 0x28 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 D_800D20AC_D2CAC;\nextern void *gFirstMallocBlock;\nextern s32 (*gMallocFunc)(s32);\n\ns32 HuMemAllocTag(s32 arg0, s16 arg1) {\n s32 temp_s0;\n s32 temp_v0;\n void *temp_v1;\n\n temp_s0 = (arg0 + 7) & ~7;\n temp_v0 = gMallocFunc(temp_s0 + 0x18);\n temp_v1 = temp_v0 + temp_s0;\n temp_v1->unk10 = (void *) gFirstMallocBlock;\n temp_v1->unk14 = (void *) gFirstMallocBlock->unk14;\n gFirstMallocBlock->unk14->unk10 = temp_v1;\n gFirstMallocBlock->unk14 = temp_v1;\n temp_v1->unk6 = arg1;\n temp_v1->unk8 = temp_s0;\n temp_v1->unk0 = temp_v0;\n temp_v1->unkC = (s32) D_800D20AC_D2CAC;\n return temp_v1->unk0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: gcc 2.7.2 (docker) failed: /c.i:5551: conflicting types for `gFirstMallocBlock'","/c.i:5538: previous declaration of `gFirstMallocBlock'","/c.i:5552: conflicting types for `gMallocFunc'","/c.i:5537: previous declaration of `gMallocFunc'","/c.i:5559: warning: assignment makes pointer from integer without a cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemAllocTag` — benchmark function marioparty3:HuMemAllocTag:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemAllocTag\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n sw\t$s1, 20($sp)\n sw\t$s0, 16($sp)\n move\t$s1, $a1\n addiu\t$s0, $a0, 7\n li\t$v0, -8\n and\t$s0, $s0, $v0\n lui\t$v0, %hi(gMallocFunc)\n lw\t$v0, %lo(gMallocFunc)($v0)\n jalr\t$v0\n addiu\t$a0, $s0, 24\n addu\t$v1, $v0, $s0\n lui\t$a1, %hi(gFirstMallocBlock)\n lw\t$a1, %lo(gFirstMallocBlock)($a1)\n sw\t$a1, 16($v1)\n lw\t$a0, 20($a1)\n sw\t$a0, 20($v1)\n lw\t$a0, 20($a1)\n sw\t$v1, 16($a0)\n sw\t$v1, 20($a1)\n sh\t$s1, 6($v1)\n sw\t$s0, 8($v1)\n sw\t$v0, 0($v1)\n lui\t$v0, %hi(D_800D20AC_D2CAC)\n lw\t$v0, %lo(D_800D20AC_D2CAC)($v0)\n sw\t$v0, 12($v1)\n lw\t$v0, 0($v1)\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\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemAllocTag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemAllocTag` — benchmark function marioparty3:HuMemAllocTag:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemAllocTag: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:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tsw\ts1,20(sp)\n c:\tsw\ts0,16(sp)\n 10:\tmove\ts1,a1\n 14:\taddiu\ts0,a0,7\n 18:\tli\tv0,-8\n 1c:\tand\ts0,s0,v0\n 20:\tlui\tv0,0x0\n 24:\tlw\tv0,0(v0)\n 28:\tjalr\tv0\n 2c:\taddiu\ta0,s0,24\n 30:\taddu\tv1,v0,s0\n 34:\tlui\ta1,0x0\n 38:\tlw\ta1,0(a1)\n 3c:\tsw\ta1,16(v1)\n 40:\tlw\ta0,20(a1)\n 44:\tsw\ta0,20(v1)\n 48:\tlw\ta0,20(a1)\n 4c:\tsw\tv1,16(a0)\n 50:\tsw\tv1,20(a1)\n 54:\tsh\ts1,6(v1)\n 58:\tsw\ts0,8(v1)\n 5c:\tsw\tv0,0(v1)\n 60:\tlui\tv0,0x0\n 64:\tlw\tv0,0(v0)\n 68:\tsw\tv0,12(v1)\n 6c:\tlw\tv0,0(v1)\n 70:\tlw\tra,24(sp)\n 74:\tlw\ts1,20(sp)\n 78:\tlw\ts0,16(sp)\n 7c:\tjr\tra\n 80:\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-gcc272-a7c11b4b92162de0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 HuMemAllocTag\n00000000 *UND*\t00000000 gMallocFunc\n00000000 *UND*\t00000000 gFirstMallocBlock\n00000000 *UND*\t00000000 D_800D20AC_D2CAC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 gMallocFunc\n00000024 R_MIPS_LO16 gMallocFunc\n00000034 R_MIPS_HI16 gFirstMallocBlock\n00000038 R_MIPS_LO16 gFirstMallocBlock\n00000060 R_MIPS_HI16 D_800D20AC_D2CAC\n00000064 R_MIPS_LO16 D_800D20AC_D2CAC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 afb10014 afb00010 '...............\n 0010 00a08821 24900007 2402fff8 02028024 ...!$...$......$\n 0020 3c020000 8c420000 0040f809 26040018 <....B...@..&...\n 0030 00501821 3c050000 8ca50000 ac650010 .P.!<........e..\n 0040 8ca40014 ac640014 8ca40014 ac830010 .....d..........\n 0050 aca30014 a4710006 ac700008 ac620000 .....q...p...b..\n 0060 3c020000 8c420000 ac62000c 8c620000 <....B...b...b..\n 0070 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 0080 27bd0020 00000000 00000000 00000000 '.. ............\nContents of section .reginfo:\n 0000 a003003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"HuMemAllocTag\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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 HuMemAllocTag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","arithmetic","do-while","loop","ternary","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemoryBlockGet\n move\t$v1, $a0\n move\t$a1, $zero\n.L8:\n lbu\t$v0, 5($v1)\n xori\t$v0, $v0, 0x1\n sltiu\t$v0, $v0, 1\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .L8\n addu\t$a1, $a1, $v0\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemoryBlockGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemoryBlockGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2","sym":"HuMemUsedMemorySizeGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemorySizeGet\n move\t$v1, $a0\n move\t$a1, $zero\n li\t$a2, 1\n.Lc:\n lbu\t$v0, 5($v1)\n bne\t$v0, $a2, .L20\n nop\n lw\t$v0, 0($v1)\n addu\t$a1, $a1, $v0\n.L20:\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .Lc\n nop\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemorySizeGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemorySizeGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuSprGrpCreate:gcc2.7.2","sym":"HuSprGrpCreate","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","loop","call"],"loc":35,"refSource":"s16 HuSprGrpCreate(u16 arg0, u16 arg1) {\n HuSprGrp *temp_v0_2;\n HuSprite **var_s2;\n HuSprite *temp_v0_3;\n s16 var_s4;\n s16 i;\n\n for (i = 0; i < HUSPR_GRP_MAX; i++) {\n if (HuSprGrpData[i] == NULL) {\n break;\n }\n }\n if (i == HUSPR_GRP_MAX) {\n return -1;\n }\n var_s4 = i;\n temp_v0_2 = func_80052468_53068(arg0, arg1);\n if (temp_v0_2 == NULL) {\n return -1;\n }\n HuSprGrpData[var_s4] = temp_v0_2;\n temp_v0_2->unk_0A = 0;\n temp_v0_2->unk_0C = 1;\n var_s2 = temp_v0_2->members;\n for (i = 0; i < arg0; i++) {\n *(var_s2++) = temp_v0_3 = HuMemAlloc(0x210);\n if (temp_v0_3 == NULL) {\n HuSprGrpKill(var_s4);\n return -1;\n }\n temp_v0_2->unk_0A++;\n }\n func_80052E68_53A68(temp_v0_2, arg0);\n return var_s4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L156-L190","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\tra,40(sp)\n 8:\tsw\ts5,36(sp)\n c:\tsw\ts4,32(sp)\n 10:\tsw\ts3,28(sp)\n 14:\tsw\ts2,24(sp)\n 18:\tsw\ts1,20(sp)\n 1c:\tsw\ts0,16(sp)\n 20:\tmove\ts5,a0\n 24:\tmove\ts0,zero\n 28:\tlui\tv1,0x0\n 2c:\taddiu\tv1,v1,0\n 30:\tsll\tv0,s0,0x10\n 34:\tsra\tv0,v0,0xe\n 38:\taddu\tv0,v0,v1\n 3c:\tlw\tv0,0(v0)\n 40:\tbeqz\tv0,60 \n 44:\taddiu\tv0,s0,1\n 48:\tmove\ts0,v0\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\tv0,v0,0x10\n 54:\tslti\tv0,v0,256\n 58:\tbnez\tv0,34 \n 5c:\tsll\tv0,s0,0x10\n 60:\tsll\tv0,s0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tli\tv1,256\n 6c:\tbeq\tv0,v1,a0 \n 70:\tmove\ts4,s0\n 74:\tandi\ta0,s5,0xffff\n 78:\tjal\t0 \n 7c:\tandi\ta1,a1,0xffff\n 80:\tmove\ts1,v0\n 84:\tbnez\ts1,a8 \n 88:\tsll\tv0,s4,0x10\n 8c:\tj\t128 \n 90:\tli\tv0,-1\n 94:\tsll\ta0,s4,0x10\n 98:\tjal\t0 \n 9c:\tsra\ta0,a0,0x10\n a0:\tj\t128 \n a4:\tli\tv0,-1\n a8:\tsra\tv0,v0,0xe\n ac:\tlui\tat,0x0\n b0:\taddu\tat,at,v0\n b4:\tsw\ts1,0(at)\n b8:\tsh\tzero,10(s1)\n bc:\tli\tv0,1\n c0:\tsw\tv0,12(s1)\n c4:\taddiu\ts2,s1,16\n c8:\tandi\tv0,s5,0xffff\n cc:\tbeqz\tv0,114 \n d0:\tmove\ts0,zero\n d4:\tandi\ts3,s5,0xffff\n d8:\tjal\t0 \n dc:\tli\ta0,528\n e0:\tsw\tv0,0(s2)\n e4:\tbeqz\tv0,94 \n e8:\taddiu\ts2,s2,4\n ec:\tlhu\tv0,10(s1)\n f0:\taddiu\tv0,v0,1\n f4:\tsh\tv0,10(s1)\n f8:\taddiu\tv0,s0,1\n fc:\tmove\ts0,v0\n 100:\tsll\tv0,v0,0x10\n 104:\tsra\tv0,v0,0x10\n 108:\tslt\tv0,v0,s3\n 10c:\tbnez\tv0,d8 \n 110:\tnop\n 114:\tmove\ta0,s1\n 118:\tjal\t0 \n 11c:\tandi\ta1,s5,0xffff\n 120:\tsll\tv0,s4,0x10\n 124:\tsra\tv0,v0,0x10\n 128:\tlw\tra,40(sp)\n 12c:\tlw\ts5,36(sp)\n 130:\tlw\ts4,32(sp)\n 134:\tlw\ts3,28(sp)\n 138:\tlw\ts2,24(sp)\n 13c:\tlw\ts1,20(sp)\n 140:\tlw\ts0,16(sp)\n 144:\tjr\tra\n 148:\taddiu\tsp,sp,48\n 14c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-ac475e3b0255.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-89022a5870e5f80b/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000014c HuSprGrpCreate\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 func_80052468_53068\n00000000 *UND*\t00000000 HuSprGrpKill\n00000000 *UND*\t00000000 HuMemAlloc\n00000000 *UND*\t00000000 func_80052E68_53A68\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_HI16 HuSprGrpData\n0000002c R_MIPS_LO16 HuSprGrpData\n00000078 R_MIPS_26 func_80052468_53068\n0000008c R_MIPS_26 .text\n00000098 R_MIPS_26 HuSprGrpKill\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_HI16 HuSprGrpData\n000000b4 R_MIPS_LO16 HuSprGrpData\n000000d8 R_MIPS_26 HuMemAlloc\n00000118 R_MIPS_26 func_80052E68_53A68\n\n\nContents of section .text:\n 0000 27bdffd0 afbf0028 afb50024 afb40020 '......(...$... \n 0010 afb3001c afb20018 afb10014 afb00010 ................\n 0020 0080a821 00008021 3c030000 24630000 ...!...!<...$c..\n 0030 00101400 00021383 00431021 8c420000 .........C.!.B..\n 0040 10400007 26020001 00408021 00021400 .@..&....@.!....\n 0050 00021403 28420100 1440fff6 00101400 ....(B...@......\n 0060 00101400 00021403 24030100 1043000c ........$....C..\n 0070 0200a021 32a4ffff 0c000000 30a5ffff ...!2.......0...\n 0080 00408821 16200008 00141400 0800004a .@.!. .........J\n 0090 2402ffff 00142400 0c000000 00042403 $.....$.......$.\n 00a0 0800004a 2402ffff 00021383 3c010000 ...J$.......<...\n 00b0 00220821 ac310000 a620000a 24020001 .\".!.1... ..$...\n 00c0 ae22000c 26320010 32a2ffff 10400011 .\"..&2..2....@..\n 00d0 00008021 32b3ffff 0c000000 24040210 ...!2.......$...\n 00e0 ae420000 1040ffeb 26520004 9622000a .B...@..&R...\"..\n 00f0 24420001 a622000a 26020001 00408021 $B...\"..&....@.!\n 0100 00021400 00021403 0053102a 1440fff2 .........S.*.@..\n 0110 00000000 02202021 0c000000 32a5ffff ..... !....2...\n 0120 00141400 00021403 8fbf0028 8fb50024 ...........(...$\n 0130 8fb40020 8fb3001c 8fb20018 8fb10014 ... ............\n 0140 8fb00010 03e00008 27bd0030 00000000 ........'..0....\nContents of section .reginfo:\n 0000 a03f003e 00000000 00000000 00000000 .?.>............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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 'HuSprGrpCreate' — lift: cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — 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\tra,40(sp) */\n/* 8:\tsw\ts5,36(sp) */\n/* c:\tsw\ts4,32(sp) */\n/* 10:\tsw\ts3,28(sp) */\n/* 14:\tsw\ts2,24(sp) */\n/* 18:\tsw\ts1,20(sp) */\n/* 1c:\tsw\ts0,16(sp) */\n/* 20:\tmove\ts5,a0 */\n/* 24:\tmove\ts0,zero */\n/* 28:\tlui\tv1,0x0 */\n/* 2c:\taddiu\tv1,v1,0 */\n/* 30:\tsll\tv0,s0,0x10 */\n/* 34:\tsra\tv0,v0,0xe */\n/* 38:\taddu\tv0,v0,v1 */\n/* 3c:\tlw\tv0,0(v0) */\n/* 40:\tbeqz\tv0,60 */\n/* 44:\taddiu\tv0,s0,1 */\n/* 48:\tmove\ts0,v0 */\n/* 4c:\tsll\tv0,v0,0x10 */\n/* 50:\tsra\tv0,v0,0x10 */\n/* 54:\tslti\tv0,v0,256 */\n/* 58:\tbnez\tv0,34 */\n/* 5c:\tsll\tv0,s0,0x10 */\n/* 60:\tsll\tv0,s0,0x10 */\n/* 64:\tsra\tv0,v0,0x10 */\n/* 68:\tli\tv1,256 */\n/* 6c:\tbeq\tv0,v1,a0 */\n/* 70:\tmove\ts4,s0 */\n/* 74:\tandi\ta0,s5,0xffff */\n/* 78:\tjal\t0 */\n/* 7c:\tandi\ta1,a1,0xffff */\n/* 80:\tmove\ts1,v0 */\n/* 84:\tbnez\ts1,a8 */\n/* 88:\tsll\tv0,s4,0x10 */\n/* 8c:\tj\t128 */\n/* 90:\tli\tv0,-1 */\n/* 94:\tsll\ta0,s4,0x10 */\n/* 98:\tjal\t0 */\n/* 9c:\tsra\ta0,a0,0x10 */\n/* a0:\tj\t128 */\n/* a4:\tli\tv0,-1 */\n/* a8:\tsra\tv0,v0,0xe */\n/* ac:\tlui\tat,0x0 */\n/* b0:\taddu\tat,at,v0 */\n/* b4:\tsw\ts1,0(at) */\n/* b8:\tsh\tzero,10(s1) */\n/* bc:\tli\tv0,1 */\n/* c0:\tsw\tv0,12(s1) */\n/* c4:\taddiu\ts2,s1,16 */\n/* c8:\tandi\tv0,s5,0xffff */\n/* cc:\tbeqz\tv0,114 */\n/* d0:\tmove\ts0,zero */\n/* d4:\tandi\ts3,s5,0xffff */\n/* d8:\tjal\t0 */\n/* dc:\tli\ta0,528 */\n/* e0:\tsw\tv0,0(s2) */\n/* e4:\tbeqz\tv0,94 */\n/* e8:\taddiu\ts2,s2,4 */\n/* ec:\tlhu\tv0,10(s1) */\n/* f0:\taddiu\tv0,v0,1 */\n/* f4:\tsh\tv0,10(s1) */\n/* f8:\taddiu\tv0,s0,1 */\n/* fc:\tmove\ts0,v0 */\n/* 100:\tsll\tv0,v0,0x10 */\n/* 104:\tsra\tv0,v0,0x10 */\n/* 108:\tslt\tv0,v0,s3 */\n/* 10c:\tbnez\tv0,d8 */\n/* 110:\tnop */\n/* 114:\tmove\ta0,s1 */\n/* 118:\tjal\t0 */\n/* 11c:\tandi\ta1,s5,0xffff */\n/* 120:\tsll\tv0,s4,0x10 */\n/* 124:\tsra\tv0,v0,0x10 */\n/* 128:\tlw\tra,40(sp) */\n/* 12c:\tlw\ts5,36(sp) */\n/* 130:\tlw\ts4,32(sp) */\n/* 134:\tlw\ts3,28(sp) */\n/* 138:\tlw\ts2,24(sp) */\n/* 13c:\tlw\ts1,20(sp) */\n/* 140:\tlw\ts0,16(sp) */\n/* 144:\tjr\tra */\n/* 148:\taddiu\tsp,sp,48 */\n/* 14c:\tnop */\nvoid HuSprGrpCreate(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":92,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'HuSprGrpCreate': function call 'jal' at 0x78 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"void *func_80052468_53068(s32, s32); /* extern */\n? func_80052E68_53A68(void *, s32); /* extern */\n\ns16 HuSprGrpCreate(u16 arg0, u16 arg1) {\n s16 temp_v0;\n s16 temp_v0_4;\n s16 var_s0;\n s16 var_s0_2;\n s32 var_v0;\n void **var_s2;\n void *temp_v0_2;\n void *temp_v0_3;\n\n var_s0 = 0;\n var_v0 = 0 << 0x10;\nloop_1:\n temp_v0 = var_s0 + 1;\n if (*((var_v0 >> 0xE) + HuSprGrpData) != 0) {\n var_s0 = temp_v0;\n var_v0 = var_s0 << 0x10;\n if (temp_v0 < 0x100) {\n goto loop_1;\n }\n }\n if (var_s0 != 0x100) {\n temp_v0_2 = func_80052468_53068(arg0 & 0xFFFF, arg1 & 0xFFFF);\n if (temp_v0_2 == NULL) {\n return -1;\n }\n *(HuSprGrpData + ((s32) (var_s0 << 0x10) >> 0xE)) = temp_v0_2;\n temp_v0_2->unkA = 0U;\n temp_v0_2->unkC = 1;\n var_s2 = temp_v0_2 + 0x10;\n var_s0_2 = 0;\n if (arg0 & 0xFFFF) {\nloop_10:\n temp_v0_3 = HuMemAlloc(0x210);\n *var_s2 = temp_v0_3;\n var_s2 += 4;\n if (temp_v0_3 != NULL) {\n temp_v0_2->unkA = (u16) (temp_v0_2->unkA + 1);\n temp_v0_4 = var_s0_2 + 1;\n var_s0_2 = temp_v0_4;\n if (temp_v0_4 >= (arg0 & 0xFFFF)) {\n goto block_12;\n }\n goto loop_10;\n }\n HuSprGrpKill(var_s0);\n goto block_7;\n }\nblock_12:\n func_80052E68_53A68(temp_v0_2, arg0 & 0xFFFF);\n return var_s0;\n }\nblock_7:\n return -1;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":56,"gotos":4,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuSprGrpCreate` — benchmark function marioparty3:HuSprGrpCreate:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 HuSprGrpCreate\n addiu\t$sp, $sp, -48\n sw\t$ra, 40($sp)\n sw\t$s5, 36($sp)\n sw\t$s4, 32($sp)\n sw\t$s3, 28($sp)\n sw\t$s2, 24($sp)\n sw\t$s1, 20($sp)\n sw\t$s0, 16($sp)\n move\t$s5, $a0\n move\t$s0, $zero\n lui\t$v1, %hi(HuSprGrpData)\n addiu\t$v1, $v1, %lo(HuSprGrpData)\n sll\t$v0, $s0, 0x10\n.L34:\n sra\t$v0, $v0, 0xe\n addu\t$v0, $v0, $v1\n lw\t$v0, 0($v0)\n beqz\t$v0, .L60\n addiu\t$v0, $s0, 1\n move\t$s0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 256\n bnez\t$v0, .L34\n sll\t$v0, $s0, 0x10\n.L60:\n sll\t$v0, $s0, 0x10\n sra\t$v0, $v0, 0x10\n li\t$v1, 256\n beq\t$v0, $v1, .La0\n move\t$s4, $s0\n andi\t$a0, $s5, 0xffff\n jal\tfunc_80052468_53068\n andi\t$a1, $a1, 0xffff\n move\t$s1, $v0\n bnez\t$s1, .La8\n sll\t$v0, $s4, 0x10\n j\t.L128\n li\t$v0, -1\n.L94:\n sll\t$a0, $s4, 0x10\n jal\tHuSprGrpKill\n sra\t$a0, $a0, 0x10\n.La0:\n j\t.L128\n li\t$v0, -1\n.La8:\n sra\t$v0, $v0, 0xe\n lui\t$at, %hi(HuSprGrpData)\n addu\t$at, $at, $v0\n sw\t$s1, %lo(HuSprGrpData)($at)\n sh\t$zero, 10($s1)\n li\t$v0, 1\n sw\t$v0, 12($s1)\n addiu\t$s2, $s1, 16\n andi\t$v0, $s5, 0xffff\n beqz\t$v0, .L114\n move\t$s0, $zero\n andi\t$s3, $s5, 0xffff\n.Ld8:\n jal\tHuMemAlloc\n li\t$a0, 528\n sw\t$v0, 0($s2)\n beqz\t$v0, .L94\n addiu\t$s2, $s2, 4\n lhu\t$v0, 10($s1)\n addiu\t$v0, $v0, 1\n sh\t$v0, 10($s1)\n addiu\t$v0, $s0, 1\n move\t$s0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$v0, $v0, $s3\n bnez\t$v0, .Ld8\n nop\n.L114:\n move\t$a0, $s1\n jal\tfunc_80052E68_53A68\n andi\t$a1, $s5, 0xffff\n sll\t$v0, $s4, 0x10\n sra\t$v0, $v0, 0x10\n.L128:\n lw\t$ra, 40($sp)\n lw\t$s5, 36($sp)\n lw\t$s4, 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, 48\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-ac475e3b0255.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 HuSprGrpCreate(u16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuSprGrpCreate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuSprGrpCreate` — benchmark function marioparty3:HuSprGrpCreate:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuSprGrpCreate: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:\taddiu\tsp,sp,-48\n 4:\tsw\tra,40(sp)\n 8:\tsw\ts5,36(sp)\n c:\tsw\ts4,32(sp)\n 10:\tsw\ts3,28(sp)\n 14:\tsw\ts2,24(sp)\n 18:\tsw\ts1,20(sp)\n 1c:\tsw\ts0,16(sp)\n 20:\tmove\ts5,a0\n 24:\tmove\ts0,zero\n 28:\tlui\tv1,0x0\n 2c:\taddiu\tv1,v1,0\n 30:\tsll\tv0,s0,0x10\n 34:\tsra\tv0,v0,0xe\n 38:\taddu\tv0,v0,v1\n 3c:\tlw\tv0,0(v0)\n 40:\tbeqz\tv0,60 \n 44:\taddiu\tv0,s0,1\n 48:\tmove\ts0,v0\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\tv0,v0,0x10\n 54:\tslti\tv0,v0,256\n 58:\tbnez\tv0,34 \n 5c:\tsll\tv0,s0,0x10\n 60:\tsll\tv0,s0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tli\tv1,256\n 6c:\tbeq\tv0,v1,a0 \n 70:\tmove\ts4,s0\n 74:\tandi\ta0,s5,0xffff\n 78:\tjal\t0 \n 7c:\tandi\ta1,a1,0xffff\n 80:\tmove\ts1,v0\n 84:\tbnez\ts1,a8 \n 88:\tsll\tv0,s4,0x10\n 8c:\tj\t128 \n 90:\tli\tv0,-1\n 94:\tsll\ta0,s4,0x10\n 98:\tjal\t0 \n 9c:\tsra\ta0,a0,0x10\n a0:\tj\t128 \n a4:\tli\tv0,-1\n a8:\tsra\tv0,v0,0xe\n ac:\tlui\tat,0x0\n b0:\taddu\tat,at,v0\n b4:\tsw\ts1,0(at)\n b8:\tsh\tzero,10(s1)\n bc:\tli\tv0,1\n c0:\tsw\tv0,12(s1)\n c4:\taddiu\ts2,s1,16\n c8:\tandi\tv0,s5,0xffff\n cc:\tbeqz\tv0,114 \n d0:\tmove\ts0,zero\n d4:\tandi\ts3,s5,0xffff\n d8:\tjal\t0 \n dc:\tli\ta0,528\n e0:\tsw\tv0,0(s2)\n e4:\tbeqz\tv0,94 \n e8:\taddiu\ts2,s2,4\n ec:\tlhu\tv0,10(s1)\n f0:\taddiu\tv0,v0,1\n f4:\tsh\tv0,10(s1)\n f8:\taddiu\tv0,s0,1\n fc:\tmove\ts0,v0\n 100:\tsll\tv0,v0,0x10\n 104:\tsra\tv0,v0,0x10\n 108:\tslt\tv0,v0,s3\n 10c:\tbnez\tv0,d8 \n 110:\tnop\n 114:\tmove\ta0,s1\n 118:\tjal\t0 \n 11c:\tandi\ta1,s5,0xffff\n 120:\tsll\tv0,s4,0x10\n 124:\tsra\tv0,v0,0x10\n 128:\tlw\tra,40(sp)\n 12c:\tlw\ts5,36(sp)\n 130:\tlw\ts4,32(sp)\n 134:\tlw\ts3,28(sp)\n 138:\tlw\ts2,24(sp)\n 13c:\tlw\ts1,20(sp)\n 140:\tlw\ts0,16(sp)\n 144:\tjr\tra\n 148:\taddiu\tsp,sp,48\n 14c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-89022a5870e5f80b/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000014c HuSprGrpCreate\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 func_80052468_53068\n00000000 *UND*\t00000000 HuSprGrpKill\n00000000 *UND*\t00000000 HuMemAlloc\n00000000 *UND*\t00000000 func_80052E68_53A68\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_HI16 HuSprGrpData\n0000002c R_MIPS_LO16 HuSprGrpData\n00000078 R_MIPS_26 func_80052468_53068\n0000008c R_MIPS_26 .text\n00000098 R_MIPS_26 HuSprGrpKill\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_HI16 HuSprGrpData\n000000b4 R_MIPS_LO16 HuSprGrpData\n000000d8 R_MIPS_26 HuMemAlloc\n00000118 R_MIPS_26 func_80052E68_53A68\n\n\nContents of section .text:\n 0000 27bdffd0 afbf0028 afb50024 afb40020 '......(...$... \n 0010 afb3001c afb20018 afb10014 afb00010 ................\n 0020 0080a821 00008021 3c030000 24630000 ...!...!<...$c..\n 0030 00101400 00021383 00431021 8c420000 .........C.!.B..\n 0040 10400007 26020001 00408021 00021400 .@..&....@.!....\n 0050 00021403 28420100 1440fff6 00101400 ....(B...@......\n 0060 00101400 00021403 24030100 1043000c ........$....C..\n 0070 0200a021 32a4ffff 0c000000 30a5ffff ...!2.......0...\n 0080 00408821 16200008 00141400 0800004a .@.!. .........J\n 0090 2402ffff 00142400 0c000000 00042403 $.....$.......$.\n 00a0 0800004a 2402ffff 00021383 3c010000 ...J$.......<...\n 00b0 00220821 ac310000 a620000a 24020001 .\".!.1... ..$...\n 00c0 ae22000c 26320010 32a2ffff 10400011 .\"..&2..2....@..\n 00d0 00008021 32b3ffff 0c000000 24040210 ...!2.......$...\n 00e0 ae420000 1040ffeb 26520004 9622000a .B...@..&R...\"..\n 00f0 24420001 a622000a 26020001 00408021 $B...\"..&....@.!\n 0100 00021400 00021403 0053102a 1440fff2 .........S.*.@..\n 0110 00000000 02202021 0c000000 32a5ffff ..... !....2...\n 0120 00141400 00021403 8fbf0028 8fb50024 ...........(...$\n 0130 8fb40020 8fb3001c 8fb20018 8fb10014 ... ............\n 0140 8fb00010 03e00008 27bd0030 00000000 ........'..0....\nContents of section .reginfo:\n 0000 a03f003e 00000000 00000000 00000000 .?.>............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\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 HuSprGrpCreate # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel UnlinkProcess\n lw\t$v1, 0($a1)\n beqz\t$v1, .L14\n nop\n lw\t$v0, 4($a1)\n sw\t$v0, 4($v1)\n.L14:\n lw\t$v1, 4($a1)\n beqz\t$v1, .L2c\n nop\n lw\t$v0, 0($a1)\n j\t.L34\n sw\t$v0, 0($v1)\n.L2c:\n lw\t$v0, 0($a1)\n sw\t$v0, 0($a0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void UnlinkProcess(Process **root, Process *process);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UnlinkProcess # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:AcroBikeHandleInputTurning:agbcc","sym":"AcroBikeHandleInputTurning","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","struct","field","pointer","call"],"loc":38,"refSource":"static u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys)\n{\n u8 direction;\n\n *newDirection = gPlayerAvatar.newDirBackup;\n gPlayerAvatar.bikeFrameCounter++;\n\n // Wait 6 frames before actually changing direction\n if (gPlayerAvatar.bikeFrameCounter > 6) // ... because it takes 6 frames to advance 1 tile.\n {\n gPlayerAvatar.runningState = TURN_DIRECTION;\n gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;\n Bike_SetBikeStill();\n return ACRO_TRANS_TURN_DIRECTION;\n }\n direction = GetPlayerMovementDirection();\n if (*newDirection == AcroBike_GetJumpDirection())\n {\n Bike_SetBikeStill(); // Bike_SetBikeStill sets speed to standing, but the next line immediately overrides it. could have just reset acroBikeState to 0 here instead of wasting a jump.\n gPlayerAvatar.bikeSpeed = PLAYER_SPEED_NORMAL;\n if (*newDirection == GetOppositeDirection(direction))\n {\n // do a turn jump.\n // no need to update runningState, didnt move.\n gPlayerAvatar.acroBikeState = ACRO_STATE_TURN_JUMP;\n return ACRO_TRANS_TURN_JUMP;\n }\n else\n {\n // do a sideways jump.\n gPlayerAvatar.runningState = MOVING; // we need to move, set state to moving.\n gPlayerAvatar.acroBikeState = ACRO_STATE_SIDE_JUMP;\n return ACRO_TRANS_SIDE_JUMP;\n }\n }\n *newDirection = direction;\n return ACRO_TRANS_FACE_DIRECTION;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/bike.c#L326-L363","targetAsm":"@ Generated by 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 AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-4bcee929a307.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gPlayerAvatar","shape":"struct PlayerAvatar (36 B)"}],"outcome":"nonmatch","source":"s32 AcroBikeHandleInputTurning(u8 * a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n *a0 = gPlayerAvatar.newDirBackup;\n v0 = gPlayerAvatar.bikeFrameCounter;\n gPlayerAvatar.bikeFrameCounter = v0 + 1;\n if ((u8)(v0 + 1) <= 6) {\n v1 = GetPlayerMovementDirection();\n if (*a0 != (u8)AcroBike_GetJumpDirection()) {\n *a0 = (u8)v1;\n v2 = 0;\n } else {\n Bike_SetBikeStill();\n gPlayerAvatar.bikeSpeed = 1;\n if (*a0 != (u8)GetOppositeDirection((u8)v1)) {\n gPlayerAvatar.runningState = 2;\n gPlayerAvatar.acroBikeState = 5;\n v2 = 8;\n } else {\n gPlayerAvatar.acroBikeState = 6;\n v2 = 9;\n }\n }\n } else {\n gPlayerAvatar.runningState = 1;\n gPlayerAvatar.acroBikeState = 0;\n Bike_SetBikeStill();\n v2 = 1;\n }\n return v2;\n}\n","score":44,"maxScore":68,"compileErrors":null,"breakdown":{"insert":14,"delete":14,"replace":0,"opMismatch":2,"argMismatch":14},"quality":{"score":94,"lines":32,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys) {\n u8 temp_r0;\n u8 temp_r6;\n\n *newDirection = gPlayerAvatar.newDirBackup;\n temp_r0 = gPlayerAvatar.bikeFrameCounter + 1;\n gPlayerAvatar.bikeFrameCounter = temp_r0;\n if ((u32) temp_r0 > 6U) {\n gPlayerAvatar.runningState = 1;\n gPlayerAvatar.acroBikeState = 0;\n Bike_SetBikeStill();\n return 1U;\n }\n temp_r6 = GetPlayerMovementDirection();\n if (*newDirection == AcroBike_GetJumpDirection()) {\n Bike_SetBikeStill();\n gPlayerAvatar.bikeSpeed = 1;\n if (*newDirection == GetOppositeDirection(temp_r6)) {\n gPlayerAvatar.acroBikeState = 6;\n return 9U;\n }\n gPlayerAvatar.runningState = 2;\n gPlayerAvatar.acroBikeState = 5;\n return 8U;\n }\n *newDirection = temp_r6;\n return 0U;\n}\n","score":2,"maxScore":55,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":27,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":55,"ratio":0.03636363636363636,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AcroBikeHandleInputTurning` — benchmark function pokeemerald:AcroBikeHandleInputTurning:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\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-4bcee929a307.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic u8 AcroBikeHandleInputTurning(u8 *newDirection, u16 newKeys, u16 heldKeys);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AcroBikeHandleInputTurning # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AcroBikeHandleInputTurning` — benchmark function pokeemerald:AcroBikeHandleInputTurning:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:AcroBikeHandleInputTurning:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 AcroBikeHandleInputTurning,function\n\t.thumb_func\nAcroBikeHandleInputTurning:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tldr\tr4, .L8\n\tldrb\tr0, [r4, #0x9]\n\tstrb\tr0, [r5]\n\tldrb\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4, #0xa]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x6\n\tbls\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x0\n\tstrb\tr0, [r4, #0x8]\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgPlayerAvatar\n.L3:\n\tbl\tGetPlayerMovementDirection\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tbl\tAcroBike_GetJumpDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L4\t@cond_branch\n\tbl\tBike_SetBikeStill\n\tmov\tr0, #0x1\n\tstrb\tr0, [r4, #0xb]\n\tadd\tr0, r6, #0\n\tbl\tGetOppositeDirection\n\tldrb\tr1, [r5]\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr1, r0\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x9\n\tb\t.L7\n.L5:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r4, #0x2]\n\tmov\tr0, #0x5\n\tstrb\tr0, [r4, #0x8]\n\tmov\tr0, #0x8\n\tb\t.L7\n.L4:\n\tstrb\tr6, [r5]\n\tmov\tr0, #0x0\n.L7:\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t AcroBikeHandleInputTurning,.Lfe1-AcroBikeHandleInputTurning\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AcroBikeHandleInputTurning # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc","sym":"AnimTask_FlashHealthboxOnLevelUp_Step","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","array","switch","ternary","call","comparison-tree"],"loc":36,"refSource":"static void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId)\n{\n u8 paletteNum;\n u32 paletteOffset, colorOffset;\n\n gTasks[taskId].data[0]++;\n if (gTasks[taskId].data[0]++ >= gTasks[taskId].data[11])\n {\n gTasks[taskId].data[0] = 0;\n paletteNum = IndexOfSpritePaletteTag(TAG_HEALTHBOX_PALS_1);\n colorOffset = gTasks[taskId].data[10] == 0 ? 6 : 2;\n switch (gTasks[taskId].data[1])\n {\n case 0:\n gTasks[taskId].data[2] += 2;\n if (gTasks[taskId].data[2] > 16)\n gTasks[taskId].data[2] = 16;\n\n paletteOffset = OBJ_PLTT_ID(paletteNum);\n BlendPalette(paletteOffset + colorOffset, 1, gTasks[taskId].data[2], RGB(20, 27, 31));\n if (gTasks[taskId].data[2] == 16)\n gTasks[taskId].data[1]++;\n break;\n case 1:\n gTasks[taskId].data[2] -= 2;\n if (gTasks[taskId].data[2] < 0)\n gTasks[taskId].data[2] = 0;\n\n paletteOffset = OBJ_PLTT_ID(paletteNum);\n BlendPalette(paletteOffset + colorOffset, 1, gTasks[taskId].data[2], RGB(20, 27, 31));\n if (gTasks[taskId].data[2] == 0)\n DestroyAnimVisualTask(taskId);\n break;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_anim_throw.c#L605-L640","targetAsm":"@ Generated by 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 AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-f77ea1056385.i.gz","proto":{"AnimTask_FlashHealthboxOnLevelUp_Step":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'AnimTask_FlashHealthboxOnLevelUp_Step' — raise: cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — 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.type\t AnimTask_FlashHealthboxOnLevelUp_Step,function */\n/* \t.thumb_func */\n/* AnimTask_FlashHealthboxOnLevelUp_Step: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr1, .L17 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr4, r0, r1 */\n/* \tldrh\tr0, [r4, #0x8] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tmov\tr6, #0x0 */\n/* \tadd\tr1, r0, #0x1 */\n/* \tstrh\tr1, [r4, #0x8] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tmov\tr2, #0x1e */\n/* \tldrsh\tr1, [r4, r2] */\n/* \tcmp\tr0, r1 */\n/* \tblt\t.L5\t@cond_branch */\n/* \tstrh\tr6, [r4, #0x8] */\n/* \tldr\tr0, .L17+0x4 */\n/* \tbl\tIndexOfSpritePaletteTag */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr2, r0, #0x18 */\n/* \tmov\tr3, #0x1c */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tmov\tr1, #0x2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x6 */\n/* .L6: */\n/* \tmov\tr3, #0xa */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tcmp\tr0, #0x1 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tb\t.L5 */\n/* .L18: */\n/* \t.align\t2, 0 */\n/* .L17: */\n/* \t.word\tgTasks */\n/* \t.word\t0xd709 */\n/* .L9: */\n/* \tldrh\tr0, [r4, #0xc] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x10 */\n/* \tble\t.L10\t@cond_branch */\n/* \tmov\tr0, #0x10 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* .L10: */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tldrb\tr2, [r4, #0xc] */\n/* \tldr\tr3, .L19 */\n/* \tmov\tr1, #0x1 */\n/* \tbl\tBlendPalette */\n/* \tmov\tr3, #0xc */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0x10 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tldrh\tr0, [r4, #0xa] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrh\tr0, [r4, #0xa] */\n/* \tb\t.L5 */\n/* .L20: */\n/* \t.align\t2, 0 */\n/* .L19: */\n/* \t.word\t0x7f74 */\n/* .L12: */\n/* \tldrh\tr0, [r4, #0xc] */\n/* \tsub\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L13\t@cond_branch */\n/* \tstrh\tr6, [r4, #0xc] */\n/* .L13: */\n/* \tlsl\tr0, r2, #0x4 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x1 */\n/* \tadd\tr0, r0, r2 */\n/* \torr\tr0, r0, r1 */\n/* \tldrb\tr2, [r4, #0xc] */\n/* \tldr\tr3, .L21 */\n/* \tmov\tr1, #0x1 */\n/* \tbl\tBlendPalette */\n/* \tmov\tr3, #0xc */\n/* \tldrsh\tr0, [r4, r3] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tDestroyAnimVisualTask */\n/* .L5: */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L22: */\n/* \t.align\t2, 0 */\n/* .L21: */\n/* \t.word\t0x7f74 */\n/* .Lfe1: */\n/* \t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step */\n/* .text */\n/* \t.align\t2, 0 */\nvoid AnimTask_FlashHealthboxOnLevelUp_Step(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":124,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 12 (widths 2 and 1) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId) {\n s16 temp_r0;\n s16 temp_r0_2;\n s16 temp_r0_3;\n s16 temp_r0_4;\n s32 var_r1;\n struct Task *temp_r4;\n u8 temp_r2;\n u8 temp_r5;\n\n temp_r5 = taskId;\n temp_r4 = &gTasks[temp_r5];\n temp_r0 = (u16) temp_r4->data[0] + 1;\n temp_r4->data[0] = temp_r0 + 1;\n if ((s32) temp_r0 >= (s32) temp_r4->data[0xB]) {\n temp_r4->data[0] = 0;\n temp_r2 = IndexOfSpritePaletteTag(0xD709U);\n var_r1 = 2;\n if (temp_r4->data[0xA] == 0) {\n var_r1 = 6;\n }\n temp_r0_2 = temp_r4->data[1];\n switch (temp_r0_2) { /* irregular */\n case 0:\n temp_r0_3 = (u16) temp_r4->data[2] + 2;\n temp_r4->data[2] = temp_r0_3;\n if ((s32) temp_r0_3 > 0x10) {\n temp_r4->data[2] = 0x10;\n }\n BlendPalette(((temp_r2 * 0x10) + 0x100) | var_r1, 1U, (u8) temp_r4->unkC, 0x7F74U);\n if (temp_r4->data[2] == 0x10) {\n temp_r4->data[1] = (u16) temp_r4->data[1] + 1;\n return;\n }\n break;\n case 1:\n temp_r0_4 = (u16) temp_r4->data[2] - 2;\n temp_r4->data[2] = temp_r0_4;\n if ((s32) (temp_r0_4 << 0x10) < 0) {\n temp_r4->data[2] = 0;\n }\n BlendPalette(((temp_r2 * 0x10) + 0x100) | var_r1, 1U, (u8) temp_r4->unkC, 0x7F74U);\n if (temp_r4->data[2] == 0) {\n DestroyAnimVisualTask(temp_r5);\n }\n break;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":48,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:11332: structure has no member named `unkC'","/c.c:11344: structure has no member named `unkC'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AnimTask_FlashHealthboxOnLevelUp_Step` — benchmark function pokeemerald:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\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-f77ea1056385.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AnimTask_FlashHealthboxOnLevelUp_Step # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AnimTask_FlashHealthboxOnLevelUp_Step` — benchmark function pokeemerald:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:AnimTask_FlashHealthboxOnLevelUp_Step:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 AnimTask_FlashHealthboxOnLevelUp_Step,function\n\t.thumb_func\nAnimTask_FlashHealthboxOnLevelUp_Step:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr1, .L17\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x3\n\tadd\tr4, r0, r1\n\tldrh\tr0, [r4, #0x8]\n\tadd\tr0, r0, #0x1\n\tmov\tr6, #0x0\n\tadd\tr1, r0, #0x1\n\tstrh\tr1, [r4, #0x8]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tmov\tr2, #0x1e\n\tldrsh\tr1, [r4, r2]\n\tcmp\tr0, r1\n\tblt\t.L5\t@cond_branch\n\tstrh\tr6, [r4, #0x8]\n\tldr\tr0, .L17+0x4\n\tbl\tIndexOfSpritePaletteTag\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tmov\tr3, #0x1c\n\tldrsh\tr0, [r4, r3]\n\tmov\tr1, #0x2\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x6\n.L6:\n\tmov\tr3, #0xa\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L12\t@cond_branch\n\tb\t.L5\n.L18:\n\t.align\t2, 0\n.L17:\n\t.word\tgTasks\n\t.word\t0xd709\n.L9:\n\tldrh\tr0, [r4, #0xc]\n\tadd\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x10\n\tble\t.L10\t@cond_branch\n\tmov\tr0, #0x10\n\tstrh\tr0, [r4, #0xc]\n.L10:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L19\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0x10\n\tbne\t.L5\t@cond_branch\n\tldrh\tr0, [r4, #0xa]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r4, #0xa]\n\tb\t.L5\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x7f74\n.L12:\n\tldrh\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tbge\t.L13\t@cond_branch\n\tstrh\tr6, [r4, #0xc]\n.L13:\n\tlsl\tr0, r2, #0x4\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\torr\tr0, r0, r1\n\tldrb\tr2, [r4, #0xc]\n\tldr\tr3, .L21\n\tmov\tr1, #0x1\n\tbl\tBlendPalette\n\tmov\tr3, #0xc\n\tldrsh\tr0, [r4, r3]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tDestroyAnimVisualTask\n.L5:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x7f74\n.Lfe1:\n\t.size\t AnimTask_FlashHealthboxOnLevelUp_Step,.Lfe1-AnimTask_FlashHealthboxOnLevelUp_Step\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 \"AnimTask_FlashHealthboxOnLevelUp_Step\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AnimTask_FlashHealthboxOnLevelUp_Step # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","pointer","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","loop","nested-loop","shift","bitwise"],"loc":18,"refSource":"u16 CalcCRC16(const u8 *data, s32 length)\n{\n u16 i, j;\n u16 crc = 0x1121;\n\n for (i = 0; i < length; i++)\n {\n crc ^= data[i];\n for (j = 0; j < 8; j++)\n {\n if (crc & 1)\n crc = (crc >> 1) ^ 0x8408;\n else\n crc >>= 1;\n }\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = (u32)v2 >> 1;\n } else {\n v4 = (u16)((u32)v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n","score":45,"maxScore":55,"compileErrors":null,"breakdown":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21},"quality":{"score":86,"lines":30,"gotos":0,"casts":7,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 CalcCRC16(s32 arg0, s32 arg1) {\n u16 var_r1;\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (arg1 > 0) {\n do {\n var_r2 ^= *(arg0 + var_r3);\n var_r1 = 0;\nloop_3:\n if (var_r2 & 1) {\n var_r2 = (var_r2 >> 1) ^ 0x8408;\n } else {\n var_r2 = (u16) (var_r2 >> 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 <= 7U) {\n goto loop_3;\n }\n var_r3 += 1;\n } while ((s32) var_r3 < arg1);\n }\n return (u16) ~var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":84,"lines":25,"gotos":1,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":45,"maxScore":55,"ratio":0.8181818181818182,"kinds":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","cast","table","loop","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","global","table","shift","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Cmd_tryconversiontypechange:agbcc","sym":"Cmd_tryconversiontypechange","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","struct","do-while","loop","nested-loop","call"],"loc":60,"refSource":"static void Cmd_tryconversiontypechange(void)\n{\n u8 validMoves = 0;\n u8 moveChecked;\n u8 moveType;\n\n while (validMoves < MAX_MON_MOVES)\n {\n if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE)\n break;\n\n validMoves++;\n }\n\n for (moveChecked = 0; moveChecked < validMoves; moveChecked++)\n {\n moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;\n\n if (moveType == TYPE_MYSTERY)\n {\n if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))\n moveType = TYPE_GHOST;\n else\n moveType = TYPE_NORMAL;\n }\n if (moveType != gBattleMons[gBattlerAttacker].types[0]\n && moveType != gBattleMons[gBattlerAttacker].types[1])\n {\n break;\n }\n }\n\n if (moveChecked == validMoves)\n {\n gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);\n }\n else\n {\n do\n {\n while ((moveChecked = MOD(Random(), MAX_MON_MOVES)) >= validMoves);\n\n moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;\n\n if (moveType == TYPE_MYSTERY)\n {\n if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))\n moveType = TYPE_GHOST;\n else\n moveType = TYPE_NORMAL;\n }\n }\n while (moveType == gBattleMons[gBattlerAttacker].types[0] || moveType == gBattleMons[gBattlerAttacker].types[1]);\n\n SET_BATTLER_TYPE(gBattlerAttacker, moveType);\n PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);\n\n gBattlescriptCurrInstr += 5;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_script_commands.c#L7389-L7448","targetAsm":"@ Generated by 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 Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-49ee5beb3f01.i.gz","proto":{"Cmd_tryconversiontypechange":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Cmd_tryconversiontypechange' — structure: cannot structure 'Cmd_tryconversiontypechange': 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.type\t Cmd_tryconversiontypechange,function */\n/* \t.thumb_func */\n/* Cmd_tryconversiontypechange: */\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/* \tmov\tr6, #0x0 */\n/* \tldr\tr2, .L35 */\n/* \tldr\tr3, .L35+0x4 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr1, r2, #0 */\n/* \tadd\tr1, r1, #0xc */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0] */\n/* \tmov\tr8, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x58 */\n/* \tadd\tr2, r1, #0 */\n/* .L8: */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tcmp\tr6, #0x3 */\n/* \tbhi\t.L6\t@cond_branch */\n/* \tlsl\tr1, r6, #0x1 */\n/* \tldrb\tr0, [r3] */\n/* \tmul\tr0, r0, r5 */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr1, r1, r2 */\n/* \tldrh\tr0, [r1] */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* .L6: */\n/* \tmov\tr3, #0x0 */\n/* \tcmp\tr3, r6 */\n/* \tbcs\t.L11\t@cond_branch */\n/* \tldr\tr0, .L35+0x8 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr5, .L35 */\n/* \tmov\tip, r5 */\n/* \tldr\tr7, .L35+0x4 */\n/* \tldrb\tr0, [r7] */\n/* \tmov\tr4, #0x58 */\n/* \tmov\tr5, r0 */\n/* \tmul\tr5, r5, r4 */\n/* \tmov\tr0, #0xc */\n/* \tadd\tr0, r0, ip */\n/* \tmov\tr9, r0 */\n/* .L13: */\n/* \tlsl\tr0, r3, #0x1 */\n/* \tadd\tr0, r0, r5 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, sl */\n/* \tldrb\tr2, [r0, #0x2] */\n/* \tcmp\tr2, #0x9 */\n/* \tbne\t.L14\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr1, r5, r0 */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x21 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbne\t.L15\t@cond_branch */\n/* .L16: */\n/* \tmov\tr2, #0x7 */\n/* \tb\t.L14 */\n/* .L36: */\n/* \t.align\t2, 0 */\n/* .L35: */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgBattleMoves */\n/* .L15: */\n/* \tmov\tr2, #0x0 */\n/* .L14: */\n/* \tldrb\tr0, [r7] */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, ip */\n/* \tadd\tr1, r0, #0 */\n/* \tadd\tr1, r1, #0x21 */\n/* \tldrb\tr1, [r1] */\n/* \tcmp\tr2, r1 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr2, r0 */\n/* \tbne\t.L11\t@cond_branch */\n/* .L12: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, r6 */\n/* \tbcc\t.L13\t@cond_branch */\n/* .L11: */\n/* \tcmp\tr3, r6 */\n/* \tbne\t.L20\t@cond_branch */\n/* \tldr\tr3, .L37 */\n/* \tldr\tr2, [r3] */\n/* \tldrb\tr1, [r2, #0x1] */\n/* \tldrb\tr0, [r2, #0x2] */\n/* \tlsl\tr0, r0, #0x8 */\n/* \torr\tr1, r1, r0 */\n/* \tldrb\tr0, [r2, #0x3] */\n/* \tlsl\tr0, r0, #0x10 */\n/* \torr\tr1, r1, r0 */\n/* \tldrb\tr0, [r2, #0x4] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \torr\tr1, r1, r0 */\n/* \tstr\tr1, [r3] */\n/* \tb\t.L21 */\n/* .L38: */\n/* \t.align\t2, 0 */\n/* .L37: */\n/* \t.word\tgBattlescriptCurrInstr */\n/* .L20: */\n/* \tmov\tr7, #0x3 */\n/* \tldr\tr5, .L39 */\n/* \tmov\tr9, r5 */\n/* .L25: */\n/* \tbl\tRandom */\n/* \tadd\tr3, r0, #0 */\n/* \tand\tr3, r3, r7 */\n/* \tcmp\tr3, r6 */\n/* \tbcs\t.L25\t@cond_branch */\n/* \tldr\tr4, .L39+0x4 */\n/* \tlsl\tr1, r3, #0x1 */\n/* \tldr\tr3, .L39+0x8 */\n/* \tldrb\tr2, [r3] */\n/* \tmov\tr0, #0x58 */\n/* \tmov\tr5, r2 */\n/* \tmul\tr5, r5, r0 */\n/* \tadd\tr1, r1, r5 */\n/* \tadd\tr0, r4, #0 */\n/* \tadd\tr0, r0, #0xc */\n/* \tadd\tr1, r1, r0 */\n/* \tldrh\tr1, [r1] */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrb\tr2, [r0, #0x2] */\n/* \tmov\tr8, r4 */\n/* \tadd\tr4, r3, #0 */\n/* \tcmp\tr2, #0x9 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr2, r5, r0 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x21 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L31\t@cond_branch */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x7 */\n/* \tbne\t.L30\t@cond_branch */\n/* .L31: */\n/* \tmov\tr2, #0x7 */\n/* \tb\t.L24 */\n/* .L40: */\n/* \t.align\t2, 0 */\n/* .L39: */\n/* \t.word\tgBattleMoves */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlerAttacker */\n/* .L30: */\n/* \tmov\tr2, #0x0 */\n/* .L24: */\n/* \tldrb\tr0, [r4] */\n/* \tmov\tr3, #0x58 */\n/* \tmul\tr0, r0, r3 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr1, r0, #0 */\n/* \tadd\tr1, r1, #0x21 */\n/* \tldrb\tr5, [r1] */\n/* \tcmp\tr2, r5 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tadd\tr0, r0, #0x22 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr2, r0 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tstrb\tr2, [r1] */\n/* \tldrb\tr0, [r4] */\n/* \tmul\tr0, r0, r3 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, #0x22 */\n/* \tstrb\tr2, [r0] */\n/* \tldr\tr1, .L41 */\n/* \tmov\tr0, #0xfd */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr0, #0x3 */\n/* \tstrb\tr0, [r1, #0x1] */\n/* \tstrb\tr2, [r1, #0x2] */\n/* \tmov\tr0, #0xff */\n/* \tstrb\tr0, [r1, #0x3] */\n/* \tldr\tr1, .L41+0x4 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x5 */\n/* \tstr\tr0, [r1] */\n/* .L21: */\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/* .L42: */\n/* \t.align\t2, 0 */\n/* .L41: */\n/* \t.word\tgBattleTextBuff1 */\n/* \t.word\tgBattlescriptCurrInstr */\n/* .Lfe1: */\n/* \t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Cmd_tryconversiontypechange(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'Cmd_tryconversiontypechange': 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":241,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'Cmd_tryconversiontypechange': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Cmd_tryconversiontypechange(void) {\n struct BattlePokemon *temp_r0;\n struct BattlePokemon *temp_r0_2;\n struct BattlePokemon *temp_r1;\n struct BattlePokemon *temp_r2;\n u32 temp_r3;\n u8 var_r2;\n u8 var_r2_2;\n u8 var_r3;\n u8 var_r6;\n\n var_r6 = 0;\n if (*((0x58 * gBattlerAttacker) + gBattleMons->moves) != 0) {\nloop_2:\n var_r6 += 1;\n if ((u32) var_r6 <= 3U) {\n if (*((var_r6 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves) != 0) {\n goto loop_2;\n }\n }\n }\n var_r3 = 0;\n if ((u32) var_r6 > 0U) {\nloop_6:\n var_r2 = gBattleMoves[*((var_r3 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves)].type;\n if (var_r2 == 9) {\n temp_r1 = &gBattleMons[gBattlerAttacker];\n if ((temp_r1->types[0] == 7) || (temp_r1->types[1] == 7)) {\n var_r2 = 7;\n } else {\n var_r2 = 0;\n }\n }\n temp_r0 = &gBattleMons[gBattlerAttacker];\n if ((var_r2 == temp_r0->types[0]) || (var_r2 == temp_r0->types[1])) {\n var_r3 += 1;\n if ((u32) var_r3 < (u32) var_r6) {\n goto loop_6;\n }\n }\n }\n if (var_r3 == var_r6) {\n gBattlescriptCurrInstr = (u8 *) (gBattlescriptCurrInstr->unk1 | (gBattlescriptCurrInstr->unk2 << 8) | (gBattlescriptCurrInstr->unk3 << 0x10) | (gBattlescriptCurrInstr->unk4 << 0x18));\n return;\n }\n do {\nloop_17:\n temp_r3 = Random() & 3;\n if (temp_r3 >= (u32) var_r6) {\n goto loop_17;\n }\n var_r2_2 = gBattleMoves[*((temp_r3 * 2) + (gBattlerAttacker * 0x58) + gBattleMons->moves)].type;\n if (var_r2_2 == 9) {\n temp_r2 = &gBattleMons[gBattlerAttacker];\n if ((temp_r2->types[0] == 7) || (temp_r2->types[1] == 7)) {\n var_r2_2 = 7;\n } else {\n var_r2_2 = 0;\n }\n }\n temp_r0_2 = &gBattleMons[gBattlerAttacker];\n if (var_r2_2 == temp_r0_2->types[0]) {\n goto loop_17;\n }\n } while (var_r2_2 == temp_r0_2->types[1]);\n temp_r0_2->types[0] = var_r2_2;\n gBattleMons[gBattlerAttacker].types[1] = var_r2_2;\n gBattleTextBuff1->unk0 = 0xFD;\n gBattleTextBuff1[1] = 3;\n gBattleTextBuff1[2] = var_r2_2;\n gBattleTextBuff1[3] = 0xFF;\n gBattlescriptCurrInstr += 5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":54,"lines":72,"gotos":4,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:8306: request for member `unk1' in something not a structure or union","/c.c:8306: request for member `unk2' in something not a structure or union","/c.c:8306: request for member `unk3' in something not a structure or union","/c.c:8306: request for member `unk4' in something not a structure or union","/c.c:8331: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Cmd_tryconversiontypechange` — benchmark function pokeemerald:Cmd_tryconversiontypechange:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\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-49ee5beb3f01.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void Cmd_tryconversiontypechange(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Cmd_tryconversiontypechange # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Cmd_tryconversiontypechange` — benchmark function pokeemerald:Cmd_tryconversiontypechange:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Cmd_tryconversiontypechange:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 Cmd_tryconversiontypechange,function\n\t.thumb_func\nCmd_tryconversiontypechange:\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\tmov\tr6, #0x0\n\tldr\tr2, .L35\n\tldr\tr3, .L35+0x4\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr1, r2, #0\n\tadd\tr1, r1, #0xc\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tmov\tr8, r2\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x58\n\tadd\tr2, r1, #0\n.L8:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tcmp\tr6, #0x3\n\tbhi\t.L6\t@cond_branch\n\tlsl\tr1, r6, #0x1\n\tldrb\tr0, [r3]\n\tmul\tr0, r0, r5\n\tadd\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tldrh\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L8\t@cond_branch\n.L6:\n\tmov\tr3, #0x0\n\tcmp\tr3, r6\n\tbcs\t.L11\t@cond_branch\n\tldr\tr0, .L35+0x8\n\tmov\tsl, r0\n\tldr\tr5, .L35\n\tmov\tip, r5\n\tldr\tr7, .L35+0x4\n\tldrb\tr0, [r7]\n\tmov\tr4, #0x58\n\tmov\tr5, r0\n\tmul\tr5, r5, r4\n\tmov\tr0, #0xc\n\tadd\tr0, r0, ip\n\tmov\tr9, r0\n.L13:\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r5\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, sl\n\tldrb\tr2, [r0, #0x2]\n\tcmp\tr2, #0x9\n\tbne\t.L14\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr1, r5, r0\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L16\t@cond_branch\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L15\t@cond_branch\n.L16:\n\tmov\tr2, #0x7\n\tb\t.L14\n.L36:\n\t.align\t2, 0\n.L35:\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n\t.word\tgBattleMoves\n.L15:\n\tmov\tr2, #0x0\n.L14:\n\tldrb\tr0, [r7]\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, ip\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr1, [r1]\n\tcmp\tr2, r1\n\tbeq\t.L12\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbne\t.L11\t@cond_branch\n.L12:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, r6\n\tbcc\t.L13\t@cond_branch\n.L11:\n\tcmp\tr3, r6\n\tbne\t.L20\t@cond_branch\n\tldr\tr3, .L37\n\tldr\tr2, [r3]\n\tldrb\tr1, [r2, #0x1]\n\tldrb\tr0, [r2, #0x2]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tldrb\tr0, [r2, #0x4]\n\tlsl\tr0, r0, #0x18\n\torr\tr1, r1, r0\n\tstr\tr1, [r3]\n\tb\t.L21\n.L38:\n\t.align\t2, 0\n.L37:\n\t.word\tgBattlescriptCurrInstr\n.L20:\n\tmov\tr7, #0x3\n\tldr\tr5, .L39\n\tmov\tr9, r5\n.L25:\n\tbl\tRandom\n\tadd\tr3, r0, #0\n\tand\tr3, r3, r7\n\tcmp\tr3, r6\n\tbcs\t.L25\t@cond_branch\n\tldr\tr4, .L39+0x4\n\tlsl\tr1, r3, #0x1\n\tldr\tr3, .L39+0x8\n\tldrb\tr2, [r3]\n\tmov\tr0, #0x58\n\tmov\tr5, r2\n\tmul\tr5, r5, r0\n\tadd\tr1, r1, r5\n\tadd\tr0, r4, #0\n\tadd\tr0, r0, #0xc\n\tadd\tr1, r1, r0\n\tldrh\tr1, [r1]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrb\tr2, [r0, #0x2]\n\tmov\tr8, r4\n\tadd\tr4, r3, #0\n\tcmp\tr2, #0x9\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr2, r5, r0\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x21\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbeq\t.L31\t@cond_branch\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x7\n\tbne\t.L30\t@cond_branch\n.L31:\n\tmov\tr2, #0x7\n\tb\t.L24\n.L40:\n\t.align\t2, 0\n.L39:\n\t.word\tgBattleMoves\n\t.word\tgBattleMons\n\t.word\tgBattlerAttacker\n.L30:\n\tmov\tr2, #0x0\n.L24:\n\tldrb\tr0, [r4]\n\tmov\tr3, #0x58\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr1, r0, #0\n\tadd\tr1, r1, #0x21\n\tldrb\tr5, [r1]\n\tcmp\tr2, r5\n\tbeq\t.L25\t@cond_branch\n\tadd\tr0, r0, #0x22\n\tldrb\tr0, [r0]\n\tcmp\tr2, r0\n\tbeq\t.L25\t@cond_branch\n\tstrb\tr2, [r1]\n\tldrb\tr0, [r4]\n\tmul\tr0, r0, r3\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, #0x22\n\tstrb\tr2, [r0]\n\tldr\tr1, .L41\n\tmov\tr0, #0xfd\n\tstrb\tr0, [r1]\n\tmov\tr0, #0x3\n\tstrb\tr0, [r1, #0x1]\n\tstrb\tr2, [r1, #0x2]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r1, #0x3]\n\tldr\tr1, .L41+0x4\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x5\n\tstr\tr0, [r1]\n.L21:\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.L42:\n\t.align\t2, 0\n.L41:\n\t.word\tgBattleTextBuff1\n\t.word\tgBattlescriptCurrInstr\n.Lfe1:\n\t.size\t Cmd_tryconversiontypechange,.Lfe1-Cmd_tryconversiontypechange\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 \"Cmd_tryconversiontypechange\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cmd_tryconversiontypechange # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","loop","shift","bitwise"],"loc":13,"refSource":"int CountTrailingZeroBits(u32 value)\n{\n u8 i;\n\n for (i = 0; i < 32; i++)\n {\n if ((value & 1) == 0)\n value >>= 1;\n else\n return i;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = (u32)v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n","score":19,"maxScore":23,"compileErrors":null,"breakdown":{"insert":6,"delete":2,"replace":0,"opMismatch":2,"argMismatch":9},"quality":{"score":100,"lines":15,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CountTrailingZeroBits(u32 arg0) {\n u32 var_r2;\n u8 var_r1;\n\n var_r2 = arg0;\n var_r1 = 0;\nloop_1:\n if (var_r2 & 1) {\n return var_r1;\n }\n var_r2 = var_r2 >> 1;\n var_r1 += 1;\n if ((u32) var_r1 > 0x1FU) {\n return 0U;\n }\n goto loop_1;\n}\n","score":15,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9},"quality":{"score":88,"lines":16,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":19,"ratio":0.7894736842105263,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:DoForcedMovement:agbcc","sym":"DoForcedMovement","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["fnptr","branch","global","bitwise","call"],"loc":29,"refSource":"static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8))\n{\n struct PlayerAvatar *playerAvatar = &gPlayerAvatar;\n u8 collision = CheckForPlayerAvatarCollision(direction);\n\n playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;\n if (collision)\n {\n ForcedMovement_None();\n if (collision < COLLISION_STOP_SURFING)\n {\n return FALSE;\n }\n else\n {\n if (collision == COLLISION_LEDGE_JUMP)\n PlayerJumpLedge(direction);\n playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;\n playerAvatar->runningState = MOVING;\n return TRUE;\n }\n }\n else\n {\n playerAvatar->runningState = MOVING;\n moveFunc(direction);\n return TRUE;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/field_player_avatar.c#L443-L471","targetAsm":"@ Generated by 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 DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-8b0dad249cd1.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gPlayerAvatar","shape":"struct PlayerAvatar (36 B)"}],"outcome":"nonmatch","source":"s32 DoForcedMovement(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 a5) {\n s32 v0;\n s32 v1;\n v0 = CheckForPlayerAvatarCollision((u8)a0);\n v1 = 64;\n gPlayerAvatar.flags = gPlayerAvatar.flags | v1;\n if ((u8)v0 != 0) {\n ForcedMovement_None();\n if ((u8)v0 <= 4) {\n return 0;\n } else {\n if ((u8)v0 == 6) PlayerJumpLedge((u8)a0);\n gPlayerAvatar.flags = gPlayerAvatar.flags | v1;\n gPlayerAvatar.runningState = 2;\n return 1;\n }\n } else {\n gPlayerAvatar.runningState = 2;\n _call_via_r9((u8)a0, v1);\n return 1;\n }\n}\n","score":31,"maxScore":59,"compileErrors":null,"breakdown":{"insert":5,"delete":12,"replace":2,"opMismatch":0,"argMismatch":12},"quality":{"score":92,"lines":22,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u8 CheckForPlayerAvatarCollision(u8); /* extern */\n? ForcedMovement_None(); /* extern */\n\nu8 DoForcedMovement(u8 direction, void (*moveFunc)(u8)) {\n u8 temp_r4;\n u8 temp_r5;\n u8 temp_r7;\n\n temp_r5 = direction;\n temp_r4 = CheckForPlayerAvatarCollision(temp_r5);\n temp_r7 = temp_r4;\n gPlayerAvatar.flags |= 0x40;\n if (temp_r4 != 0) {\n ForcedMovement_None();\n if ((u32) temp_r4 <= 4U) {\n return 0U;\n }\n if (temp_r7 == 6) {\n PlayerJumpLedge(temp_r5);\n }\n gPlayerAvatar.flags |= 0x40;\n gPlayerAvatar.runningState = 2;\n goto block_7;\n }\n gPlayerAvatar.runningState = 2;\n moveFunc(temp_r5);\nblock_7:\n return 1U;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":86,"lines":27,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":31,"maxScore":59,"ratio":0.5254237288135594,"kinds":{"insert":5,"delete":12,"replace":2,"opMismatch":0,"argMismatch":12}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DoForcedMovement` — benchmark function pokeemerald:DoForcedMovement:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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.type\t DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\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-8b0dad249cd1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8));\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DoForcedMovement # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DoForcedMovement` — benchmark function pokeemerald:DoForcedMovement:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:DoForcedMovement:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 DoForcedMovement,function\n\t.thumb_func\nDoForcedMovement:\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\tmov\tr9, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L10\n\tadd\tr0, r5, #0\n\tbl\tCheckForPlayerAvatarCollision\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tadd\tr7, r4, #0\n\tldrb\tr0, [r6]\n\tmov\tr1, #0x40\n\tmov\tsl, r1\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tcmp\tr4, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tForcedMovement_None\n\tcmp\tr4, #0x4\n\tbhi\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgPlayerAvatar\n.L4:\n\tcmp\tr7, #0x6\n\tbne\t.L6\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tPlayerJumpLedge\n.L6:\n\tldrb\tr0, [r6]\n\tmov\tr1, sl\n\torr\tr0, r0, r1\n\tstrb\tr0, [r6]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tb\t.L9\n.L3:\n\tmov\tr0, #0x2\n\tstrb\tr0, [r6, #0x2]\n\tadd\tr0, r5, #0\n\tbl\t_call_via_r9\n.L9:\n\tmov\tr0, #0x1\n.L8:\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.Lfe1:\n\t.size\t DoForcedMovement,.Lfe1-DoForcedMovement\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DoForcedMovement # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["global","macro","shift"],"loc":5,"refSource":"static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"sFeebasRngValue","shape":"scalar u32"}],"outcome":"match","source":"s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return (u32)(1103515245 * v0 + 12345) >> 16;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 sFeebasRngValue;\n\nu32 FeebasRandom(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * sFeebasRngValue) + 0x3039;\n sFeebasRngValue = temp_r0;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","global","struct","switch","bitwise","comparison-tree"],"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 || ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > 255 || ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 < 254) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n }\n }\n return v0;\n}\n","score":32,"maxScore":37,"compileErrors":null,"breakdown":{"insert":6,"delete":9,"replace":4,"opMismatch":4,"argMismatch":9},"quality":{"score":90,"lines":18,"gotos":0,"casts":7,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:GetMoveTarget:agbcc","sym":"GetMoveTarget","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","global","switch","do-while","loop","bitwise","soft-div","call","jump-table"],"loc":84,"refSource":"u8 GetMoveTarget(u16 move, u8 setTarget)\n{\n u8 targetBattler = 0;\n u8 moveTarget;\n u8 side;\n\n if (setTarget != NO_TARGET_OVERRIDE)\n moveTarget = setTarget - 1;\n else\n moveTarget = gBattleMoves[move].target;\n\n switch (moveTarget)\n {\n case MOVE_TARGET_SELECTED:\n side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));\n if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)\n {\n targetBattler = gSideTimers[side].followmeTarget;\n }\n else\n {\n side = GetBattlerSide(gBattlerAttacker);\n do\n {\n targetBattler = Random() % gBattlersCount;\n } while (targetBattler == gBattlerAttacker || side == GetBattlerSide(targetBattler) || gAbsentBattlerFlags & gBitTable[targetBattler]);\n if (gBattleMoves[move].type == TYPE_ELECTRIC\n && AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIDE, gBattlerAttacker, ABILITY_LIGHTNING_ROD, 0, 0)\n && gBattleMons[targetBattler].ability != ABILITY_LIGHTNING_ROD)\n {\n targetBattler ^= BIT_FLANK;\n RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);\n gSpecialStatuses[targetBattler].lightningRodRedirected = 1;\n }\n }\n break;\n case MOVE_TARGET_DEPENDS:\n case MOVE_TARGET_BOTH:\n case MOVE_TARGET_FOES_AND_ALLY:\n case MOVE_TARGET_OPPONENTS_FIELD:\n targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));\n if (gAbsentBattlerFlags & gBitTable[targetBattler])\n targetBattler ^= BIT_FLANK;\n break;\n case MOVE_TARGET_RANDOM:\n side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));\n if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)\n {\n targetBattler = gSideTimers[side].followmeTarget;\n }\n else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && moveTarget & MOVE_TARGET_RANDOM)\n {\n if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)\n {\n if (Random() & 1)\n targetBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);\n else\n targetBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);\n }\n else\n {\n if (Random() & 1)\n targetBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);\n else\n targetBattler = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);\n }\n if (gAbsentBattlerFlags & gBitTable[targetBattler])\n targetBattler ^= BIT_FLANK;\n }\n else\n {\n targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));\n }\n break;\n case MOVE_TARGET_USER_OR_SELECTED:\n case MOVE_TARGET_USER:\n targetBattler = gBattlerAttacker;\n break;\n }\n\n *(gBattleStruct->moveTarget + gBattlerAttacker) = targetBattler;\n\n return targetBattler;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_util.c#L3828-L3911","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GetMoveTarget' — lift: cannot lift 'GetMoveTarget': 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\tGetMoveTarget */\n/* \t.type\t GetMoveTarget,function */\n/* \t.thumb_func */\n/* GetMoveTarget: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r8 */\n/* \tpush\t{r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr7, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr0, r1, #0x18 */\n/* \tmov\tr5, #0x0 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tsub\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tb\t.L4 */\n/* .L3: */\n/* \tldr\tr1, .L38 */\n/* \tlsl\tr0, r7, #0x1 */\n/* \tadd\tr0, r0, r7 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr6, [r0, #0x6] */\n/* .L4: */\n/* \tcmp\tr6, #0x40 */\n/* \tbls\t.LCB32 */\n/* \tb\t.L5\t@long jump */\n/* .LCB32: */\n/* \tlsl\tr0, r6, #0x2 */\n/* \tldr\tr1, .L38+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\tgBattleMoves */\n/* \t.word\t.L34 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\t.L6 */\n/* \t.word\t.L18 */\n/* \t.word\t.L33 */\n/* \t.word\t.L5 */\n/* \t.word\t.L20 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L33 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L5 */\n/* \t.word\t.L18 */\n/* .L6: */\n/* \tldr\tr0, .L40 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tmov\tr1, #0x1 */\n/* \teor\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr1, .L40+0x4 */\n/* \tlsl\tr0, r4, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr2, r0, r1 */\n/* \tldrb\tr0, [r2, #0x8] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L7\t@cond_branch */\n/* \tldr\tr1, .L40+0x8 */\n/* \tldrb\tr4, [r2, #0x9] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0, #0x28] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.LCB80 */\n/* \tb\t.L36\t@long jump */\n/* .LCB80: */\n/* .L7: */\n/* \tldr\tr0, .L40 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tlsl\tr0, r7, #0x1 */\n/* \tmov\tr8, r0 */\n/* .L9: */\n/* \tbl\tRandom */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tldr\tr1, .L40+0xc */\n/* \tldrb\tr1, [r1] */\n/* \tbl\t__modsi3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr6, .L40 */\n/* \tldrb\tr3, [r6] */\n/* \tcmp\tr5, r3 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr4, r0 */\n/* \tbeq\t.L9\t@cond_branch */\n/* \tldr\tr0, .L40+0x10 */\n/* \tldrb\tr2, [r0] */\n/* \tldr\tr1, .L40+0x14 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tand\tr2, r2, r0 */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L9\t@cond_branch */\n/* \tldr\tr0, .L40+0x18 */\n/* \tmov\tr3, r8 */\n/* \tadd\tr1, r3, r7 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr1, r1, r0 */\n/* \tldrb\tr0, [r1, #0x2] */\n/* \tcmp\tr0, #0xd */\n/* \tbeq\t.LCB143 */\n/* \tb\t.L5\t@long jump */\n/* .LCB143: */\n/* \tldrb\tr1, [r6] */\n/* \tstr\tr2, [sp] */\n/* \tmov\tr0, #0x10 */\n/* \tmov\tr2, #0x1f */\n/* \tmov\tr3, #0x0 */\n/* \tbl\tAbilityBattleEffects */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB157 */\n/* \tb\t.L5\t@long jump */\n/* .LCB157: */\n/* \tldr\tr2, .L40+0x8 */\n/* \tmov\tr1, #0x58 */\n/* \tmov\tr0, r5 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr0, r0, r2 */\n/* \tadd\tr0, r0, #0x20 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0x1f */\n/* \tbne\t.LCB167 */\n/* \tb\t.L5\t@long jump */\n/* .LCB167: */\n/* \tmov\tr4, #0x2 */\n/* \teor\tr5, r5, r4 */\n/* \tmov\tr0, r5 */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr0, r0, r2 */\n/* \tadd\tr0, r0, #0x20 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r5, #0 */\n/* \tbl\tRecordAbilityBattle */\n/* \tldr\tr1, .L40+0x1c */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \torr\tr1, r1, r4 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L5 */\n/* .L41: */\n/* \t.align\t2, 0 */\n/* .L40: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgSideTimers */\n/* \t.word\tgBattleMons */\n/* \t.word\tgBattlersCount */\n/* \t.word\tgAbsentBattlerFlags */\n/* \t.word\tgBitTable */\n/* \t.word\tgBattleMoves */\n/* \t.word\tgSpecialStatuses */\n/* .L18: */\n/* \tldr\tr0, .L42 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerPosition */\n/* \tadd\tr1, r0, #0 */\n/* \tmov\tr2, #0x1 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \teor\tr0, r0, r2 */\n/* \tb\t.L37 */\n/* .L43: */\n/* \t.align\t2, 0 */\n/* .L42: */\n/* \t.word\tgBattlerAttacker */\n/* .L20: */\n/* \tldr\tr0, .L44 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tmov\tr1, #0x1 */\n/* \teor\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr1, .L44+0x4 */\n/* \tlsl\tr0, r4, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr2, r0, r1 */\n/* \tldrb\tr0, [r2, #0x8] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L21\t@cond_branch */\n/* \tldr\tr1, .L44+0x8 */\n/* \tldrb\tr4, [r2, #0x9] */\n/* \tmov\tr0, #0x58 */\n/* \tmul\tr0, r0, r4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrh\tr0, [r0, #0x28] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L21\t@cond_branch */\n/* .L36: */\n/* \tadd\tr5, r4, #0 */\n/* \tb\t.L5 */\n/* .L45: */\n/* \t.align\t2, 0 */\n/* .L44: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgSideTimers */\n/* \t.word\tgBattleMons */\n/* .L21: */\n/* \tldr\tr0, .L46 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tr4, #0x1 */\n/* \tand\tr0, r0, r4 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tmov\tr0, #0x4 */\n/* \tand\tr6, r6, r0 */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L23\t@cond_branch */\n/* \tldr\tr0, .L46+0x4 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerSide */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tbl\tRandom */\n/* \tadd\tr1, r4, #0 */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L37 */\n/* .L47: */\n/* \t.align\t2, 0 */\n/* .L46: */\n/* \t.word\tgBattleTypeFlags */\n/* \t.word\tgBattlerAttacker */\n/* .L25: */\n/* \tmov\tr0, #0x3 */\n/* \tb\t.L37 */\n/* .L24: */\n/* \tbl\tRandom */\n/* \tadd\tr1, r4, #0 */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L28\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L37 */\n/* .L28: */\n/* \tmov\tr0, #0x2 */\n/* .L37: */\n/* \tbl\tGetBattlerAtPosition */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tldr\tr0, .L48 */\n/* \tldrb\tr1, [r0] */\n/* \tldr\tr2, .L48+0x4 */\n/* \tlsl\tr0, r5, #0x2 */\n/* \tadd\tr0, r0, r2 */\n/* \tldr\tr0, [r0] */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tmov\tr0, #0x2 */\n/* \teor\tr5, r5, r0 */\n/* \tb\t.L5 */\n/* .L49: */\n/* \t.align\t2, 0 */\n/* .L48: */\n/* \t.word\tgAbsentBattlerFlags */\n/* \t.word\tgBitTable */\n/* .L23: */\n/* \tldr\tr0, .L50 */\n/* \tldrb\tr0, [r0] */\n/* \tbl\tGetBattlerPosition */\n/* \tadd\tr1, r0, #0 */\n/* \tmov\tr2, #0x1 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \teor\tr0, r0, r2 */\n/* \tbl\tGetBattlerAtPosition */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tb\t.L5 */\n/* .L51: */\n/* \t.align\t2, 0 */\n/* .L50: */\n/* \t.word\tgBattlerAttacker */\n/* .L33: */\n/* \tldr\tr0, .L52 */\n/* \tldrb\tr5, [r0] */\n/* .L5: */\n/* \tldr\tr0, .L52 */\n/* \tldrb\tr0, [r0] */\n/* \tldr\tr1, .L52+0x4 */\n/* \tldr\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tstrb\tr5, [r0, #0xc] */\n/* \tadd\tr0, r5, #0 */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3} */\n/* \tmov\tr8, r3 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L53: */\n/* \t.align\t2, 0 */\n/* .L52: */\n/* \t.word\tgBattlerAttacker */\n/* \t.word\tgBattleStruct */\n/* .Lfe1: */\n/* \t.size\t GetMoveTarget,.Lfe1-GetMoveTarget */\n/* .text */\n/* \t.align\t2, 0 */\nvoid GetMoveTarget(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'GetMoveTarget': 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":395,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'GetMoveTarget': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 AbilityBattleEffects(s32, u8, s32, s32); /* extern */\nu8 GetBattlerAtPosition(s32); /* extern */\ns32 GetBattlerPosition(u8); /* extern */\nu8 GetBattlerSide(u8); /* extern */\nu16 Random(); /* extern */\n? RecordAbilityBattle(u8, u8); /* extern */\nextern u8 gAbsentBattlerFlags;\nextern ? gBattleMons;\nextern ? gBattleMoves;\nextern s32 gBattleStruct;\nextern s32 gBattleTypeFlags;\nextern u8 gBattlerAttacker;\nextern u8 gBattlersCount;\nextern ? gBitTable;\nextern ? gSideTimers;\nextern ? gSpecialStatuses;\n\nu8 GetMoveTarget(u16 arg0, u8 arg1) {\n s32 temp_r2_2;\n s32 var_r0;\n u16 temp_r7;\n u8 *temp_r0_2;\n u8 temp_r0;\n u8 temp_r4;\n u8 var_r4;\n u8 var_r5;\n u8 var_r6;\n void *temp_r2;\n void *temp_r2_3;\n\n temp_r7 = arg0;\n temp_r0 = arg1;\n var_r5 = 0;\n if (temp_r0 != 0) {\n var_r6 = temp_r0 - 1;\n } else {\n var_r6 = ((temp_r7 * 0xC) + &gBattleMoves)->unk6;\n }\n switch ((u32) var_r6) { /* irregular */\n case 0x0:\n temp_r2 = ((u8) (GetBattlerSide(gBattlerAttacker) ^ 1) * 0xC) + &gSideTimers;\n if ((temp_r2->unk8 != 0) && (var_r4 = temp_r2->unk9, (((0x58 * var_r4) + &gBattleMons)->unk28 != 0))) {\nblock_23:\n var_r5 = var_r4;\n } else {\n temp_r4 = GetBattlerSide(gBattlerAttacker);\n do {\nloop_10:\n var_r5 = (u8) ((s32) Random() % (s32) gBattlersCount);\n if (var_r5 == gBattlerAttacker) {\n goto loop_10;\n }\n if (temp_r4 == GetBattlerSide(var_r5)) {\n goto loop_10;\n }\n temp_r2_2 = gAbsentBattlerFlags & *((var_r5 * 4) + &gBitTable);\n } while (temp_r2_2 != 0);\n if (((temp_r7 * 0xC) + &gBattleMoves)->unk2 != 0xD) {\n\n } else {\n unksp0 = temp_r2_2;\n if ((AbilityBattleEffects(0x10, gBattlerAttacker, 0x1F, 0) << 0x18) == 0) {\n\n } else if (((var_r5 * 0x58) + &gBattleMons)->unk20 == 0x1F) {\n\n } else {\n var_r5 ^= 2;\n RecordAbilityBattle(var_r5, ((var_r5 * 0x58) + &gBattleMons)->unk20);\n temp_r0_2 = (var_r5 * 0x14) + &gSpecialStatuses;\n *temp_r0_2 |= 2;\n }\n }\n }\n break;\n case 0x1:\n case 0x8:\n case 0x20:\n case 0x40:\n var_r0 = (1 & GetBattlerPosition(gBattlerAttacker)) ^ 1;\nblock_33:\n var_r5 = GetBattlerAtPosition(var_r0);\n if (gAbsentBattlerFlags & *((var_r5 * 4) + &gBitTable)) {\n var_r5 ^= 2;\n }\n break;\n case 0x4:\n temp_r2_3 = ((u8) (GetBattlerSide(gBattlerAttacker) ^ 1) * 0xC) + &gSideTimers;\n if (temp_r2_3->unk8 != 0) {\n var_r4 = temp_r2_3->unk9;\n if (((0x58 * var_r4) + &gBattleMons)->unk28 != 0) {\n goto block_23;\n }\n }\n if ((gBattleTypeFlags & 1) && (var_r6 & 4)) {\n if ((GetBattlerSide(gBattlerAttacker) << 0x18) == 0) {\n if (1 & Random()) {\n var_r0 = 1;\n } else {\n var_r0 = 3;\n }\n } else if (1 & Random()) {\n var_r0 = 0;\n } else {\n var_r0 = 2;\n }\n goto block_33;\n }\n var_r5 = GetBattlerAtPosition((1 & GetBattlerPosition(gBattlerAttacker)) ^ 1);\n break;\n case 0x2:\n case 0x10:\n var_r5 = gBattlerAttacker;\n break;\n }\n (gBattlerAttacker + gBattleStruct)->unkC = var_r5;\n return var_r5;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":112,"gotos":4,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetMoveTarget` — benchmark function pokeemerald:GetMoveTarget:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetMoveTarget # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetMoveTarget` — benchmark function pokeemerald:GetMoveTarget:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:GetMoveTarget:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetMoveTarget\n\t.type\t GetMoveTarget,function\n\t.thumb_func\nGetMoveTarget:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr7, r0, #0x10\n\tlsl\tr1, r1, #0x18\n\tlsr\tr0, r1, #0x18\n\tmov\tr5, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tb\t.L4\n.L3:\n\tldr\tr1, .L38\n\tlsl\tr0, r7, #0x1\n\tadd\tr0, r0, r7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr6, [r0, #0x6]\n.L4:\n\tcmp\tr6, #0x40\n\tbls\t.LCB32\n\tb\t.L5\t@long jump\n.LCB32:\n\tlsl\tr0, r6, #0x2\n\tldr\tr1, .L38+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgBattleMoves\n\t.word\t.L34\n\t.align\t2, 0\n\t.align\t2, 0\n.L34:\n\t.word\t.L6\n\t.word\t.L18\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L20\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L33\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L5\n\t.word\t.L18\n.L6:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L40+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L40+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.LCB80\n\tb\t.L36\t@long jump\n.LCB80:\n.L7:\n\tldr\tr0, .L40\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr0, r7, #0x1\n\tmov\tr8, r0\n.L9:\n\tbl\tRandom\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tldr\tr1, .L40+0xc\n\tldrb\tr1, [r1]\n\tbl\t__modsi3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr6, .L40\n\tldrb\tr3, [r6]\n\tcmp\tr5, r3\n\tbeq\t.L9\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr4, r0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x10\n\tldrb\tr2, [r0]\n\tldr\tr1, .L40+0x14\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tand\tr2, r2, r0\n\tcmp\tr2, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L40+0x18\n\tmov\tr3, r8\n\tadd\tr1, r3, r7\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tcmp\tr0, #0xd\n\tbeq\t.LCB143\n\tb\t.L5\t@long jump\n.LCB143:\n\tldrb\tr1, [r6]\n\tstr\tr2, [sp]\n\tmov\tr0, #0x10\n\tmov\tr2, #0x1f\n\tmov\tr3, #0x0\n\tbl\tAbilityBattleEffects\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.LCB157\n\tb\t.L5\t@long jump\n.LCB157:\n\tldr\tr2, .L40+0x8\n\tmov\tr1, #0x58\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0x1f\n\tbne\t.LCB167\n\tb\t.L5\t@long jump\n.LCB167:\n\tmov\tr4, #0x2\n\teor\tr5, r5, r4\n\tmov\tr0, r5\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tadd\tr0, r0, #0x20\n\tldrb\tr1, [r0]\n\tadd\tr0, r5, #0\n\tbl\tRecordAbilityBattle\n\tldr\tr1, .L40+0x1c\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r5\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\torr\tr1, r1, r4\n\tstrb\tr1, [r0]\n\tb\t.L5\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n\t.word\tgBattlersCount\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n\t.word\tgBattleMoves\n\t.word\tgSpecialStatuses\n.L18:\n\tldr\tr0, .L42\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tb\t.L37\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\tgBattlerAttacker\n.L20:\n\tldr\tr0, .L44\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tmov\tr1, #0x1\n\teor\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr1, .L44+0x4\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr2, r0, r1\n\tldrb\tr0, [r2, #0x8]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr1, .L44+0x8\n\tldrb\tr4, [r2, #0x9]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r4\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x28]\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n.L36:\n\tadd\tr5, r4, #0\n\tb\t.L5\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\tgBattlerAttacker\n\t.word\tgSideTimers\n\t.word\tgBattleMons\n.L21:\n\tldr\tr0, .L46\n\tldr\tr0, [r0]\n\tmov\tr4, #0x1\n\tand\tr0, r0, r4\n\tcmp\tr0, #0\n\tbeq\t.L23\t@cond_branch\n\tmov\tr0, #0x4\n\tand\tr6, r6, r0\n\tcmp\tr6, #0\n\tbeq\t.L23\t@cond_branch\n\tldr\tr0, .L46+0x4\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerSide\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbne\t.L24\t@cond_branch\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L37\n.L47:\n\t.align\t2, 0\n.L46:\n\t.word\tgBattleTypeFlags\n\t.word\tgBattlerAttacker\n.L25:\n\tmov\tr0, #0x3\n\tb\t.L37\n.L24:\n\tbl\tRandom\n\tadd\tr1, r4, #0\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L28\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L37\n.L28:\n\tmov\tr0, #0x2\n.L37:\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tldr\tr0, .L48\n\tldrb\tr1, [r0]\n\tldr\tr2, .L48+0x4\n\tlsl\tr0, r5, #0x2\n\tadd\tr0, r0, r2\n\tldr\tr0, [r0]\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x2\n\teor\tr5, r5, r0\n\tb\t.L5\n.L49:\n\t.align\t2, 0\n.L48:\n\t.word\tgAbsentBattlerFlags\n\t.word\tgBitTable\n.L23:\n\tldr\tr0, .L50\n\tldrb\tr0, [r0]\n\tbl\tGetBattlerPosition\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbl\tGetBattlerAtPosition\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tb\t.L5\n.L51:\n\t.align\t2, 0\n.L50:\n\t.word\tgBattlerAttacker\n.L33:\n\tldr\tr0, .L52\n\tldrb\tr5, [r0]\n.L5:\n\tldr\tr0, .L52\n\tldrb\tr0, [r0]\n\tldr\tr1, .L52+0x4\n\tldr\tr1, [r1]\n\tadd\tr0, r0, r1\n\tstrb\tr5, [r0, #0xc]\n\tadd\tr0, r5, #0\n\tadd\tsp, sp, #0x4\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L53:\n\t.align\t2, 0\n.L52:\n\t.word\tgBattlerAttacker\n\t.word\tgBattleStruct\n.Lfe1:\n\t.size\t GetMoveTarget,.Lfe1-GetMoveTarget\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetMoveTarget # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","memory","global","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","int64","call"],"loc":9,"refSource":"s32 MathUtil_Mul32(s32 x, s32 y)\n{\n s64 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | (u32)v0 >> 8;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adc'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 MathUtil_Mul32(s32 arg0, s32 arg1) {\n s32 temp_r1;\n s32 var_r7;\n u32 temp_r0;\n u32 temp_ret;\n u32 var_r6;\n\n temp_ret = __muldi3(arg0, arg0 >> 0x1F, arg1, arg1 >> 0x1F);\n temp_r0 = temp_ret;\n temp_r1 = SECOND_REG(temp_ret);\n var_r7 = temp_r1;\n var_r6 = temp_r0;\n if (temp_r1 < 0) {\n var_r6 = temp_r0 + 0xFF;\n var_r7 = temp_r1 + M2C_CARRY(var_r6);\n }\n return (var_r7 << 0x18) | (var_r6 >> 8);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","arithmetic","global","switch","soft-div","call","comparison-tree"],"loc":25,"refSource":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)\n{\n u16 retVal;\n\n // Don't modify HP, Accuracy, or Evasion by nature\n if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS)\n return stat;\n\n switch (gNatureStatTable[nature][statIndex - 1])\n {\n case 1:\n retVal = stat * 110;\n retVal /= 100;\n break;\n case -1:\n retVal = stat * 90;\n retVal /= 100;\n break;\n default:\n retVal = stat;\n break;\n }\n\n return retVal;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gNatureStatTable","shape":"s8[]"}],"outcome":"nonmatch","source":"s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[0][(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n","score":40,"maxScore":56,"compileErrors":null,"breakdown":{"insert":10,"delete":8,"replace":8,"opMismatch":2,"argMismatch":12},"quality":{"score":84,"lines":19,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex) {\n s32 var_r0;\n s8 temp_r1;\n u16 temp_r3;\n\n temp_r3 = stat;\n if ((u32) ((u32) ((statIndex << 0x18) + 0xFF000000) >> 0x18) > 4U) {\n return temp_r3;\n }\n temp_r1 = (s8) (u8) (*gNatureStatTable)[statIndex + ((nature * 5) - 1)];\n switch (temp_r1) { /* irregular */\n case 1:\n var_r0 = 0x6E;\nblock_6:\n return (u16) ((u16) (var_r0 * temp_r3) / 100U);\n case -1:\n var_r0 = 0x5A;\n goto block_6;\n default:\n return temp_r3;\n }\n}\n","score":31,"maxScore":55,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7},"quality":{"score":76,"lines":21,"gotos":1,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":55,"ratio":0.5636363636363636,"kinds":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","sizeof","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"loc":6,"refSource":"u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngValue","shape":"scalar u32"},{"name":"sRandCount","shape":"scalar u32"}],"outcome":"match","source":"s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return (u32)(1103515245 * v0 + 24691) >> 16;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 gRngValue;\nextern s32 sRandCount;\n\nu32 Random(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * gRngValue) + 0x6073;\n gRngValue = temp_r0;\n sRandCount += 1;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetMauvilleOldManLanguage:agbcc","sym":"SetMauvilleOldManLanguage","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","struct","memory","switch","loop","call","jump-table"],"loc":64,"refSource":"static void UNUSED SetMauvilleOldManLanguage(union OldMan *oldMan, u32 language1, u32 language2, u32 language3)\n{\n s32 i;\n\n switch (oldMan->common.id)\n {\n case MAUVILLE_MAN_TRADER:\n {\n struct MauvilleOldManTrader *trader = &oldMan->trader;\n\n for (i = 0; i < NUM_TRADER_ITEMS; i++)\n {\n if (IsStringJapanese(trader->playerNames[i]))\n trader->language[i] = language1;\n else\n trader->language[i] = language2;\n }\n }\n break;\n case MAUVILLE_MAN_STORYTELLER:\n {\n struct MauvilleManStoryteller *storyteller = &oldMan->storyteller;\n\n for (i = 0; i < NUM_STORYTELLER_TALES; i++)\n {\n if (IsStringJapanese(storyteller->trainerNames[i]))\n storyteller->language[i] = language1;\n else\n storyteller->language[i] = language2;\n }\n }\n break;\n case MAUVILLE_MAN_BARD:\n {\n struct MauvilleManBard *bard = &oldMan->bard;\n\n if (language3 == LANGUAGE_JAPANESE)\n bard->language = language1;\n else\n bard->language = language2;\n }\n break;\n case MAUVILLE_MAN_HIPSTER:\n {\n struct MauvilleManHipster *hipster = &oldMan->hipster;\n\n if (language3 == LANGUAGE_JAPANESE)\n hipster->language = language1;\n else\n hipster->language = language2;\n }\n break;\n case MAUVILLE_MAN_GIDDY:\n {\n struct MauvilleManGiddy *giddy = &oldMan->giddy;\n\n if (language3 == LANGUAGE_JAPANESE)\n giddy->language = language1;\n else\n giddy->language = language2;\n }\n break;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/mauville_old_man.c#L793-L856","targetAsm":"@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\n\n.text\n\t.align\t2, 0\n","proto":{"SetMauvilleOldManLanguage":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void SetMauvilleOldManLanguage(u8 * a0, u32 a1, u32 a2, u32 a3, u32 a4) {\n s32 v0;\n u8 * v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n u8 * v5;\n u8 * v6;\n switch (*a0) {\n case 0:\n if (a3 == 1) {\n v5 = a0 + 42;\n *v5 = a1;\n return;\n } else {\n v6 = a0 + 42;\n *v6 = a2;\n return;\n }\n case 1:\n if (a3 == 1) {\n a0[2] = a1;\n return;\n } else {\n a0[2] = a2;\n return;\n }\n case 2:\n v0 = 0;\n v1 = a0 + 50;\n do {\n if (IsStringJapanese(a0 + (11 * v0 + 5)) == 0) {\n *v1 = a2;\n } else {\n *v1 = a1;\n }\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v0 <= 3);\n return;\n case 3:\n v3 = a0 + 52;\n v2 = a0 + 8;\n v4 = 3;\n do {\n if (IsStringJapanese(v2) == 0) {\n *v3 = a2;\n } else {\n *v3 = a1;\n }\n v3 = v3 + 1;\n v2 = v2 + 7;\n v4 = v4 - 1;\n } while (v4 >= 0);\n return;\n case 4:\n if (a3 == 1) {\n v5 = a0 + 32;\n *v5 = a1;\n return;\n } else {\n v6 = a0 + 32;\n *v6 = a2;\n return;\n }\n default:\n return;\n }\n}\n","score":59,"maxScore":105,"compileErrors":null,"breakdown":{"insert":16,"delete":18,"replace":0,"opMismatch":2,"argMismatch":23},"quality":{"score":96,"lines":69,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 IsStringJapanese(void *); /* extern */\n\nvoid SetMauvilleOldManLanguage(void *arg0, s8 arg1, s8 arg2, s32 arg3) {\n s32 var_r5;\n s32 var_r5_2;\n s8 *var_r0;\n s8 *var_r0_2;\n s8 *var_r4;\n s8 *var_r4_2;\n u8 temp_r0;\n void *var_r6;\n\n temp_r0 = arg0->unk0;\n switch (temp_r0) {\n case 2:\n var_r5 = 0;\n var_r4 = arg0 + 0x32;\n do {\n if (IsStringJapanese(arg0 + ((0xB * var_r5) + 5)) != 0) {\n *var_r4 = arg1;\n } else {\n *var_r4 = arg2;\n }\n var_r4 += 1;\n var_r5 += 1;\n } while (var_r5 <= 3);\n return;\n case 3:\n var_r4_2 = arg0 + 0x34;\n var_r6 = arg0 + 8;\n var_r5_2 = 3;\n do {\n if (IsStringJapanese(var_r6) != 0) {\n *var_r4_2 = arg1;\n } else {\n *var_r4_2 = arg2;\n }\n var_r4_2 += 1;\n var_r6 += 7;\n var_r5_2 -= 1;\n } while (var_r5_2 >= 0);\n return;\n case 0:\n if (arg3 == 1) {\n var_r0 = arg0 + 0x2A;\nblock_22:\n *var_r0 = arg1;\n return;\n }\n var_r0_2 = arg0 + 0x2A;\nblock_24:\n *var_r0_2 = arg2;\n default:\n return;\n case 1:\n if (arg3 == 1) {\n arg0->unk2 = arg1;\n return;\n }\n arg0->unk2 = arg2;\n return;\n case 4:\n if (arg3 == 1) {\n var_r0 = arg0 + 0x20;\n goto block_22;\n }\n var_r0_2 = arg0 + 0x20;\n goto block_24;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":72,"lines":68,"gotos":2,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:8597: conflicting types for `IsStringJapanese'","/c.c:4062: previous declaration of `IsStringJapanese'","/c.c:8609: warning: dereferencing `void *' pointer","/c.c:8609: request for member `unk0' in something not a structure or union","/c.c:8653: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":59,"maxScore":105,"ratio":0.5619047619047619,"kinds":{"insert":16,"delete":18,"replace":0,"opMismatch":2,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetMauvilleOldManLanguage` — benchmark function pokeemerald:SetMauvilleOldManLanguage:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetMauvilleOldManLanguage # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetMauvilleOldManLanguage` — benchmark function pokeemerald:SetMauvilleOldManLanguage:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:SetMauvilleOldManLanguage:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by 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 SetMauvilleOldManLanguage,function\n\t.thumb_func\nSetMauvilleOldManLanguage:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr5, r0, #0\n\tmov\tr8, r1\n\tadd\tr7, r2, #0\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x4\n\tbhi\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L33\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L34:\n\t.align\t2, 0\n.L33:\n\t.word\t.L29\n\t.align\t2, 0\n\t.align\t2, 0\n.L29:\n\t.word\t.L20\n\t.word\t.L23\n\t.word\t.L4\n\t.word\t.L12\n\t.word\t.L26\n.L4:\n\tadd\tr6, r5, #0\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x32\n.L8:\n\tmov\tr0, #0xb\n\tmul\tr0, r0, r5\n\tadd\tr0, r0, #0x5\n\tadd\tr0, r6, r0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r4]\n\tb\t.L7\n.L9:\n\tstrb\tr7, [r4]\n.L7:\n\tadd\tr4, r4, #0x1\n\tadd\tr5, r5, #0x1\n\tcmp\tr5, #0x3\n\tble\t.L8\t@cond_branch\n\tb\t.L3\n.L12:\n\tadd\tr4, r5, #0\n\tadd\tr4, r4, #0x34\n\tadd\tr6, r5, #0\n\tadd\tr6, r6, #0x8\n\tmov\tr5, #0x3\n.L16:\n\tadd\tr0, r6, #0\n\tbl\tIsStringJapanese\n\tcmp\tr0, #0\n\tbeq\t.L17\t@cond_branch\n\tmov\tr1, r8\n\tstrb\tr1, [r4]\n\tb\t.L15\n.L17:\n\tstrb\tr7, [r4]\n.L15:\n\tadd\tr4, r4, #0x1\n\tadd\tr6, r6, #0x7\n\tsub\tr5, r5, #0x1\n\tcmp\tr5, #0\n\tbge\t.L16\t@cond_branch\n\tb\t.L3\n.L20:\n\tcmp\tr3, #0x1\n\tbne\t.L21\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L31\n.L21:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x2a\n\tb\t.L32\n.L23:\n\tcmp\tr3, #0x1\n\tbne\t.L24\t@cond_branch\n\tmov\tr0, r8\n\tstrb\tr0, [r5, #0x2]\n\tb\t.L3\n.L24:\n\tstrb\tr7, [r5, #0x2]\n\tb\t.L3\n.L26:\n\tcmp\tr3, #0x1\n\tbne\t.L27\t@cond_branch\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L31:\n\tmov\tr1, r8\n\tstrb\tr1, [r0]\n\tb\t.L3\n.L27:\n\tadd\tr0, r5, #0\n\tadd\tr0, r0, #0x20\n.L32:\n\tstrb\tr7, [r0]\n.L3:\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t SetMauvilleOldManLanguage,.Lfe1-SetMauvilleOldManLanguage\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 \"SetMauvilleOldManLanguage\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetMauvilleOldManLanguage # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","table","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","branch","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","pointer","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","array","loop","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","array","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["branch","array","struct","table","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":"pokeemerald:TrySetCantSelectMoveBattleScript:agbcc","sym":"TrySetCantSelectMoveBattleScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","branch","global","struct","bitfield","bitwise","call"],"loc":105,"refSource":"u8 TrySetCantSelectMoveBattleScript(void)\n{\n u8 limitations = 0;\n u16 move = gBattleMons[gActiveBattler].moves[gBattleBufferB[gActiveBattler][2]];\n u8 holdEffect;\n u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler];\n\n if (gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)\n {\n gBattleScripting.battler = gActiveBattler;\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMove;\n limitations = 1;\n }\n }\n\n if (move == gLastMoves[gActiveBattler] && move != MOVE_STRUGGLE && (gBattleMons[gActiveBattler].status2 & STATUS2_TORMENT))\n {\n CancelMultiTurnMoves(gActiveBattler);\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMove;\n limitations++;\n }\n }\n\n if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0)\n {\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTaunt;\n limitations++;\n }\n }\n\n if (GetImprisonedMovesCount(gActiveBattler, move))\n {\n gCurrentMove = move;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace;\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMove;\n limitations++;\n }\n }\n\n if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)\n holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;\n else\n holdEffect = GetItemHoldEffect(gBattleMons[gActiveBattler].item);\n\n gPotentialItemEffectBattler = gActiveBattler;\n\n if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)\n {\n gCurrentMove = *choicedMove;\n gLastUsedItem = gBattleMons[gActiveBattler].item;\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveChoiceItem;\n limitations++;\n }\n }\n\n if (gBattleMons[gActiveBattler].pp[gBattleBufferB[gActiveBattler][2]] == 0)\n {\n if (gBattleTypeFlags & BATTLE_TYPE_PALACE)\n {\n gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE;\n }\n else\n {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingMoveWithNoPP;\n limitations++;\n }\n }\n\n return limitations;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/battle_util.c#L976-L1080","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-78a6659be413.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gActiveBattler","shape":"scalar u8"},{"name":"gBattleBufferB","shape":"u8[]"},{"name":"gBattleMons","shape":"array (88 B/elem)"},{"name":"gBattleMoves","shape":"array (12 B/elem)"},{"name":"gBattleScripting","shape":"struct BattleScripting (40 B)"},{"name":"gBattleStruct","shape":"pointer"},{"name":"gBattleTypeFlags","shape":"scalar u32"},{"name":"gCurrentMove","shape":"scalar u16"},{"name":"gDisableStructs","shape":"array (28 B/elem)"},{"name":"gEnigmaBerries","shape":"array (28 B/elem)"},{"name":"gLastMoves","shape":"u16[]"},{"name":"gLastUsedItem","shape":"scalar u16"},{"name":"gPalaceSelectionBattleScripts","shape":"u32[]"},{"name":"gPotentialItemEffectBattler","shape":"scalar u8"},{"name":"gProtectStructs","shape":"array (16 B/elem)"},{"name":"gSelectionBattleScripts","shape":"u32[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 field_0; u8 _pad0[511]; };\nstruct Elem1 { u8 _pad0[4]; u16 field_4; u8 _pad1[13]; u8 field_19; u8 _pad2[8]; };\nstruct Elem2 { u8 _pad0[2]; u8 field_2; u8 _pad1[13]; };\nstruct Elem3 { s32 field_0; u8 _pad0[84]; };\nstruct Elem4 { u8 _pad0[1]; u8 field_1; u8 _pad1[10]; };\nstruct Elem5 { u8 _pad0[46]; u16 field_46; u8 _pad1[40]; };\nstruct Elem6 { u8 _pad0[7]; u8 field_7; u8 _pad1[20]; };\nstruct Elem7 { u8 field_0; u8 _pad0[511]; };\ns32 TrySetCantSelectMoveBattleScript(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n v0 = gActiveBattler;\n v1 = *(u16 *)((((struct Elem0 *)((u32)&gBattleBufferB + 2))[v0].field_0 << 1) + 88 * v0 + ((u32)&gBattleMons + 12));\n v2 = gBattleStruct;\n if (((struct Elem1 *)&gDisableStructs)[v0].field_4 != v1 || v1 == 0) {\n v4 = 0;\n } else {\n gBattleScripting.battler = v0;\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingDisabledMove;\n v4 = 1;\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingDisabledMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n v4 = 0;\n }\n }\n if (v1 == gLastMoves[gActiveBattler] && v1 != 165 && ((struct Elem3 *)((u32)&gBattleMons + 80))[gActiveBattler].field_0 < 0) {\n CancelMultiTurnMoves(gActiveBattler);\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingTormentedMove;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingTormentedMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n if (((struct Elem1 *)&gDisableStructs)[gActiveBattler].field_19 << 28 != 0 && ((struct Elem4 *)&gBattleMoves)[v1].field_1 == 0) {\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveTaunt;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveTauntInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n if (GetImprisonedMovesCount(gActiveBattler, v1) << 24 != 0) {\n gCurrentMove = v1;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingImprisonedMove;\n v4 = (u8)(v4 + 1);\n } else {\n gPalaceSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingImprisonedMoveInPalace;\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n v3 = gActiveBattler;\n if (((struct Elem5 *)&gBattleMons)[v3].field_46 != 175) {\n v5 = (u8)GetItemHoldEffect(((struct Elem5 *)&gBattleMons)[v3].field_46);\n } else {\n v5 = ((struct Elem6 *)&gEnigmaBerries)[v3].field_7;\n }\n gPotentialItemEffectBattler = gActiveBattler;\n if (v5 == 29) {\n if (*(u16 *)(v2 + ((v0 << 1) + 200)) != 0 && (*(u16 *)(v2 + ((v0 << 1) + 200)) != 65535 && *(u16 *)(v2 + ((v0 << 1) + 200)) != v1)) {\n gCurrentMove = *(u16 *)(v2 + ((v0 << 1) + 200));\n gLastUsedItem = ((struct Elem5 *)&gBattleMons)[gActiveBattler].field_46;\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingNotAllowedMoveChoiceItem;\n v4 = (u8)(v4 + 1);\n } else {\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n }\n if (*(u8 *)(88 * gActiveBattler + ((struct Elem7 *)((u32)&gBattleBufferB + 2))[gActiveBattler].field_0 + ((u32)&gBattleMons + 36)) == 0) {\n if ((gBattleTypeFlags & 128 << 10) == 0) {\n gSelectionBattleScripts[gActiveBattler] = &BattleScript_SelectingMoveWithNoPP;\n v4 = (u8)(v4 + 1);\n } else {\n ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 = ((struct Elem2 *)&gProtectStructs)[gActiveBattler].field_2 | 16;\n }\n }\n return v4;\n}\n","score":303,"maxScore":435,"compileErrors":null,"breakdown":{"insert":46,"delete":53,"replace":37,"opMismatch":10,"argMismatch":157},"quality":{"score":68,"lines":91,"gotos":0,"casts":12,"unkGlue":0,"rawMem":6,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 TrySetCantSelectMoveBattleScript(void) {\n struct ProtectStruct *temp_r1;\n struct ProtectStruct *temp_r1_2;\n struct ProtectStruct *temp_r1_3;\n struct ProtectStruct *temp_r1_4;\n struct ProtectStruct *temp_r1_7;\n struct ProtectStruct *temp_r1_8;\n u16 *temp_r8;\n u16 temp_r1_6;\n u16 temp_r5;\n u8 var_r4;\n u8 var_r6;\n void *temp_r1_5;\n\n var_r6 = 0;\n temp_r5 = *((*((gActiveBattler << 9) + &gBattleBufferB[0][2]) * 2) + (0x58 * gActiveBattler) + gBattleMons->moves);\n temp_r8 = &gBattleStruct->choicedMove[gActiveBattler];\n if ((gDisableStructs[gActiveBattler].disabledMove == temp_r5) && (temp_r5 != 0)) {\n gBattleScripting.battler = gActiveBattler;\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace;\n temp_r1 = &gProtectStructs[gActiveBattler];\n temp_r1->unk2 = (u8) (temp_r1->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMove;\n var_r6 = 1;\n }\n }\n if ((temp_r5 == gLastMoves[gActiveBattler]) && (temp_r5 != 0xA5) && ((s32) *((0x58 * gActiveBattler) + &gBattleMons->status2) < 0)) {\n CancelMultiTurnMoves(gActiveBattler);\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace;\n temp_r1_2 = &gProtectStructs[gActiveBattler];\n temp_r1_2->unk2 = (u8) (temp_r1_2->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMove;\n var_r6 += 1;\n }\n }\n if (((gDisableStructs[gActiveBattler].unk13 << 0x1C) != 0) && (gBattleMoves[temp_r5].power == 0)) {\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace;\n temp_r1_3 = &gProtectStructs[gActiveBattler];\n temp_r1_3->unk2 = (u8) (temp_r1_3->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTaunt;\n var_r6 += 1;\n }\n }\n if ((GetImprisonedMovesCount(gActiveBattler, temp_r5) << 0x18) != 0) {\n gCurrentMove = temp_r5;\n if (gBattleTypeFlags & 0x20000) {\n gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace;\n temp_r1_4 = &gProtectStructs[gActiveBattler];\n temp_r1_4->unk2 = (u8) (temp_r1_4->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMove;\n var_r6 += 1;\n }\n }\n temp_r1_5 = (0x58 * gActiveBattler) + gBattleMons;\n if (temp_r1_5->unk2E == 0xAF) {\n var_r4 = gEnigmaBerries[gActiveBattler].holdEffect;\n } else {\n var_r4 = GetItemHoldEffect(temp_r1_5->unk2E);\n }\n gPotentialItemEffectBattler = gActiveBattler;\n if (var_r4 == 0x1D) {\n temp_r1_6 = *temp_r8;\n if ((temp_r1_6 != 0) && (temp_r1_6 != 0xFFFF) && (temp_r1_6 != temp_r5)) {\n gCurrentMove = temp_r1_6;\n gLastUsedItem = ((0x58 * gActiveBattler) + gBattleMons)->unk2E;\n if (gBattleTypeFlags & 0x20000) {\n temp_r1_7 = &gProtectStructs[gActiveBattler];\n temp_r1_7->unk2 = (u8) (temp_r1_7->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveChoiceItem;\n var_r6 += 1;\n }\n }\n }\n if (gBattleMons->pp[(0x58 * gActiveBattler) + *((gActiveBattler << 9) + &gBattleBufferB[0][2])] == 0) {\n if (gBattleTypeFlags & 0x20000) {\n temp_r1_8 = &gProtectStructs[gActiveBattler];\n temp_r1_8->unk2 = (u8) (temp_r1_8->unk2 | 0x10);\n } else {\n gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingMoveWithNoPP;\n var_r6 += 1;\n }\n }\n return var_r6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":93,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:7056: structure has no member named `unk2'","/c.c:7067: structure has no member named `unk2'","/c.c:7073: structure has no member named `unk13'","/c.c:7078: structure has no member named `unk2'","/c.c:7089: structure has no member named `unk2'"]},"gapSize":{"decompiler":"asmlift","score":303,"maxScore":435,"ratio":0.696551724137931,"kinds":{"insert":46,"delete":53,"replace":37,"opMismatch":10,"argMismatch":157}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TrySetCantSelectMoveBattleScript` — benchmark function pokeemerald:TrySetCantSelectMoveBattleScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\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-78a6659be413.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 TrySetCantSelectMoveBattleScript(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TrySetCantSelectMoveBattleScript # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TrySetCantSelectMoveBattleScript` — benchmark function pokeemerald:TrySetCantSelectMoveBattleScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:TrySetCantSelectMoveBattleScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTrySetCantSelectMoveBattleScript\n\t.type\t TrySetCantSelectMoveBattleScript,function\n\t.thumb_func\nTrySetCantSelectMoveBattleScript:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tmov\tr6, #0x0\n\tldr\tr2, .L24\n\tldr\tr1, .L24+0x4\n\tldr\tr3, .L24+0x8\n\tldrb\tr4, [r3]\n\tlsl\tr0, r4, #0x9\n\tadd\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tlsl\tr0, r0, #0x1\n\tmov\tr1, #0x58\n\tmul\tr1, r1, r4\n\tadd\tr0, r0, r1\n\tadd\tr2, r2, #0xc\n\tadd\tr0, r0, r2\n\tldrh\tr5, [r0]\n\tldr\tr1, .L24+0xc\n\tlsl\tr0, r4, #0x1\n\tadd\tr0, r0, #0xc8\n\tldr\tr1, [r1]\n\tadd\tr1, r1, r0\n\tmov\tr8, r1\n\tldr\tr1, .L24+0x10\n\tlsl\tr0, r4, #0x3\n\tsub\tr0, r0, r4\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0, #0x4]\n\tadd\tr7, r3, #0\n\tadd\tr3, r1, #0\n\tcmp\tr0, r5\n\tbne\t.L3\t@cond_branch\n\tcmp\tr5, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L24+0x14\n\tstrb\tr4, [r0, #0x17]\n\tldr\tr0, .L24+0x18\n\tstrh\tr5, [r0]\n\tldr\tr0, .L24+0x1c\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L24+0x20\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L24+0x24\n\tstr\tr1, [r0]\n\tldr\tr0, .L24+0x28\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L3\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\tgBattleMons\n\t.word\tgBattleBufferB\n\t.word\tgActiveBattler\n\t.word\tgBattleStruct\n\t.word\tgDisableStructs\n\t.word\tgBattleScripting\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMoveInPalace\n\t.word\tgProtectStructs\n.L4:\n\tldr\tr0, .L26\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, .L26+0x4\n\tstr\tr0, [r1]\n\tmov\tr6, #0x1\n.L3:\n\tldr\tr1, .L26+0x8\n\tldrb\tr2, [r7]\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r1\n\tldrh\tr0, [r0]\n\tcmp\tr5, r0\n\tbne\t.L6\t@cond_branch\n\tcmp\tr5, #0xa5\n\tbeq\t.L6\t@cond_branch\n\tldr\tr1, .L26+0xc\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r1, #0x50\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tcmp\tr0, #0\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tCancelMultiTurnMoves\n\tldr\tr0, .L26+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr1, .L26+0x14\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L26+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L26+0x1c\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L23\n.L27:\n\t.align\t2, 0\n.L26:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingDisabledMove\n\t.word\tgLastMoves\n\t.word\tgBattleMons\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMoveInPalace\n\t.word\tgProtectStructs\n.L7:\n\tldr\tr1, .L28\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L23:\n\tldr\tr3, .L28+0x8\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr1, r0, #0x3\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r3\n\tldrb\tr0, [r1, #0x13]\n\tlsl\tr0, r0, #0x1c\n\tcmp\tr0, #0\n\tbeq\t.L9\t@cond_branch\n\tldr\tr0, .L28+0xc\n\tlsl\tr1, r5, #0x1\n\tadd\tr1, r1, r5\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x1]\n\tcmp\tr0, #0\n\tbne\t.L9\t@cond_branch\n\tldr\tr0, .L28+0x10\n\tstrh\tr5, [r0]\n\tldr\tr0, .L28+0x14\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n\tldr\tr1, .L28+0x18\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L28+0x1c\n\tstr\tr1, [r0]\n\tldr\tr0, .L28+0x20\n\tldrb\tr1, [r7]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L9\n.L29:\n\t.align\t2, 0\n.L28:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingTormentedMove\n\t.word\tgDisableStructs\n\t.word\tgBattleMoves\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTauntInPalace\n\t.word\tgProtectStructs\n.L10:\n\tldr\tr1, .L30\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L9:\n\tldr\tr4, .L30+0x8\n\tldrb\tr0, [r4]\n\tadd\tr1, r5, #0\n\tbl\tGetImprisonedMovesCount\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L30+0xc\n\tstrh\tr5, [r0]\n\tldr\tr0, .L30+0x10\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tldr\tr1, .L30+0x14\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L30+0x18\n\tstr\tr1, [r0]\n\tldr\tr0, .L30+0x1c\n\tldrb\tr1, [r4]\n\tlsl\tr1, r1, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L12\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveTaunt\n\t.word\tgActiveBattler\n\t.word\tgCurrentMove\n\t.word\tgBattleTypeFlags\n\t.word\tgPalaceSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMoveInPalace\n\t.word\tgProtectStructs\n.L13:\n\tldr\tr1, .L32\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L32+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L12:\n\tldr\tr1, .L32+0x8\n\tldr\tr0, .L32+0xc\n\tldrb\tr2, [r0]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r2\n\tadd\tr1, r0, r1\n\tldrh\tr0, [r1, #0x2e]\n\tcmp\tr0, #0xaf\n\tbne\t.L15\t@cond_branch\n\tldr\tr1, .L32+0x10\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr4, [r0, #0x7]\n\tb\t.L16\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingImprisonedMove\n\t.word\tgBattleMons\n\t.word\tgActiveBattler\n\t.word\tgEnigmaBerries\n.L15:\n\tldrh\tr0, [r1, #0x2e]\n\tbl\tGetItemHoldEffect\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n.L16:\n\tldr\tr2, .L34\n\tldr\tr1, .L34+0x4\n\tldrb\tr0, [r1]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L34+0x8\n\tmov\tip, r0\n\tadd\tr7, r1, #0\n\tcmp\tr4, #0x1d\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, r8\n\tldrh\tr1, [r0]\n\tadd\tr2, r1, #0\n\tcmp\tr2, #0\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0xc\n\tcmp\tr2, r0\n\tbeq\t.L17\t@cond_branch\n\tcmp\tr2, r5\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L34+0x10\n\tstrh\tr1, [r0]\n\tldr\tr2, .L34+0x14\n\tldrb\tr1, [r7]\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0, #0x2e]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L34+0x18\n\tldr\tr1, [r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0xa\n\tand\tr1, r1, r0\n\tldrb\tr2, [r7]\n\tcmp\tr1, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr0, .L34+0x1c\n\tlsl\tr1, r2, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgPotentialItemEffectBattler\n\t.word\tgActiveBattler\n\t.word\tgBattleMons\n\t.word\t0xffff\n\t.word\tgCurrentMove\n\t.word\tgLastUsedItem\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L18:\n\tldr\tr1, .L36\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L36+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L17:\n\tldr\tr0, .L36+0x8\n\tldrb\tr3, [r7]\n\tlsl\tr1, r3, #0x9\n\tadd\tr0, r0, #0x2\n\tadd\tr1, r1, r0\n\tmov\tr0, #0x58\n\tmul\tr0, r0, r3\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L20\t@cond_branch\n\tldr\tr0, .L36+0xc\n\tldr\tr0, [r0]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0xa\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L21\t@cond_branch\n\tldr\tr0, .L36+0x10\n\tlsl\tr1, r3, #0x4\n\tadd\tr1, r1, r0\n\tldrb\tr0, [r1, #0x2]\n\tmov\tr2, #0x10\n\torr\tr0, r0, r2\n\tstrb\tr0, [r1, #0x2]\n\tb\t.L20\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingNotAllowedMoveChoiceItem\n\t.word\tgBattleBufferB\n\t.word\tgBattleTypeFlags\n\t.word\tgProtectStructs\n.L21:\n\tldr\tr1, .L38\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r1\n\tldr\tr1, .L38+0x4\n\tstr\tr1, [r0]\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L20:\n\tadd\tr0, r6, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\tgSelectionBattleScripts\n\t.word\tBattleScript_SelectingMoveWithNoPP\n.Lfe1:\n\t.size\t TrySetCantSelectMoveBattleScript,.Lfe1-TrySetCantSelectMoveBattleScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TrySetCantSelectMoveBattleScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:UpdateShoalTideFlag:agbcc","sym":"UpdateShoalTideFlag","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["table","array","branch","global","call"],"loc":39,"refSource":"void UpdateShoalTideFlag(void)\n{\n static const u8 tide[] =\n {\n 1, // 00\n 1, // 01\n 1, // 02\n 0, // 03\n 0, // 04\n 0, // 05\n 0, // 06\n 0, // 07\n 0, // 08\n 1, // 09\n 1, // 10\n 1, // 11\n 1, // 12\n 1, // 13\n 1, // 14\n 0, // 15\n 0, // 16\n 0, // 17\n 0, // 18\n 0, // 19\n 0, // 20\n 1, // 21\n 1, // 22\n 1, // 23\n };\n\n if (IsMapTypeOutdoors(GetLastUsedWarpMapType()))\n {\n RtcCalcLocalTime();\n if (tide[gLocalTime.hours])\n FlagSet(FLAG_SYS_SHOAL_TIDE);\n else\n FlagClear(FLAG_SYS_SHOAL_TIDE);\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/time_events.c#L54-L92","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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-4f862b3e7af0.i.gz","proto":{"UpdateShoalTideFlag":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateShoalTideFlag' — lift: cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.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 tide.3,object */\n/* tide.3: */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x1 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tUpdateShoalTideFlag */\n/* \t.type\t UpdateShoalTideFlag,function */\n/* \t.thumb_func */\n/* UpdateShoalTideFlag: */\n/* \tpush\t{lr} */\n/* \tbl\tGetLastUsedWarpMapType */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tbl\tIsMapTypeOutdoors */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tbl\tRtcCalcLocalTime */\n/* \tldr\tr1, .L6 */\n/* \tldr\tr0, .L6+0x4 */\n/* \tldrb\tr0, [r0, #0x2] */\n/* \tlsl\tr0, r0, #24 */\n/* \tasr\tr0, r0, #24 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldr\tr0, .L6+0x8 */\n/* \tbl\tFlagSet */\n/* \tb\t.L3 */\n/* .L7: */\n/* \t.align\t2, 0 */\n/* .L6: */\n/* \t.word\ttide.3 */\n/* \t.word\tgLocalTime */\n/* \t.word\t0x89a */\n/* .L4: */\n/* \tldr\tr0, .L8 */\n/* \tbl\tFlagClear */\n/* .L3: */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\t0x89a */\n/* .Lfe1: */\n/* \t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateShoalTideFlag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.byte) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":82,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateShoalTideFlag': reads the sub-word data table 'tide.3' (.byte) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"static ? tide.3; /* unable to generate initializer: unknown type; const */\n\nvoid UpdateShoalTideFlag(void) {\n if ((IsMapTypeOutdoors(GetLastUsedWarpMapType()) << 0x18) != 0) {\n RtcCalcLocalTime();\n if (*((s8) (u8) gLocalTime.hours + &tide.3) != 0) {\n FlagSet(0x89AU);\n return;\n }\n FlagClear(0x89AU);\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":11,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateShoalTideFlag` — benchmark function pokeemerald:UpdateShoalTideFlag:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\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-4f862b3e7af0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateShoalTideFlag(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateShoalTideFlag # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateShoalTideFlag` — benchmark function pokeemerald:UpdateShoalTideFlag:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: 0664158954110d15103e2f5655c956b305075b6c0f470015d5d39506f69ce46e\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:UpdateShoalTideFlag:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\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 tide.3,object\ntide.3:\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x0\n\t.byte\t0x1\n\t.byte\t0x1\n\t.byte\t0x1\n.text\n\t.align\t2, 0\n\t.globl\tUpdateShoalTideFlag\n\t.type\t UpdateShoalTideFlag,function\n\t.thumb_func\nUpdateShoalTideFlag:\n\tpush\t{lr}\n\tbl\tGetLastUsedWarpMapType\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbl\tIsMapTypeOutdoors\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tbl\tRtcCalcLocalTime\n\tldr\tr1, .L6\n\tldr\tr0, .L6+0x4\n\tldrb\tr0, [r0, #0x2]\n\tlsl\tr0, r0, #24\n\tasr\tr0, r0, #24\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr0, .L6+0x8\n\tbl\tFlagSet\n\tb\t.L3\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\ttide.3\n\t.word\tgLocalTime\n\t.word\t0x89a\n.L4:\n\tldr\tr0, .L8\n\tbl\tFlagClear\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x89a\n.Lfe1:\n\t.size\t UpdateShoalTideFlag,.Lfe1-UpdateShoalTideFlag\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 \"UpdateShoalTideFlag\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateShoalTideFlag # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","shift","bitwise","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","sizeof","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["struct","field","pointer","branch","loop","sizeof","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","branch","global","loop","shift","bitwise","call","mmio"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","cast","struct","loop","sizeof"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["array","branch","loop","shift","bitwise"],"loc":15,"refSource":"void numToASCII(u8 digits[5], u16 number)\n{\n u8 i;\n\n for (i = 0; i < 4; number <<= 4, i++) {\n u16 value = ((number & 0xF000) >> 12);\n if (value > 9) {\n digits[i] = value + 87;\n } else {\n digits[i] = value + '0';\n }\n }\n\n digits[i] = 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\n","proto":{"numToASCII":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((u32)(v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = (u32)(v0 << 20) >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n","score":12,"maxScore":31,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10},"quality":{"score":84,"lines":22,"gotos":0,"casts":9,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void numToASCII(s32 arg0, u16 arg1) {\n s8 *var_r1;\n s8 var_r0;\n u16 var_r3;\n u32 temp_r0;\n u8 var_r2;\n\n var_r3 = arg1;\n var_r2 = 0;\n do {\n temp_r0 = (u32) (var_r3 & 0xF000) >> 0xC;\n if (temp_r0 > 9U) {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x57;\n } else {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x30;\n }\n *var_r1 = var_r0;\n var_r3 *= 0x10;\n var_r2 += 1;\n } while ((u32) var_r2 <= 3U);\n *(arg0 + var_r2) = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":23,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: warning: assignment makes pointer from integer without a cast","/c.c:322: warning: assignment makes pointer from integer without a cast","/c.c:329: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":12,"maxScore":31,"ratio":0.3870967741935484,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","union","bitfield"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:PackSaveSector:agbcc","sym":"PackSaveSector","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","memory","switch","loop","nested-loop","call","comparison-tree"],"loc":117,"refSource":"void PackSaveSector(SaveSectorData *sector, SaveGame *save)\n{\n s16 i;\n s16 j;\n s16 k;\n\n sector->header.magicNumber = 0x47544E4C;\n sector->header.sectorId += 1;\n sector->playerId = save->playerId;\n\n for (i = 0; i < 6; i++) {\n sector->playerName[i] = save->playerName[i];\n }\n\n sector->unk18 = 0;\n sector->unlockedCharacters = save->unlockedCharacters;\n sector->unlockedZones = save->unlockedZones;\n sector->continueZone = save->continueZone;\n sector->unk1C = 0;\n\n for (i = 0; i < 7; i++) {\n sector->chaoCount[i] = save->chaoCount[i];\n }\n\n for (i = 0; i < 7; i++) {\n sector->specialKeys[i] = save->specialKeys[i];\n }\n\n for (i = 0; i < 9; i++) {\n sector->unlockedStages[i] = save->unlockedStages[i];\n }\n\n for (i = 0; i < 9; i++) {\n for (j = 0; j < 4; j++) {\n sector->collectedMedals[i][j] = save->collectedMedals[i][j];\n }\n }\n\n sector->collectedEmeralds = save->collectedEmeralds;\n sector->unk62 = save->unk34;\n sector->unlockFlags = save->unlockFlags;\n sector->vsWins = save->vsWins;\n sector->vsDraws = save->vsDraws;\n sector->vsLosses = save->vsLosses;\n sector->unk67 = 0;\n\n for (i = 0; i < 10; i++) {\n sector->vsRecords[i].slotFilled = save->vsRecords[i].slotFilled;\n sector->vsRecords[i].wins = save->vsRecords[i].wins;\n sector->vsRecords[i].draws = save->vsRecords[i].draws;\n sector->vsRecords[i].losses = save->vsRecords[i].losses;\n\n sector->vsRecords[i].playerId = save->vsRecords[i].playerId;\n\n for (j = 0; j < 6; j++) {\n sector->vsRecords[i].playerName[j] = save->vsRecords[i].playerName[j];\n }\n }\n\n#define Zone i\n#define Act j\n#define Rank k\n for (Zone = 0; Zone < (s32)ARRAY_COUNT(save->timeRecords.table); Zone++) {\n for (Act = 0; Act < (s32)ARRAY_COUNT(save->timeRecords.table[0]); Act++) {\n for (Rank = 0; Rank < (s32)ARRAY_COUNT(save->timeRecords.table[0][0]); Rank++) {\n sector->timeRecords.table[Zone][Act][Rank].character1 = save->timeRecords.table[Zone][Act][Rank].character1;\n sector->timeRecords.table[Zone][Act][Rank].character2 = save->timeRecords.table[Zone][Act][Rank].character2;\n sector->timeRecords.table[Zone][Act][Rank].time = save->timeRecords.table[Zone][Act][Rank].time;\n }\n }\n }\n#undef Rank\n#undef Act\n#undef Zone\n\n switch (save->buttonConfig.jump) {\n case A_BUTTON:\n sector->buttonConfig.jump = 1;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 1;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 1;\n break;\n }\n\n switch (save->buttonConfig.attack) {\n case A_BUTTON:\n sector->buttonConfig.jump = 2;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 2;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 2;\n break;\n }\n\n switch (save->buttonConfig.trick) {\n case A_BUTTON:\n sector->buttonConfig.jump = 4;\n break;\n case B_BUTTON:\n sector->buttonConfig.attack = 4;\n break;\n case R_BUTTON:\n sector->buttonConfig.trick = 4;\n break;\n }\n\n sector->difficulty = save->difficulty;\n sector->disableTimeLimit = save->disableTimeLimit;\n sector->language = save->language;\n sector->unk367 = 0;\n sector->checksum = GetSaveSectorChecksum(sector);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L440-L556","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","proto":{"PackSaveSector":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'PackSaveSector' — lift: cannot lift 'PackSaveSector': 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\tPackSaveSector */\n/* \t.type\t PackSaveSector,function */\n/* \t.thumb_func */\n/* PackSaveSector: */\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, #-0x4c */\n/* \tadd\tr6, r0, #0 */\n/* \tmov\tr9, r1 */\n/* \tldr\tr0, .L82 */\n/* \tstr\tr0, [r6] */\n/* \tldr\tr0, [r6, #0x4] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstr\tr0, [r6, #0x4] */\n/* \tmov\tr3, r9 */\n/* \tldmia\tr3!, {r0} */\n/* \tstr\tr0, [r6, #0x8] */\n/* \tmov\tr5, #0x0 */\n/* \tadd\tr4, r6, #0 */\n/* \tadd\tr4, r4, #0xc */\n/* .L6: */\n/* \tlsl\tr1, r5, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x0 */\n/* \tstrb\tr1, [r6, #0x18] */\n/* \tmov\tr2, r9 */\n/* \tldrb\tr0, [r2, #0x10] */\n/* \tstrb\tr0, [r6, #0x19] */\n/* \tldrb\tr0, [r2, #0x11] */\n/* \tstrb\tr0, [r6, #0x1a] */\n/* \tldrb\tr0, [r2, #0x12] */\n/* \tstrb\tr0, [r6, #0x1b] */\n/* \tstrb\tr1, [r6, #0x1c] */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr3, #0x2c */\n/* \tadd\tr3, r3, r6 */\n/* \tmov\tr8, r3 */\n/* \tmov\tr7, r9 */\n/* \tadd\tr7, r7, #0x22 */\n/* \tmov\tr0, #0x33 */\n/* \tadd\tr0, r0, r6 */\n/* \tmov\tip, r0 */\n/* \tmov\tr1, #0x29 */\n/* \tadd\tr1, r1, r9 */\n/* \tmov\tsl, r1 */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x3e */\n/* \tstr\tr2, [sp, #0x48] */\n/* \tmov\tr3, r9 */\n/* \tadd\tr3, r3, #0x37 */\n/* \tstr\tr3, [sp, #0x3c] */\n/* \tmov\tr0, r9 */\n/* \tadd\tr0, r0, #0x32 */\n/* \tstr\tr0, [sp, #0x34] */\n/* \tadd\tr1, r6, #0 */\n/* \tadd\tr1, r1, #0x3c */\n/* \tstr\tr1, [sp, #0x40] */\n/* \tmov\tr2, r9 */\n/* \tldrh\tr3, [r2, #0x34] */\n/* \tmov\tr2, sp */\n/* \tstrh\tr3, [r2, #0x30] */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x62 */\n/* \tstr\tr0, [sp, #0x4] */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x33 */\n/* \tstr\tr1, [sp, #0x38] */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x3d */\n/* \tstr\tr2, [sp, #0x44] */\n/* \tmov\tr3, r9 */\n/* \tadd\tr3, r3, #0x60 */\n/* \tstr\tr3, [sp] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstr\tr0, [sp, #0x10] */\n/* \tadd\tr1, r1, #0x2f */\n/* \tstr\tr1, [sp, #0xc] */\n/* \tadd\tr2, r2, #0x28 */\n/* \tstr\tr2, [sp, #0x14] */\n/* \tadd\tr3, r3, #0x1 */\n/* \tstr\tr3, [sp, #0x8] */\n/* \tadd\tr0, r0, #0x2 */\n/* \tstr\tr0, [sp, #0x1c] */\n/* \tadd\tr1, r6, #0 */\n/* \tadd\tr1, r1, #0x67 */\n/* \tstr\tr1, [sp, #0x20] */\n/* \tadd\tr2, r2, #0x7 */\n/* \tstr\tr2, [sp, #0x28] */\n/* \tadd\tr3, r3, #0x3 */\n/* \tstr\tr3, [sp, #0x18] */\n/* \tadd\tr0, r0, #0xa */\n/* \tstr\tr0, [sp, #0x2c] */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x68 */\n/* \tstr\tr1, [sp, #0x24] */\n/* \tadd\tr4, r6, #0 */\n/* \tadd\tr4, r4, #0x1e */\n/* \tsub\tr3, r3, #0x50 */\n/* .L11: */\n/* \tlsl\tr1, r5, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x6 */\n/* \tble\t.L11\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr4, r8 */\n/* \tadd\tr3, r7, #0 */\n/* .L16: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x6 */\n/* \tble\t.L16\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tmov\tr4, ip */\n/* \tmov\tr3, sl */\n/* .L21: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr2, r4, r0 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x8 */\n/* \tble\t.L21\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr2, [sp, #0x48] */\n/* \tmov\tip, r2 */\n/* \tldr\tr3, [sp, #0x3c] */\n/* \tmov\tr8, r3 */\n/* .L26: */\n/* \tmov\tr3, #0x0 */\n/* \tlsl\tr7, r5, #0x10 */\n/* \tasr\tr4, r7, #0xe */\n/* .L30: */\n/* \tlsl\tr0, r3, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr1, r0, r4 */\n/* \tmov\tr3, ip */\n/* \tadd\tr2, r3, r1 */\n/* \tadd\tr1, r1, r8 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x3 */\n/* \tble\t.L30\t@cond_branch */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x9 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x8 */\n/* \tble\t.L26\t@cond_branch */\n/* \tldr\tr2, [sp, #0x34] */\n/* \tldrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x40] */\n/* \tstrb\tr0, [r3] */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tr0, sp */\n/* \tldrh\tr2, [r0, #0x30] */\n/* \tldr\tr0, [sp, #0x4] */\n/* \tstrh\tr2, [r0] */\n/* \tldr\tr3, [sp, #0x38] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x44] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x10] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0xc] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x14] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x8] */\n/* \tldrb\tr0, [r3] */\n/* \tldr\tr2, [sp, #0x1c] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr3, [sp, #0x20] */\n/* \tstrb\tr1, [r3] */\n/* \tmov\tr5, #0x0 */\n/* \tldr\tr0, [sp, #0x2c] */\n/* \tmov\tr8, r0 */\n/* \tldr\tr7, [sp, #0x24] */\n/* .L36: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr2, r2, r0 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr1, r6, r2 */\n/* \tmov\tip, r1 */\n/* \tmov\tr0, r9 */\n/* \tadd\tr3, r0, r2 */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x74 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x68 */\n/* \tstrb\tr1, [r0] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x75 */\n/* \tldrb\tr0, [r0] */\n/* \tmov\tr1, ip */\n/* \tadd\tr1, r1, #0x69 */\n/* \tstrb\tr0, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x77 */\n/* \tldrb\tr0, [r0] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tstrb\tr0, [r1] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x76 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x6b */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr3, [sp, #0x28] */\n/* \tadd\tr1, r3, r2 */\n/* \tldr\tr3, [sp, #0x18] */\n/* \tadd\tr0, r3, r2 */\n/* \tldr\tr0, [r0] */\n/* \tstr\tr0, [r1] */\n/* \tmov\tr3, #0x0 */\n/* \tadd\tr4, r2, #0 */\n/* .L40: */\n/* \tlsl\tr1, r3, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r4 */\n/* \tmov\tr3, r8 */\n/* \tadd\tr2, r3, r0 */\n/* \tadd\tr0, r7, r0 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr3, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tcmp\tr1, #0x5 */\n/* \tble\t.L40\t@cond_branch */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x9 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x9 */\n/* \tble\t.L36\t@cond_branch */\n/* \tmov\tr5, #0x0 */\n/* .L46: */\n/* \tmov\tr3, #0x0 */\n/* \tlsl\tr7, r5, #0x10 */\n/* \tasr\tr1, r7, #0x10 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tmov\tsl, r0 */\n/* .L50: */\n/* \tmov\tr4, #0x0 */\n/* \tlsl\tr5, r3, #0x10 */\n/* \tasr\tr1, r5, #0x10 */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tmov\tr8, r0 */\n/* .L54: */\n/* \tlsl\tr2, r4, #0x10 */\n/* \tasr\tr2, r2, #0x10 */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, sl */\n/* \tadd\tr3, r6, r0 */\n/* \tmov\tip, r3 */\n/* \tmov\tr1, r9 */\n/* \tadd\tr3, r1, r0 */\n/* \tmov\tr1, #0x96 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x98 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, ip */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr1, .L82+0x4 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tadd\tr1, r1, #0x4 */\n/* \tadd\tr1, r1, ip */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr1, #0x97 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrh\tr0, [r0] */\n/* \tadd\tr1, r1, #0x4 */\n/* \tadd\tr1, r1, ip */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r2, #0x1 */\n/* \tlsl\tr2, r2, #0x10 */\n/* \tlsr\tr4, r2, #0x10 */\n/* \tasr\tr2, r2, #0x10 */\n/* \tcmp\tr2, #0x4 */\n/* \tble\t.L54\t@cond_branch */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x9 */\n/* \tadd\tr0, r5, r2 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x3 */\n/* \tble\t.L50\t@cond_branch */\n/* \tadd\tr0, r7, r2 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tcmp\tr0, #0x6 */\n/* \tble\t.L46\t@cond_branch */\n/* \tmov\tr0, #0xd7 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L60\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L64\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L59\t@cond_branch */\n/* \tb\t.L58 */\n/* .L83: */\n/* \t.align\t2, 0 */\n/* .L82: */\n/* \t.word\t0x47544e4c */\n/* \t.word\t0x12d */\n/* .L64: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L61\t@cond_branch */\n/* \tb\t.L58 */\n/* .L59: */\n/* \tmov\tr3, #0xd8 */\n/* \tlsl\tr3, r3, #0x2 */\n/* \tadd\tr0, r6, r3 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L58 */\n/* .L60: */\n/* \tldr\tr0, .L84 */\n/* \tadd\tr1, r6, r0 */\n/* \tb\t.L79 */\n/* .L85: */\n/* \t.align\t2, 0 */\n/* .L84: */\n/* \t.word\t0x361 */\n/* .L61: */\n/* \tldr\tr2, .L86 */\n/* \tadd\tr1, r6, r2 */\n/* .L79: */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r1] */\n/* .L58: */\n/* \tldr\tr0, .L86+0x4 */\n/* \tadd\tr0, r0, r9 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L67\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L71\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L66\t@cond_branch */\n/* \tb\t.L65 */\n/* .L87: */\n/* \t.align\t2, 0 */\n/* .L86: */\n/* \t.word\t0x362 */\n/* \t.word\t0x35e */\n/* .L71: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L68\t@cond_branch */\n/* \tb\t.L65 */\n/* .L66: */\n/* \tmov\tr3, #0xd8 */\n/* \tlsl\tr3, r3, #0x2 */\n/* \tb\t.L80 */\n/* .L67: */\n/* \tldr\tr2, .L88 */\n/* \tadd\tr0, r6, r2 */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L65 */\n/* .L89: */\n/* \t.align\t2, 0 */\n/* .L88: */\n/* \t.word\t0x361 */\n/* .L68: */\n/* \tldr\tr3, .L90 */\n/* .L80: */\n/* \tadd\tr1, r6, r3 */\n/* \tmov\tr0, #0x2 */\n/* \tstrb\tr0, [r1] */\n/* .L65: */\n/* \tmov\tr2, #0xd8 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr1, #0x2 */\n/* \tbeq\t.L74\t@cond_branch */\n/* \tcmp\tr1, #0x2 */\n/* \tbgt\t.L78\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L73\t@cond_branch */\n/* \tb\t.L72 */\n/* .L91: */\n/* \t.align\t2, 0 */\n/* .L90: */\n/* \t.word\t0x362 */\n/* .L78: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tcmp\tr1, r0 */\n/* \tbeq\t.L75\t@cond_branch */\n/* \tb\t.L72 */\n/* .L73: */\n/* \tadd\tr1, r6, r2 */\n/* \tb\t.L81 */\n/* .L74: */\n/* \tldr\tr2, .L92 */\n/* \tadd\tr1, r6, r2 */\n/* \tb\t.L81 */\n/* .L93: */\n/* \t.align\t2, 0 */\n/* .L92: */\n/* \t.word\t0x361 */\n/* .L75: */\n/* \tldr\tr3, .L94 */\n/* \tadd\tr1, r6, r3 */\n/* .L81: */\n/* \tmov\tr0, #0x4 */\n/* \tstrb\tr0, [r1] */\n/* .L72: */\n/* \tmov\tr0, #0xd9 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tmov\tr2, r9 */\n/* \tadd\tr1, r2, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tmov\tr2, #0x0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr0, .L94+0x4 */\n/* \tmov\tr3, r9 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr0, .L94+0x8 */\n/* \tadd\tr1, r3, r0 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r6, r0 */\n/* \tstrb\tr1, [r0] */\n/* \tldr\tr1, .L94+0xc */\n/* \tadd\tr0, r6, r1 */\n/* \tstrb\tr2, [r0] */\n/* \tadd\tr0, r6, #0 */\n/* \tbl\tGetSaveSectorChecksum */\n/* \tmov\tr2, #0xda */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr1, r6, r2 */\n/* \tstr\tr0, [r1] */\n/* \tadd\tsp, sp, #0x4c */\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/* .L95: */\n/* \t.align\t2, 0 */\n/* .L94: */\n/* \t.word\t0x362 */\n/* \t.word\t0x365 */\n/* \t.word\t0x366 */\n/* \t.word\t0x367 */\n/* .Lfe1: */\n/* \t.size\t PackSaveSector,.Lfe1-PackSaveSector */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid PackSaveSector(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'PackSaveSector': 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":534,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'PackSaveSector': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 GetSaveSectorChecksum(void *); /* extern */\n\nvoid PackSaveSector(void *arg0, void *arg1, s8 *arg4, void *arg5, void *arg6, void *arg7, u8 *arg9, u8 *argA, void *argB, u8 *argC, u8 *argD, void *argE) {\n s16 temp_r0_11;\n s16 temp_r0_7;\n s16 temp_r0_9;\n s16 temp_r1_2;\n s16 temp_r1_5;\n s16 temp_r1_8;\n s16 temp_r2_4;\n s16 var_r3;\n s16 var_r3_2;\n s16 var_r3_3;\n s16 var_r4;\n s16 var_r5;\n s16 var_r5_2;\n s16 var_r5_3;\n s16 var_r5_4;\n s16 var_r5_6;\n s16 var_r5_7;\n s32 temp_r0;\n s32 temp_r0_14;\n s32 temp_r0_16;\n s32 temp_r0_5;\n s32 temp_r1_6;\n s32 temp_r2_3;\n s32 var_r3_4;\n s8 *var_r1;\n s8 *var_r1_2;\n u16 temp_r0_12;\n u16 temp_r0_6;\n u16 temp_r0_8;\n u16 temp_r1;\n u16 temp_r1_10;\n u16 temp_r1_11;\n u16 temp_r1_12;\n u16 temp_r1_4;\n u16 temp_r1_9;\n u16 temp_r2_5;\n u32 temp_r0_10;\n u32 temp_r0_13;\n u32 temp_r0_15;\n u32 temp_r0_17;\n u32 var_r5_5;\n u8 *temp_r1_3;\n u8 *temp_r2;\n void *temp_r0_2;\n void *temp_r0_3;\n void *temp_r0_4;\n void *temp_r1_7;\n void *temp_r2_2;\n void *temp_r3;\n void *temp_r3_2;\n void *temp_r3_3;\n void *temp_r3_4;\n void *temp_r3_5;\n void *temp_r3_6;\n\n arg0->unk0 = 0x47544E4C;\n arg0->unk4 = (s32) (arg0->unk4 + 1);\n arg0->unk8 = (s32) arg1->unk0;\n var_r5 = 0;\n do {\n temp_r1_2 = var_r5;\n temp_r0 = temp_r1_2 * 2;\n *(arg0 + 0xC + temp_r0) = *(arg1 + 4 + temp_r0);\n temp_r1 = temp_r1_2 + 1;\n var_r5 = (s16) temp_r1;\n } while ((s32) (s16) temp_r1 <= 5);\n arg0->unk18 = 0;\n arg0->unk19 = (u8) arg1->unk10;\n arg0->unk1A = (u8) arg1->unk11;\n arg0->unk1B = (u8) arg1->unk12;\n arg0->unk1C = 0;\n var_r5_2 = 0;\n argE = arg0 + 0x3E;\n argB = arg1 + 0x37;\n arg9 = arg1 + 0x32;\n argC = arg0 + 0x3C;\n unksp0.unk30 = (u16) arg1->unk34;\n temp_r0_2 = arg0 + 0x62;\n unksp4 = temp_r0_2;\n temp_r1_3 = arg1 + 0x33;\n argA = temp_r1_3;\n temp_r2 = arg0 + 0x3D;\n argD = temp_r2;\n temp_r3 = arg1 + 0x60;\n unksp0 = temp_r3;\n temp_r0_3 = temp_r0_2 + 2;\n unksp10 = temp_r0_3;\n unkspC = temp_r1_3 + 0x2F;\n temp_r2_2 = temp_r2 + 0x28;\n unksp14 = temp_r2_2;\n temp_r3_2 = temp_r3 + 1;\n unksp8 = temp_r3_2;\n temp_r0_4 = temp_r0_3 + 2;\n unksp1C = temp_r0_4;\n arg4 = arg0 + 0x67;\n arg6 = temp_r2_2 + 7;\n temp_r3_3 = temp_r3_2 + 3;\n unksp18 = temp_r3_3;\n arg7 = temp_r0_4 + 0xA;\n arg5 = arg1 + 0x68;\n do {\n temp_r1_5 = var_r5_2;\n temp_r0_5 = temp_r1_5 * 2;\n *(arg0 + 0x1E + temp_r0_5) = *((temp_r3_3 - 0x50) + temp_r0_5);\n temp_r1_4 = temp_r1_5 + 1;\n var_r5_2 = (s16) temp_r1_4;\n } while ((s32) (s16) temp_r1_4 <= 6);\n var_r5_3 = 0;\n do {\n temp_r0_7 = var_r5_3;\n *(arg0 + 0x2C + temp_r0_7) = *(arg1 + 0x22 + temp_r0_7);\n temp_r0_6 = temp_r0_7 + 1;\n var_r5_3 = (s16) temp_r0_6;\n } while ((s32) (s16) temp_r0_6 <= 6);\n var_r5_4 = 0;\n do {\n temp_r0_9 = var_r5_4;\n *(arg0 + 0x33 + temp_r0_9) = *(arg1 + 0x29 + temp_r0_9);\n temp_r0_8 = temp_r0_9 + 1;\n var_r5_4 = (s16) temp_r0_8;\n } while ((s32) (s16) temp_r0_8 <= 8);\n var_r5_5 = 0;\n do {\n var_r3 = 0;\nloop_10:\n temp_r0_11 = var_r3;\n temp_r1_6 = temp_r0_11 + ((s32) (var_r5_5 << 0x10) >> 0xE);\n *(argE + temp_r1_6) = *(temp_r1_6 + argB);\n temp_r0_12 = temp_r0_11 + 1;\n var_r3 = (s16) temp_r0_12;\n if ((s32) (s16) temp_r0_12 <= 3) {\n goto loop_10;\n }\n temp_r0_10 = (var_r5_5 << 0x10) + 0x10000;\n var_r5_5 = temp_r0_10 >> 0x10;\n } while ((s32) ((s32) temp_r0_10 >> 0x10) <= 8);\n *argC = *arg9;\n *unksp4 = unksp0.unk30;\n *argD = *argA;\n *unksp10 = *unksp0;\n *unksp14 = *unkspC;\n *unksp1C = *unksp8;\n *arg4 = 0;\n var_r5_6 = 0;\n do {\n temp_r2_3 = var_r5_6 * 0x14;\n temp_r1_7 = arg0 + temp_r2_3;\n temp_r3_4 = arg1 + temp_r2_3;\n temp_r1_7->unk68 = (u8) temp_r3_4->unk74;\n temp_r1_7->unk69 = (u8) temp_r3_4->unk75;\n (temp_r1_7 + 0x69)->unk1 = (u8) temp_r3_4->unk77;\n temp_r1_7->unk6B = (u8) temp_r3_4->unk76;\n *(arg6 + temp_r2_3) = *(unksp18 + temp_r2_3);\n var_r3_2 = 0;\nloop_14:\n temp_r1_8 = var_r3_2;\n temp_r0_14 = (temp_r1_8 * 2) + temp_r2_3;\n *(arg7 + temp_r0_14) = *(arg5 + temp_r0_14);\n temp_r1_9 = temp_r1_8 + 1;\n var_r3_2 = (s16) temp_r1_9;\n if ((s32) (s16) temp_r1_9 <= 5) {\n goto loop_14;\n }\n temp_r0_13 = (var_r5_6 << 0x10) + 0x10000;\n var_r5_6 = (s16) (temp_r0_13 >> 0x10);\n } while ((s32) ((s32) temp_r0_13 >> 0x10) <= 9);\n var_r5_7 = 0;\n do {\n var_r3_3 = 0;\nloop_18:\n var_r4 = 0;\nloop_19:\n temp_r2_4 = var_r4;\n temp_r0_16 = (temp_r2_4 * 4) + (var_r3_3 * 0x14) + (var_r5_7 * 0x50);\n temp_r3_5 = arg0 + temp_r0_16;\n temp_r3_6 = arg1 + temp_r0_16;\n temp_r3_5->unk130 = (u8) temp_r3_6->unk12C;\n temp_r3_5->unk131 = (u8) temp_r3_6->unk12D;\n temp_r3_5->unk132 = (u16) temp_r3_6->unk12E;\n temp_r2_5 = temp_r2_4 + 1;\n var_r4 = (s16) temp_r2_5;\n if ((s32) (s16) temp_r2_5 <= 4) {\n goto loop_19;\n }\n temp_r0_17 = (var_r3_3 << 0x10) + 0x10000;\n var_r3_3 = (s16) (temp_r0_17 >> 0x10);\n if ((s32) ((s32) temp_r0_17 >> 0x10) <= 3) {\n goto loop_18;\n }\n temp_r0_15 = (var_r5_7 << 0x10) + 0x10000;\n var_r5_7 = (s16) (temp_r0_15 >> 0x10);\n } while ((s32) ((s32) temp_r0_15 >> 0x10) <= 6);\n temp_r1_10 = arg1->unk35C;\n switch (temp_r1_10) { /* switch 1; irregular */\n case 0x1: /* switch 1 */\n arg0->unk360 = (s8) temp_r1_10;\n break;\n case 0x2: /* switch 1 */\n var_r1 = arg0 + 0x361;\nblock_31:\n *var_r1 = 1;\n break;\n case 0x100: /* switch 1 */\n var_r1 = arg0 + 0x362;\n goto block_31;\n }\n temp_r1_11 = arg1->unk35E;\n switch (temp_r1_11) { /* switch 2; irregular */\n case 0x1: /* switch 2 */\n var_r3_4 = 0x360;\nblock_41:\n *(arg0 + var_r3_4) = 2;\n break;\n case 0x2: /* switch 2 */\n arg0->unk361 = (s8) temp_r1_11;\n break;\n case 0x100: /* switch 2 */\n var_r3_4 = 0x362;\n goto block_41;\n }\n temp_r1_12 = arg1->unk360;\n switch (temp_r1_12) { /* switch 3; irregular */\n case 0x1: /* switch 3 */\n var_r1_2 = arg0 + 0x360;\nblock_51:\n *var_r1_2 = 4;\n break;\n case 0x2: /* switch 3 */\n var_r1_2 = arg0 + 0x361;\n goto block_51;\n case 0x100: /* switch 3 */\n var_r1_2 = arg0 + 0x362;\n goto block_51;\n }\n arg0->unk364 = (u8) arg1->unk364;\n arg0->unk365 = (u8) arg1->unk365;\n arg0->unk366 = (u8) arg1->unk366;\n arg0->unk367 = 0;\n arg0->unk368 = GetSaveSectorChecksum(arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":241,"gotos":8,"casts":52,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1876: warning: dereferencing `void *' pointer","/c.c:1876: request for member `unk0' in something not a structure or union","/c.c:1877: warning: dereferencing `void *' pointer","/c.c:1877: request for member `unk4' in something not a structure or union","/c.c:1878: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PackSaveSector` — benchmark function sa3:PackSaveSector:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\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 PackSaveSector # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PackSaveSector` — benchmark function sa3:PackSaveSector:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:PackSaveSector:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPackSaveSector\n\t.type\t PackSaveSector,function\n\t.thumb_func\nPackSaveSector:\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, #-0x4c\n\tadd\tr6, r0, #0\n\tmov\tr9, r1\n\tldr\tr0, .L82\n\tstr\tr0, [r6]\n\tldr\tr0, [r6, #0x4]\n\tadd\tr0, r0, #0x1\n\tstr\tr0, [r6, #0x4]\n\tmov\tr3, r9\n\tldmia\tr3!, {r0}\n\tstr\tr0, [r6, #0x8]\n\tmov\tr5, #0x0\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0xc\n.L6:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tstrb\tr1, [r6, #0x18]\n\tmov\tr2, r9\n\tldrb\tr0, [r2, #0x10]\n\tstrb\tr0, [r6, #0x19]\n\tldrb\tr0, [r2, #0x11]\n\tstrb\tr0, [r6, #0x1a]\n\tldrb\tr0, [r2, #0x12]\n\tstrb\tr0, [r6, #0x1b]\n\tstrb\tr1, [r6, #0x1c]\n\tmov\tr5, #0x0\n\tmov\tr3, #0x2c\n\tadd\tr3, r3, r6\n\tmov\tr8, r3\n\tmov\tr7, r9\n\tadd\tr7, r7, #0x22\n\tmov\tr0, #0x33\n\tadd\tr0, r0, r6\n\tmov\tip, r0\n\tmov\tr1, #0x29\n\tadd\tr1, r1, r9\n\tmov\tsl, r1\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3e\n\tstr\tr2, [sp, #0x48]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x37\n\tstr\tr3, [sp, #0x3c]\n\tmov\tr0, r9\n\tadd\tr0, r0, #0x32\n\tstr\tr0, [sp, #0x34]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x3c\n\tstr\tr1, [sp, #0x40]\n\tmov\tr2, r9\n\tldrh\tr3, [r2, #0x34]\n\tmov\tr2, sp\n\tstrh\tr3, [r2, #0x30]\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x62\n\tstr\tr0, [sp, #0x4]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x33\n\tstr\tr1, [sp, #0x38]\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x3d\n\tstr\tr2, [sp, #0x44]\n\tmov\tr3, r9\n\tadd\tr3, r3, #0x60\n\tstr\tr3, [sp]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x10]\n\tadd\tr1, r1, #0x2f\n\tstr\tr1, [sp, #0xc]\n\tadd\tr2, r2, #0x28\n\tstr\tr2, [sp, #0x14]\n\tadd\tr3, r3, #0x1\n\tstr\tr3, [sp, #0x8]\n\tadd\tr0, r0, #0x2\n\tstr\tr0, [sp, #0x1c]\n\tadd\tr1, r6, #0\n\tadd\tr1, r1, #0x67\n\tstr\tr1, [sp, #0x20]\n\tadd\tr2, r2, #0x7\n\tstr\tr2, [sp, #0x28]\n\tadd\tr3, r3, #0x3\n\tstr\tr3, [sp, #0x18]\n\tadd\tr0, r0, #0xa\n\tstr\tr0, [sp, #0x2c]\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x68\n\tstr\tr1, [sp, #0x24]\n\tadd\tr4, r6, #0\n\tadd\tr4, r4, #0x1e\n\tsub\tr3, r3, #0x50\n.L11:\n\tlsl\tr1, r5, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr2, r4, r0\n\tadd\tr0, r3, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x6\n\tble\t.L11\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, r8\n\tadd\tr3, r7, #0\n.L16:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L16\t@cond_branch\n\tmov\tr5, #0x0\n\tmov\tr4, ip\n\tmov\tr3, sl\n.L21:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr2, r4, r0\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L21\t@cond_branch\n\tmov\tr5, #0x0\n\tldr\tr2, [sp, #0x48]\n\tmov\tip, r2\n\tldr\tr3, [sp, #0x3c]\n\tmov\tr8, r3\n.L26:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr4, r7, #0xe\n.L30:\n\tlsl\tr0, r3, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r0, r4\n\tmov\tr3, ip\n\tadd\tr2, r3, r1\n\tadd\tr1, r1, r8\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r2]\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L30\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x8\n\tble\t.L26\t@cond_branch\n\tldr\tr2, [sp, #0x34]\n\tldrb\tr0, [r2]\n\tldr\tr3, [sp, #0x40]\n\tstrb\tr0, [r3]\n\tmov\tr1, #0x0\n\tmov\tr0, sp\n\tldrh\tr2, [r0, #0x30]\n\tldr\tr0, [sp, #0x4]\n\tstrh\tr2, [r0]\n\tldr\tr3, [sp, #0x38]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x44]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x10]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0xc]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x14]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x8]\n\tldrb\tr0, [r3]\n\tldr\tr2, [sp, #0x1c]\n\tstrb\tr0, [r2]\n\tldr\tr3, [sp, #0x20]\n\tstrb\tr1, [r3]\n\tmov\tr5, #0x0\n\tldr\tr0, [sp, #0x2c]\n\tmov\tr8, r0\n\tldr\tr7, [sp, #0x24]\n.L36:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr2, r0, #0x2\n\tadd\tr2, r2, r0\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tmov\tip, r1\n\tmov\tr0, r9\n\tadd\tr3, r0, r2\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x74\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x68\n\tstrb\tr1, [r0]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x75\n\tldrb\tr0, [r0]\n\tmov\tr1, ip\n\tadd\tr1, r1, #0x69\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x77\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x1\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x76\n\tldrb\tr1, [r0]\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x6b\n\tstrb\tr1, [r0]\n\tldr\tr3, [sp, #0x28]\n\tadd\tr1, r3, r2\n\tldr\tr3, [sp, #0x18]\n\tadd\tr0, r3, r2\n\tldr\tr0, [r0]\n\tstr\tr0, [r1]\n\tmov\tr3, #0x0\n\tadd\tr4, r2, #0\n.L40:\n\tlsl\tr1, r3, #0x10\n\tasr\tr1, r1, #0x10\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r4\n\tmov\tr3, r8\n\tadd\tr2, r3, r0\n\tadd\tr0, r7, r0\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x5\n\tble\t.L40\t@cond_branch\n\tlsl\tr0, r5, #0x10\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x9\n\tadd\tr0, r0, r1\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x9\n\tble\t.L36\t@cond_branch\n\tmov\tr5, #0x0\n.L46:\n\tmov\tr3, #0x0\n\tlsl\tr7, r5, #0x10\n\tasr\tr1, r7, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x4\n\tmov\tsl, r0\n.L50:\n\tmov\tr4, #0x0\n\tlsl\tr5, r3, #0x10\n\tasr\tr1, r5, #0x10\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tmov\tr8, r0\n.L54:\n\tlsl\tr2, r4, #0x10\n\tasr\tr2, r2, #0x10\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tadd\tr3, r6, r0\n\tmov\tip, r3\n\tmov\tr1, r9\n\tadd\tr3, r1, r0\n\tmov\tr1, #0x96\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x98\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tstrb\tr1, [r0]\n\tldr\tr1, .L82+0x4\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrb\tr0, [r1]\n\tmov\tr1, #0x97\n\tlsl\tr1, r1, #0x1\n\tadd\tr0, r3, r1\n\tldrh\tr0, [r0]\n\tadd\tr1, r1, #0x4\n\tadd\tr1, r1, ip\n\tstrh\tr0, [r1]\n\tadd\tr2, r2, #0x1\n\tlsl\tr2, r2, #0x10\n\tlsr\tr4, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tcmp\tr2, #0x4\n\tble\t.L54\t@cond_branch\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x9\n\tadd\tr0, r5, r2\n\tlsr\tr3, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x3\n\tble\t.L50\t@cond_branch\n\tadd\tr0, r7, r2\n\tlsr\tr5, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tcmp\tr0, #0x6\n\tble\t.L46\t@cond_branch\n\tmov\tr0, #0xd7\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L60\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L64\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L59\t@cond_branch\n\tb\t.L58\n.L83:\n\t.align\t2, 0\n.L82:\n\t.word\t0x47544e4c\n\t.word\t0x12d\n.L64:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L61\t@cond_branch\n\tb\t.L58\n.L59:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tadd\tr0, r6, r3\n\tstrb\tr1, [r0]\n\tb\t.L58\n.L60:\n\tldr\tr0, .L84\n\tadd\tr1, r6, r0\n\tb\t.L79\n.L85:\n\t.align\t2, 0\n.L84:\n\t.word\t0x361\n.L61:\n\tldr\tr2, .L86\n\tadd\tr1, r6, r2\n.L79:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r1]\n.L58:\n\tldr\tr0, .L86+0x4\n\tadd\tr0, r0, r9\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L67\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L71\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L66\t@cond_branch\n\tb\t.L65\n.L87:\n\t.align\t2, 0\n.L86:\n\t.word\t0x362\n\t.word\t0x35e\n.L71:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L68\t@cond_branch\n\tb\t.L65\n.L66:\n\tmov\tr3, #0xd8\n\tlsl\tr3, r3, #0x2\n\tb\t.L80\n.L67:\n\tldr\tr2, .L88\n\tadd\tr0, r6, r2\n\tstrb\tr1, [r0]\n\tb\t.L65\n.L89:\n\t.align\t2, 0\n.L88:\n\t.word\t0x361\n.L68:\n\tldr\tr3, .L90\n.L80:\n\tadd\tr1, r6, r3\n\tmov\tr0, #0x2\n\tstrb\tr0, [r1]\n.L65:\n\tmov\tr2, #0xd8\n\tlsl\tr2, r2, #0x2\n\tmov\tr1, r9\n\tadd\tr0, r1, r2\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0x2\n\tbeq\t.L74\t@cond_branch\n\tcmp\tr1, #0x2\n\tbgt\t.L78\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L73\t@cond_branch\n\tb\t.L72\n.L91:\n\t.align\t2, 0\n.L90:\n\t.word\t0x362\n.L78:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L75\t@cond_branch\n\tb\t.L72\n.L73:\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L74:\n\tldr\tr2, .L92\n\tadd\tr1, r6, r2\n\tb\t.L81\n.L93:\n\t.align\t2, 0\n.L92:\n\t.word\t0x361\n.L75:\n\tldr\tr3, .L94\n\tadd\tr1, r6, r3\n.L81:\n\tmov\tr0, #0x4\n\tstrb\tr0, [r1]\n.L72:\n\tmov\tr0, #0xd9\n\tlsl\tr0, r0, #0x2\n\tmov\tr2, r9\n\tadd\tr1, r2, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tmov\tr2, #0x0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x4\n\tmov\tr3, r9\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr0, .L94+0x8\n\tadd\tr1, r3, r0\n\tldrb\tr1, [r1]\n\tadd\tr0, r6, r0\n\tstrb\tr1, [r0]\n\tldr\tr1, .L94+0xc\n\tadd\tr0, r6, r1\n\tstrb\tr2, [r0]\n\tadd\tr0, r6, #0\n\tbl\tGetSaveSectorChecksum\n\tmov\tr2, #0xda\n\tlsl\tr2, r2, #0x2\n\tadd\tr1, r6, r2\n\tstr\tr0, [r1]\n\tadd\tsp, sp, #0x4c\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.L95:\n\t.align\t2, 0\n.L94:\n\t.word\t0x362\n\t.word\t0x365\n\t.word\t0x366\n\t.word\t0x367\n.Lfe1:\n\t.size\t PackSaveSector,.Lfe1-PackSaveSector\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"PackSaveSector\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PackSaveSector # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","union","bitfield","field","loop","nested-loop","sizeof","bitwise","call","mmio","dma"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","memory","sizeof","shift","bitwise","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","cast","loop","bitwise","mmio","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","shift","bitwise","mmio","dma","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["pointer","global","arithmetic","loop","bitwise","mmio","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","bitwise"],"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/scopebase","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 v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = (s32)(*(s16 *)(a0 + 2) * v0) >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = (s32)(*(s16 *)(a0 + 4) * v2) >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n p0 = (u16 *)&gSineTable;\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":82,"maxScore":129,"compileErrors":null,"breakdown":{"insert":21,"delete":19,"replace":6,"opMismatch":3,"argMismatch":33},"quality":{"score":74,"lines":40,"gotos":0,"casts":7,"unkGlue":0,"rawMem":4,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_8083504(void *arg0, void *arg1, void *arg2) {\n s16 temp_r1;\n s16 temp_r1_2;\n s32 var_r0;\n s32 var_r3;\n s32 var_r4;\n u16 temp_r1_3;\n u16 temp_r1_4;\n\n temp_r1 = arg1->unk2;\n if (temp_r1 != 0x400) {\n var_r3 = (s32) (arg0->unk8 * temp_r1) >> 0xA;\n arg2->unk2 = (s16) ((s32) (arg0->unk2 * temp_r1) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n temp_r1_2 = arg1->unk4;\n if (temp_r1_2 != 0x400) {\n var_r4 = (s32) (arg0->unkC * temp_r1_2) >> 0xA;\n arg2->unk4 = (s16) ((s32) (arg0->unk4 * temp_r1_2) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n if (arg1->unk0 != 0) {\n temp_r1_3 = arg1->unk0;\n arg2->unk8 = (s32) (arg1->unk8 + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_3 + 0x100] << 0x10) >> 0x16)) >> 8) - ((s32) (((s32) ((u16) gSineTable[temp_r1_3] << 0x10) >> 0x16) * var_r4) >> 8)));\n temp_r1_4 = arg1->unk0;\n var_r0 = arg1->unkC + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_4] << 0x10) >> 0x16)) >> 8) + ((s32) (((s32) ((u16) gSineTable[temp_r1_4 + 0x100] << 0x10) >> 0x16) * var_r4) >> 8));\n } else {\n arg2->unk8 = (s32) (arg1->unk8 + var_r3);\n var_r0 = arg1->unkC + var_r4;\n }\n arg2->unkC = var_r0;\n arg2->unk0 = (s16) ((arg1->unk0 + arg0->unk0) & 0x3FF);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":21,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:330: warning: dereferencing `void *' pointer","/c.c:330: request for member `unk2' in something not a structure or union","/c.c:332: warning: dereferencing `void *' pointer","/c.c:332: request for member `unk8' in something not a structure or union","/c.c:333: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":82,"maxScore":129,"ratio":0.6356589147286822,"kinds":{"insert":21,"delete":19,"replace":6,"opMismatch":3,"argMismatch":33}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","branch","shift","bitwise"],"loc":14,"refSource":"s16 SA2_LABEL(sub_808558C)(u16 angleA, u16 angleB, u8 numDecimalBits)\n{\n u32 c1 = (1 << numDecimalBits);\n u16 c2 = c1 - 1;\n\n angleB -= angleA;\n angleB &= c2;\n\n if (angleB <= (c1 / 2)) {\n return angleB;\n } else {\n return (angleB - c1);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= (u32)(1 << (u8)a2) >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n","score":22,"maxScore":26,"compileErrors":null,"breakdown":{"insert":1,"delete":8,"replace":4,"opMismatch":1,"argMismatch":8},"quality":{"score":88,"lines":9,"gotos":0,"casts":15,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sa2__sub_808558C(u16 arg0, u16 arg1, u8 arg2) {\n s32 var_r0;\n u16 temp_r3;\n u32 temp_r4;\n\n temp_r4 = 1 << arg2;\n temp_r3 = (arg1 - arg0) & (temp_r4 - 1);\n if ((u32) temp_r3 > (u32) (temp_r4 >> 1)) {\n var_r0 = (temp_r3 - temp_r4) << 0x10;\n } else {\n var_r0 = temp_r3 << 0x10;\n }\n return var_r0 >> 0x10;\n}\n","score":16,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":25,"ratio":0.64,"kinds":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call"],"loc":6,"refSource":"u32 SA2_LABEL(sub_80855C0)(s32 a, s32 b, s32 c, u8 d)\n{\n s64 e = (s64)c * (a - b);\n\n return a - (e >> d);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_80855C0(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n","score":31,"maxScore":38,"compileErrors":null,"breakdown":{"insert":12,"delete":7,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_80855C0(s32 arg0, s32 arg1, s32 arg2, u8 arg3) {\n s32 temp_r4;\n s32 temp_ret;\n\n temp_r4 = arg0 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r4, temp_r4 >> 0x1F);\n return arg0 - __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n}\n","score":20,"maxScore":28,"compileErrors":null,"breakdown":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":20,"maxScore":28,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["arithmetic","int64","do-while","loop","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadIntr:agbcc","sym":"Sio32MultiLoadIntr","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","branch","bitwise","mmio"],"loc":38,"refSource":"void Sio32MultiLoadIntr(void)\n{\n // Saves received data\n u32 recvTmp = REG_SIODATA32;\n // Slave prepares to receive\n if (gSio32MultiLoadArea.type != SIO_SCK_IN)\n REG_SIOCNT |= SIO_ENABLE;\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n REG_SIO32ML_TIMER_H = 0; // Stops timer\n // Process sending data\n if (gSio32MultiLoadArea.dataCounter < 0) // Sets synchronous data\n REG_SIODATA32 = SIO32ML_SYNC_DATA;\n else if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4) // Sets sending\n // data\n REG_SIODATA32 = gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter];\n else\n REG_SIODATA32 = gSio32MultiLoadArea.checkSum; // Sets check sum\n } else {\n // Process receiving data\n if (gSio32MultiLoadArea.dataCounter < 0) { // Checks synchronous data\n if (recvTmp != SIO32ML_SYNC_DATA)\n --gSio32MultiLoadArea.dataCounter;\n } else if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4) // Saves\n // receiving\n // data\n gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter] = recvTmp;\n else\n gSio32MultiLoadArea.checkSum = recvTmp; // Saves check sum\n }\n if (gSio32MultiLoadArea.dataCounter < SIO32ML_BLOCK_SIZE / 4 + 3) {\n ++gSio32MultiLoadArea.dataCounter;\n // Master starts to sending\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n REG_SIOCNT |= SIO_ENABLE; // Restarts sending\n REG_SIO32ML_TIMER_H = TIMER_1CLK | TIMER_INTR_ENABLE | TIMER_ENABLE; // Restarts timer\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sio32_multi_load.c#L97-L134","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-d92540a45b92.i.gz","proto":{"Sio32MultiLoadIntr":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSio32MultiLoadArea"},{"name":"REG_TM3CNT_H","shape":"scalar u16"}],"outcome":"nonmatch","source":"struct Struct0 { u8 field_0; s32 field_4; s32 field_8; s32 field_12; };\nvoid Sio32MultiLoadIntr(void) {\n s32 v0;\n v0 = *(s32 *)67109152;\n if (*(u8 *)&gSio32MultiLoadArea == 1) {\n REG_TM3CNT_H = 0;\n if (((s32 *)&gSio32MultiLoadArea)[2] >= 0) {\n if (((s32 *)&gSio32MultiLoadArea)[2] > 8191) {\n *(s32 *)67109152 = ((s32 *)&gSio32MultiLoadArea)[3];\n } else {\n *(s32 *)67109152 = ((s32 *)((s32 *)&gSio32MultiLoadArea)[1])[((s32 *)&gSio32MultiLoadArea)[2]];\n }\n } else {\n *(s32 *)67109152 = -16843010;\n }\n } else {\n *(u16 *)67109160 = *(u16 *)67109160 | 128;\n if (((s32 *)&gSio32MultiLoadArea)[2] >= 0) {\n if (((s32 *)&gSio32MultiLoadArea)[2] > 8191) {\n ((s32 *)&gSio32MultiLoadArea)[3] = v0;\n } else {\n ((s32 *)((s32 *)&gSio32MultiLoadArea)[1])[((s32 *)&gSio32MultiLoadArea)[2]] = v0;\n }\n } else {\n if (v0 != -16843010) ((s32 *)&gSio32MultiLoadArea)[2] = ((s32 *)&gSio32MultiLoadArea)[2] - 1;\n }\n }\n if (((s32 *)&gSio32MultiLoadArea)[2] <= 8194) {\n ((s32 *)&gSio32MultiLoadArea)[2] = ((s32 *)&gSio32MultiLoadArea)[2] + 1;\n if (*(u8 *)&gSio32MultiLoadArea == 1) {\n *(u16 *)67109160 = *(u16 *)67109160 | 128;\n REG_TM3CNT_H = 192;\n }\n }\n return;\n}\n","score":76,"maxScore":106,"compileErrors":null,"breakdown":{"insert":17,"delete":16,"replace":12,"opMismatch":5,"argMismatch":26},"quality":{"score":88,"lines":36,"gotos":0,"casts":28,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Sio32MultiLoadIntr(void) {\n u32 temp_r3;\n\n temp_r3 = *(u32 *)0x04000120;\n if (gSio32MultiLoadArea.type != 1) {\n *(u16 *)0x04000128 |= 0x80;\n if ((s32) gSio32MultiLoadArea.dataCounter < 0) {\n if (temp_r3 != 0xFEFEFEFE) {\n gSio32MultiLoadArea.dataCounter -= 1;\n }\n } else if ((s32) gSio32MultiLoadArea.dataCounter <= 0x1FFF) {\n gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter] = temp_r3;\n } else {\n gSio32MultiLoadArea.checkSum = temp_r3;\n }\n } else {\n *(s16 *)0x0400010E = 0;\n if ((s32) gSio32MultiLoadArea.dataCounter < 0) {\n *(u32 *)0x04000120 = 0xFEFEFEFE;\n } else if ((s32) gSio32MultiLoadArea.dataCounter <= 0x1FFF) {\n *(u32 *)0x04000120 = gSio32MultiLoadArea.datap[gSio32MultiLoadArea.dataCounter];\n } else {\n *(u32 *)0x04000120 = gSio32MultiLoadArea.checkSum;\n }\n }\n if ((s32) gSio32MultiLoadArea.dataCounter <= 0x2002) {\n gSio32MultiLoadArea.dataCounter += 1;\n if (gSio32MultiLoadArea.type == 1) {\n *(void *)0x04000128 = (u16) (*(void *)0x04000128 | 0x80);\n *(void *)0x0400010E = 0xC0;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":32,"gotos":0,"casts":16,"unkGlue":0,"rawMem":0,"addrDeref":9},"errorMarkers":["agbcc failed: /c.c:409: warning: dereferencing `void *' pointer","/c.c:409: void value not ignored as it ought to be","/c.c:409: invalid use of void expression","/c.c:410: warning: dereferencing `void *' pointer","/c.c:410: invalid use of void expression"]},"gapSize":{"decompiler":"asmlift","score":76,"maxScore":106,"ratio":0.7169811320754716,"kinds":{"insert":17,"delete":16,"replace":12,"opMismatch":5,"argMismatch":26}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sio32MultiLoadIntr` — benchmark function sa3:Sio32MultiLoadIntr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\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-d92540a45b92.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid Sio32MultiLoadIntr(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sio32MultiLoadIntr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sio32MultiLoadIntr` — benchmark function sa3:Sio32MultiLoadIntr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadIntr:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadIntr\n\t.type\t Sio32MultiLoadIntr,function\n\t.thumb_func\nSio32MultiLoadIntr:\n\tpush\t{r4, r5, lr}\n\tldr\tr2, .L19\n\tldr\tr3, [r2]\n\tldr\tr5, .L19+0x4\n\tldrb\tr0, [r5]\n\tadd\tr4, r5, #0\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, .L19+0x8\n\tldrh\tr1, [r0]\n\tmov\tr2, #0x80\n\torr\tr1, r1, r2\n\tstrh\tr1, [r0]\n\tldr\tr2, [r4, #0x8]\n\tcmp\tr2, #0\n\tbge\t.L10\t@cond_branch\n\tb\t.L18\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\t0x4000120\n\t.word\tgSio32MultiLoadArea\n\t.word\t0x4000128\n.L17:\n\tldr\tr1, .L21\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tldr\tr1, [r4, #0x8]\n\tcmp\tr1, #0\n\tbge\t.L5\t@cond_branch\n\tldr\tr0, .L21+0x4\n\tstr\tr0, [r2]\n\tb\t.L9\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\t0x400010e\n\t.word\t-0x1010102\n.L5:\n\tldr\tr0, .L23\n\tcmp\tr1, r0\n\tbgt\t.L7\t@cond_branch\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\t0x1fff\n.L7:\n\tldr\tr0, [r4, #0xc]\n\tstr\tr0, [r2]\n\tb\t.L9\n.L18:\n\tldr\tr0, .L25\n\tcmp\tr3, r0\n\tbeq\t.L9\t@cond_branch\n\tsub\tr0, r2, #0x1\n\tstr\tr0, [r5, #0x8]\n\tb\t.L9\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t-0x1010102\n.L10:\n\tldr\tr0, .L27\n\tcmp\tr2, r0\n\tbgt\t.L13\t@cond_branch\n\tldr\tr1, [r4, #0x4]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r1\n\tstr\tr3, [r0]\n\tb\t.L9\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x1fff\n.L13:\n\tstr\tr3, [r4, #0xc]\n.L9:\n\tldr\tr1, [r4, #0x8]\n\tldr\tr0, .L29\n\tcmp\tr1, r0\n\tbgt\t.L15\t@cond_branch\n\tadd\tr0, r1, #0x1\n\tstr\tr0, [r4, #0x8]\n\tldrb\tr0, [r4]\n\tcmp\tr0, #0x1\n\tbne\t.L15\t@cond_branch\n\tldr\tr2, .L29+0x4\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L29+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n.L15:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x2002\n\t.word\t0x4000128\n\t.word\t0x400010e\n.Lfe1:\n\t.size\t Sio32MultiLoadIntr,.Lfe1-Sio32MultiLoadIntr\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 \"Sio32MultiLoadIntr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sio32MultiLoadIntr # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:Sio32MultiLoadMain:agbcc","sym":"Sio32MultiLoadMain","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","switch","loop","shift","bitwise","mmio","jump-table"],"loc":77,"refSource":"u32 Sio32MultiLoadMain(u32 *progressCounterp)\n{\n s32 dataCounter, dataCounterBak;\n UNUSED s32 i, ii; // declared in SDK\n\n switch (gSio32MultiLoadArea.state) {\n case 0:\n if (gSio32MultiLoadArea.type || gSio32MultiLoadArea.frameCounter) // Slave SIO Mode switch delay wait\n gSio32MultiLoadArea.state = 1;\n break;\n case 1:\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) {\n if (gSio32MultiLoadArea.frameCounter < SIO32ML_MODE_WAIT_FRAMES) // Master wait\n break;\n } else // Slave\n REG_SIOCNT = SIO_32BIT_MODE; // Switches to SIO mode\n REG_SIODATA32 = 0; // Clears data registery\n REG_IF = INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG; // Resets IF\n if (gSio32MultiLoadArea.type == SIO_SCK_IN) { // Sets Master\n REG_SIOCNT |= SIO_ENABLE; // Starts communication\n REG_SIO32ML_TIMER = SIO32ML_TIMER_COUNT | ((TIMER_1CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16); // Starts timer\n REG_IME = 0;\n REG_IE |= SIO32ML_TIMER_INTR_FLAG; // Enables timer interrupt\n REG_IME = 1;\n } else { // Sets Slave\n REG_SIOCNT |= SIO_INTR_ENABLE | SIO_ENABLE; // Starts communication\n REG_IME = 0;\n REG_IE |= INTR_FLAG_SERIAL; // Enables SIO interrupt\n REG_IME = 1;\n }\n gSio32MultiLoadArea.frameCounter = 0;\n gSio32MultiLoadArea.state = 2;\n break;\n case 2:\n dataCounter = gSio32MultiLoadArea.dataCounter;\n dataCounterBak = dataCounter;\n if (dataCounter > SIO32ML_BLOCK_SIZE / 4)\n dataCounter = SIO32ML_BLOCK_SIZE / 4;\n else if (dataCounter < 0)\n dataCounter = 0;\n if (progressCounterp)\n *progressCounterp = dataCounter; // Set progress counter\n if (gSio32MultiLoadArea.type != SIO_SCK_IN) { // Slave\n while (gSio32MultiLoadArea.checkSumCounter < dataCounter) // Receiving data sum check\n gSio32MultiLoadArea.checkSumTmp += ((s32 *)gSio32MultiLoadArea.datap)[gSio32MultiLoadArea.checkSumCounter++];\n if (dataCounterBak > SIO32ML_BLOCK_SIZE / 4)\n if ((gSio32MultiLoadArea.checkSum += gSio32MultiLoadArea.checkSumTmp) == -1)\n gSio32MultiLoadArea.downloadSuccessFlag = 1; // Succeeds download\n }\n if (dataCounterBak > SIO32ML_BLOCK_SIZE / 4 // Complete communication\n || gSio32MultiLoadArea.frameCounter == 0x8C) // SIO32ML_LD_TIMEOUT_FRAMES in SDK doesn't match\n gSio32MultiLoadArea.state = 3; // Load time out\n break;\n case 3:\n REG_IME = 0;\n REG_IE &= ~(INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG); // Disables SIO and timer interrupt\n REG_IME = 1;\n REG_SIOCNT = SIO_32BIT_MODE; // Stops SIO32\n *(vu32 *)REG_ADDR_SIOCNT = SIO_MULTI_MODE; // Switches to SIO mode\n *(vu32 *)REG_ADDR_SIOCNT = SIO_MULTI_MODE | MULTI_SIO_BAUD_RATE_NO;\n *(vu64 *)REG_ADDR_SIODATA32 = 0; // Clears data register\n if (gSio32MultiLoadArea.type) // Master\n REG_SIO32ML_TIMER = 0; // Resets timer\n REG_IF = INTR_FLAG_SERIAL | SIO32ML_TIMER_INTR_FLAG; // Resets IF\n if (!gSio32MultiLoadArea.type)\n return 1; // Slave comes back first\n gSio32MultiLoadArea.frameCounter = 0;\n gSio32MultiLoadArea.state = 4;\n break;\n case 4:\n if (gSio32MultiLoadArea.frameCounter >= 3) // Master comes back later\n return 1;\n break;\n }\n ++gSio32MultiLoadArea.frameCounter;\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sio32_multi_load.c#L15-L91","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Sio32MultiLoadMain' — lift: cannot lift 'Sio32MultiLoadMain': 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\tSio32MultiLoadMain */\n/* \t.type\t Sio32MultiLoadMain,function */\n/* \t.thumb_func */\n/* Sio32MultiLoadMain: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr2, r0, #0 */\n/* \tldr\tr0, .L36 */\n/* \tldrb\tr1, [r0, #0x1] */\n/* \tadd\tr5, r0, #0 */\n/* \tcmp\tr1, #0x4 */\n/* \tbls\t.LCB11 */\n/* \tb\t.L3\t@long jump */\n/* .LCB11: */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L36+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L37: */\n/* \t.align\t2, 0 */\n/* .L36: */\n/* \t.word\tgSio32MultiLoadArea */\n/* \t.word\t.L31 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L31: */\n/* \t.word\t.L4 */\n/* \t.word\t.L6 */\n/* \t.word\t.L12 */\n/* \t.word\t.L26 */\n/* \t.word\t.L29 */\n/* .L4: */\n/* \tldr\tr0, [r5] */\n/* \tldr\tr1, .L38 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB36 */\n/* \tb\t.L3\t@long jump */\n/* .LCB36: */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\t0xff00ff */\n/* .L6: */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0x1 */\n/* \tbne\t.L7\t@cond_branch */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x5 */\n/* \tbhi\t.LCB59 */\n/* \tb\t.L3\t@long jump */\n/* .LCB59: */\n/* \tb\t.L9 */\n/* .L7: */\n/* \tldr\tr1, .L40 */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x5 */\n/* \tadd\tr0, r2, #0 */\n/* \tstrh\tr0, [r1] */\n/* .L9: */\n/* \tldr\tr0, .L40+0x4 */\n/* \tmov\tr6, #0x0 */\n/* \tstr\tr6, [r0] */\n/* \tldr\tr1, .L40+0x8 */\n/* \tmov\tr0, #0xc0 */\n/* \tstrh\tr0, [r1] */\n/* \tldrb\tr4, [r5] */\n/* \tcmp\tr4, #0x1 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tldr\tr2, .L40 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x80 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr1, .L40+0xc */\n/* \tldr\tr0, .L40+0x10 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr3, .L40+0x14 */\n/* \tstrh\tr6, [r3] */\n/* \tadd\tr2, r2, #0xd8 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x40 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tstrh\tr4, [r3] */\n/* \tb\t.L11 */\n/* .L41: */\n/* \t.align\t2, 0 */\n/* .L40: */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000120 */\n/* \t.word\t0x4000202 */\n/* \t.word\t0x400010c */\n/* \t.word\t0xc0f318 */\n/* \t.word\t0x4000208 */\n/* .L10: */\n/* \tldr\tr2, .L42 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr3, #0x81 */\n/* \tlsl\tr3, r3, #0x7 */\n/* \tadd\tr1, r3, #0 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tldr\tr3, .L42+0x4 */\n/* \tstrh\tr6, [r3] */\n/* \tadd\tr2, r2, #0xd8 */\n/* \tldrh\tr0, [r2] */\n/* \tmov\tr1, #0x80 */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tmov\tr0, #0x1 */\n/* \tstrh\tr0, [r3] */\n/* .L11: */\n/* \tmov\tr0, #0x0 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tmov\tr0, #0x2 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L43: */\n/* \t.align\t2, 0 */\n/* .L42: */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000208 */\n/* .L12: */\n/* \tldr\tr6, [r5, #0x8] */\n/* \tadd\tr4, r6, #0 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tble\t.L13\t@cond_branch */\n/* \tadd\tr4, r0, #0 */\n/* \tb\t.L14 */\n/* .L13: */\n/* \tcmp\tr6, #0 */\n/* \tbge\t.L14\t@cond_branch */\n/* \tmov\tr4, #0x0 */\n/* .L14: */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tstr\tr4, [r2] */\n/* .L16: */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0x1 */\n/* \tbeq\t.L17\t@cond_branch */\n/* \tldr\tr0, [r5, #0x14] */\n/* \tcmp\tr0, r4 */\n/* \tbge\t.L19\t@cond_branch */\n/* \tadd\tr3, r5, #0 */\n/* \tldr\tr7, [r5, #0x4] */\n/* .L20: */\n/* \tldr\tr2, [r3, #0x14] */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr0, r0, r7 */\n/* \tldr\tr1, [r3, #0x10] */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr1, r1, r0 */\n/* \tstr\tr1, [r3, #0x10] */\n/* \tadd\tr2, r2, #0x1 */\n/* \tstr\tr2, [r3, #0x14] */\n/* \tcmp\tr2, r4 */\n/* \tblt\t.L20\t@cond_branch */\n/* .L19: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tble\t.L34\t@cond_branch */\n/* \tldr\tr0, [r5, #0xc] */\n/* \tldr\tr1, [r5, #0x10] */\n/* \tadd\tr0, r0, r1 */\n/* \tstr\tr0, [r5, #0xc] */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tcmp\tr0, r1 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tstrb\tr0, [r5, #0x3] */\n/* .L17: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tcmp\tr6, r0 */\n/* \tbgt\t.L25\t@cond_branch */\n/* .L34: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x8c */\n/* \tbne\t.L3\t@cond_branch */\n/* .L25: */\n/* \tmov\tr0, #0x3 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L26: */\n/* \tldr\tr3, .L44 */\n/* \tmov\tr4, #0x0 */\n/* \tstrh\tr4, [r3] */\n/* \tldr\tr2, .L44+0x4 */\n/* \tldrh\tr1, [r2] */\n/* \tldr\tr0, .L44+0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tstrh\tr0, [r2] */\n/* \tmov\tr0, #0x1 */\n/* \tstrh\tr0, [r3] */\n/* \tldr\tr1, .L44+0xc */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x5 */\n/* \tadd\tr0, r2, #0 */\n/* \tstrh\tr0, [r1] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x6 */\n/* \tstr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x3 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr2, .L44+0x10 */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tr1, #0 */\n/* \tstr\tr0, [r2] */\n/* \tstr\tr1, [r2, #0x4] */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L27\t@cond_branch */\n/* \tldr\tr1, .L44+0x14 */\n/* \tmov\tr0, #0x0 */\n/* \tstr\tr0, [r1] */\n/* .L27: */\n/* \tldr\tr0, .L44+0x18 */\n/* \tmov\tr1, #0xc0 */\n/* \tstrh\tr1, [r0] */\n/* \tldrb\tr0, [r5] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L35\t@cond_branch */\n/* \tstrb\tr4, [r5, #0x2] */\n/* \tmov\tr0, #0x4 */\n/* \tstrb\tr0, [r5, #0x1] */\n/* \tb\t.L3 */\n/* .L45: */\n/* \t.align\t2, 0 */\n/* .L44: */\n/* \t.word\t0x4000208 */\n/* \t.word\t0x4000200 */\n/* \t.word\t0xff3f */\n/* \t.word\t0x4000128 */\n/* \t.word\t0x4000120 */\n/* \t.word\t0x400010c */\n/* \t.word\t0x4000202 */\n/* .L29: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tcmp\tr0, #0x2 */\n/* \tbls\t.L3\t@cond_branch */\n/* .L35: */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L33 */\n/* .L3: */\n/* \tldrb\tr0, [r5, #0x2] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r5, #0x2] */\n/* \tmov\tr0, #0x0 */\n/* .L33: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Sio32MultiLoadMain(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'Sio32MultiLoadMain': 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":275,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'Sio32MultiLoadMain': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? gSio32MultiLoadArea;\n\ns32 Sio32MultiLoadMain(s32 *arg0) {\n s32 temp_r0;\n s32 temp_r2;\n s32 var_r4;\n\n switch ((u32) gSio32MultiLoadArea.unk1) { /* irregular */\n case 0:\n if (!(gSio32MultiLoadArea.unk0 & 0xFF00FF)) {\n\n } else {\n gSio32MultiLoadArea.unk1 = 1U;\n }\n default:\nblock_37:\n gSio32MultiLoadArea.unk2 = (u8) (gSio32MultiLoadArea.unk2 + 1);\n return 0;\n case 1:\n if ((u8) gSio32MultiLoadArea.unk0 == 1) {\n if ((u32) gSio32MultiLoadArea.unk2 <= 5U) {\n\n } else {\n goto block_11;\n }\n } else {\n (void *)0x04000128->unk0 = 0x1000U;\nblock_11:\n (void *)0x04000120->unk0 = 0;\n *(s16 *)0x04000202 = 0xC0;\n if ((u8) gSio32MultiLoadArea.unk0 == 1) {\n (void *)0x04000128->unk0 = (u16) ((void *)0x04000128->unk0 | 0x80);\n *(s32 *)0x0400010C = 0xC0F318;\n *(s16 *)0x04000208 = 0;\n (void *)0x04000128->unkD8 = (u16) ((void *)0x04000128->unkD8 | 0x40);\n *(s16 *)0x04000208 = (s16) (u8) gSio32MultiLoadArea.unk0;\n } else {\n (void *)0x04000128->unk0 = (u16) ((void *)0x04000128->unk0 | 0x4080);\n *(void *)0x04000208 = 0;\n (void *)0x04000128->unkD8 = (u16) ((void *)0x04000128->unkD8 | 0x80);\n *(void *)0x04000208 = 1;\n }\n gSio32MultiLoadArea.unk2 = 0U;\n gSio32MultiLoadArea.unk1 = 2U;\n }\n goto block_37;\n case 2:\n var_r4 = gSio32MultiLoadArea.unk8;\n if ((s32) gSio32MultiLoadArea.unk8 > 0x2000) {\n var_r4 = 0x2000;\n } else if ((s32) gSio32MultiLoadArea.unk8 < 0) {\n var_r4 = 0;\n }\n if (arg0 != NULL) {\n *arg0 = var_r4;\n }\n if ((u8) gSio32MultiLoadArea.unk0 != 1) {\n if ((s32) gSio32MultiLoadArea.unk14 < var_r4) {\n do {\n gSio32MultiLoadArea.unk10 = (s32) (gSio32MultiLoadArea.unk10 + *((gSio32MultiLoadArea.unk14 * 4) + gSio32MultiLoadArea.unk4));\n temp_r2 = gSio32MultiLoadArea.unk14 + 1;\n gSio32MultiLoadArea.unk14 = temp_r2;\n } while (temp_r2 < var_r4);\n }\n if ((s32) gSio32MultiLoadArea.unk8 > 0x2000) {\n temp_r0 = gSio32MultiLoadArea.unkC + gSio32MultiLoadArea.unk10;\n gSio32MultiLoadArea.unkC = temp_r0;\n if (temp_r0 == -1) {\n gSio32MultiLoadArea.unk3 = 1;\n }\n goto block_28;\n }\n goto block_29;\n }\nblock_28:\n if ((s32) gSio32MultiLoadArea.unk8 <= 0x2000) {\nblock_29:\n if (gSio32MultiLoadArea.unk2 == 0x8C) {\n goto block_30;\n }\n } else {\nblock_30:\n gSio32MultiLoadArea.unk1 = 3U;\n }\n goto block_37;\n case 3:\n *(void *)0x04000208 = 0;\n *(u16 *)0x04000200 &= 0xFF3F;\n *(void *)0x04000208 = 1;\n (void *)0x04000128->unk0 = 0x1000U;\n (void *)0x04000128->unk0 = 0x2000;\n (void *)0x04000128->unk0 = 0x2003;\n (void *)0x04000120->unk0 = 0;\n (void *)0x04000120->unk4 = 0;\n if ((u8) gSio32MultiLoadArea.unk0 != 0) {\n *(void *)0x0400010C = 0;\n }\n *(void *)0x04000202 = 0xC0;\n if ((u8) gSio32MultiLoadArea.unk0 != 0) {\n gSio32MultiLoadArea.unk2 = 0U;\n gSio32MultiLoadArea.unk1 = 4U;\n goto block_37;\n }\nblock_36:\n return 1;\n case 4:\n if ((u32) gSio32MultiLoadArea.unk2 > 2U) {\n goto block_36;\n }\n goto block_37;\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":52,"lines":108,"gotos":9,"casts":44,"unkGlue":0,"rawMem":0,"addrDeref":11},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sio32MultiLoadMain` — benchmark function sa3:Sio32MultiLoadMain:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sio32MultiLoadMain # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sio32MultiLoadMain` — benchmark function sa3:Sio32MultiLoadMain:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:Sio32MultiLoadMain:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSio32MultiLoadMain\n\t.type\t Sio32MultiLoadMain,function\n\t.thumb_func\nSio32MultiLoadMain:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r0, #0\n\tldr\tr0, .L36\n\tldrb\tr1, [r0, #0x1]\n\tadd\tr5, r0, #0\n\tcmp\tr1, #0x4\n\tbls\t.LCB11\n\tb\t.L3\t@long jump\n.LCB11:\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L36+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgSio32MultiLoadArea\n\t.word\t.L31\n\t.align\t2, 0\n\t.align\t2, 0\n.L31:\n\t.word\t.L4\n\t.word\t.L6\n\t.word\t.L12\n\t.word\t.L26\n\t.word\t.L29\n.L4:\n\tldr\tr0, [r5]\n\tldr\tr1, .L38\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB36\n\tb\t.L3\t@long jump\n.LCB36:\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0xff00ff\n.L6:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbne\t.L7\t@cond_branch\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x5\n\tbhi\t.LCB59\n\tb\t.L3\t@long jump\n.LCB59:\n\tb\t.L9\n.L7:\n\tldr\tr1, .L40\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n.L9:\n\tldr\tr0, .L40+0x4\n\tmov\tr6, #0x0\n\tstr\tr6, [r0]\n\tldr\tr1, .L40+0x8\n\tmov\tr0, #0xc0\n\tstrh\tr0, [r1]\n\tldrb\tr4, [r5]\n\tcmp\tr4, #0x1\n\tbne\t.L10\t@cond_branch\n\tldr\tr2, .L40\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr1, .L40+0xc\n\tldr\tr0, .L40+0x10\n\tstr\tr0, [r1]\n\tldr\tr3, .L40+0x14\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x40\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tstrh\tr4, [r3]\n\tb\t.L11\n.L41:\n\t.align\t2, 0\n.L40:\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x4000202\n\t.word\t0x400010c\n\t.word\t0xc0f318\n\t.word\t0x4000208\n.L10:\n\tldr\tr2, .L42\n\tldrh\tr0, [r2]\n\tmov\tr3, #0x81\n\tlsl\tr3, r3, #0x7\n\tadd\tr1, r3, #0\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tldr\tr3, .L42+0x4\n\tstrh\tr6, [r3]\n\tadd\tr2, r2, #0xd8\n\tldrh\tr0, [r2]\n\tmov\tr1, #0x80\n\torr\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n.L11:\n\tmov\tr0, #0x0\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x2\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L43:\n\t.align\t2, 0\n.L42:\n\t.word\t0x4000128\n\t.word\t0x4000208\n.L12:\n\tldr\tr6, [r5, #0x8]\n\tadd\tr4, r6, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L13\t@cond_branch\n\tadd\tr4, r0, #0\n\tb\t.L14\n.L13:\n\tcmp\tr6, #0\n\tbge\t.L14\t@cond_branch\n\tmov\tr4, #0x0\n.L14:\n\tcmp\tr2, #0\n\tbeq\t.L16\t@cond_branch\n\tstr\tr4, [r2]\n.L16:\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0x1\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r5, #0x14]\n\tcmp\tr0, r4\n\tbge\t.L19\t@cond_branch\n\tadd\tr3, r5, #0\n\tldr\tr7, [r5, #0x4]\n.L20:\n\tldr\tr2, [r3, #0x14]\n\tlsl\tr0, r2, #0x2\n\tadd\tr0, r0, r7\n\tldr\tr1, [r3, #0x10]\n\tldr\tr0, [r0]\n\tadd\tr1, r1, r0\n\tstr\tr1, [r3, #0x10]\n\tadd\tr2, r2, #0x1\n\tstr\tr2, [r3, #0x14]\n\tcmp\tr2, r4\n\tblt\t.L20\t@cond_branch\n.L19:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tble\t.L34\t@cond_branch\n\tldr\tr0, [r5, #0xc]\n\tldr\tr1, [r5, #0x10]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r5, #0xc]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0x1\n\tstrb\tr0, [r5, #0x3]\n.L17:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tcmp\tr6, r0\n\tbgt\t.L25\t@cond_branch\n.L34:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x8c\n\tbne\t.L3\t@cond_branch\n.L25:\n\tmov\tr0, #0x3\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L26:\n\tldr\tr3, .L44\n\tmov\tr4, #0x0\n\tstrh\tr4, [r3]\n\tldr\tr2, .L44+0x4\n\tldrh\tr1, [r2]\n\tldr\tr0, .L44+0x8\n\tand\tr0, r0, r1\n\tstrh\tr0, [r2]\n\tmov\tr0, #0x1\n\tstrh\tr0, [r3]\n\tldr\tr1, .L44+0xc\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r2, #0\n\tstrh\tr0, [r1]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x6\n\tstr\tr0, [r1]\n\tadd\tr0, r0, #0x3\n\tstr\tr0, [r1]\n\tldr\tr2, .L44+0x10\n\tmov\tr0, #0x0\n\tmov\tr1, #0\n\tstr\tr0, [r2]\n\tstr\tr1, [r2, #0x4]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L27\t@cond_branch\n\tldr\tr1, .L44+0x14\n\tmov\tr0, #0x0\n\tstr\tr0, [r1]\n.L27:\n\tldr\tr0, .L44+0x18\n\tmov\tr1, #0xc0\n\tstrh\tr1, [r0]\n\tldrb\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L35\t@cond_branch\n\tstrb\tr4, [r5, #0x2]\n\tmov\tr0, #0x4\n\tstrb\tr0, [r5, #0x1]\n\tb\t.L3\n.L45:\n\t.align\t2, 0\n.L44:\n\t.word\t0x4000208\n\t.word\t0x4000200\n\t.word\t0xff3f\n\t.word\t0x4000128\n\t.word\t0x4000120\n\t.word\t0x400010c\n\t.word\t0x4000202\n.L29:\n\tldrb\tr0, [r5, #0x2]\n\tcmp\tr0, #0x2\n\tbls\t.L3\t@cond_branch\n.L35:\n\tmov\tr0, #0x1\n\tb\t.L33\n.L3:\n\tldrb\tr0, [r5, #0x2]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r5, #0x2]\n\tmov\tr0, #0x0\n.L33:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sio32MultiLoadMain,.Lfe1-Sio32MultiLoadMain\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sio32MultiLoadMain # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_802DFC8:agbcc","sym":"sub_802DFC8","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","ternary","bitwise","call"],"loc":65,"refSource":"void sub_802DFC8(s16 direction, Sprite *s)\n{\n s32 mask = 0;\n s32 variant;\n\n if (direction & 0x8) {\n variant = 6;\n\n mask = (direction & 1) ? SPRITE_FLAG(X_FLIP, 1) : 0;\n } else if (direction & 0x4) {\n variant = 4;\n\n if (direction & 0x2) {\n mask = SPRITE_FLAG(X_FLIP, 1);\n }\n\n if (direction & 0x1) {\n mask |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } else if (direction & 0x2) {\n variant = 2;\n\n if (direction & 0x1) {\n mask = SPRITE_FLAG(X_FLIP, 1);\n }\n } else {\n variant = 0;\n\n if (direction & 0x1) {\n mask = SPRITE_FLAG(Y_FLIP, 1);\n }\n }\n\n if (gStageData.gameMode != GAME_MODE_MP_SINGLE_PACK) {\n if ((gStageData.act >= ACT_1) && (gStageData.act <= ACT_BONUS_CAPSULE)) {\n if (gStageData.zone == ZONE_6) {\n s->tiles = ALLOC_TILES(ANIM_SPRING_6);\n s->anim = ANIM_SPRING_6;\n } else if (gStageData.zone == ZONE_4) {\n s->tiles = ALLOC_TILES(ANIM_SPRING_4);\n s->anim = ANIM_SPRING_4;\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n }\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n }\n } else {\n s->tiles = ALLOC_TILES(ANIM_SPRING);\n s->anim = ANIM_SPRING;\n mask |= SPRITE_FLAG_MASK_MOSAIC;\n }\n\n s->variant = variant;\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = Q(0);\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = HITBOX_STATE_INACTIVE;\n s->frameFlags = mask | SPRITE_FLAG(PRIORITY, 1);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/spring.c#L174-L238","targetAsm":"@ Generated by gcc 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_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-0735218e8a5b.i.gz","proto":{"sub_802DFC8":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sub_802DFC8' — lift: cannot lift 'sub_802DFC8': branch target '.L19' 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\tsub_802DFC8 */\n/* \t.type\t sub_802DFC8,function */\n/* \t.thumb_func */\n/* sub_802DFC8: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tr4, r1, #0 */\n/* \tmov\tr5, #0x0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tmov\tr0, #0x8 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tmov\tr6, #0x6 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tneg\tr1, r0 */\n/* \torr\tr1, r1, r0 */\n/* \tasr\tr5, r1, #0x1f */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tand\tr5, r5, r0 */\n/* \tb\t.L6 */\n/* .L3: */\n/* \tmov\tr0, #0x4 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L7\t@cond_branch */\n/* \tmov\tr6, #0x4 */\n/* \tmov\tr0, #0x2 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L8\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* .L8: */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \torr\tr5, r5, r0 */\n/* \tb\t.L6 */\n/* .L7: */\n/* \tmov\tr0, #0x2 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L11\t@cond_branch */\n/* \tmov\tr6, #0x2 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tb\t.L6 */\n/* .L11: */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L6\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x4 */\n/* .L6: */\n/* \tldr\tr1, .L23 */\n/* \tldrb\tr0, [r1, #0x3] */\n/* \tcmp\tr0, #0x7 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tldrb\tr0, [r1, #0xa] */\n/* \tsub\tr0, r0, #0x3 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x5 */\n/* \tbhi\t.L16\t@cond_branch */\n/* \tldrb\tr0, [r1, #0x9] */\n/* \tcmp\tr0, #0x5 */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, #0xf */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tmov\tr0, #0xea */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L24: */\n/* \t.align\t2, 0 */\n/* .L23: */\n/* \t.word\tgStageData */\n/* .L17: */\n/* \tcmp\tr0, #0x3 */\n/* \tbne\t.L19\t@cond_branch */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L25 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L26: */\n/* \t.align\t2, 0 */\n/* .L25: */\n/* \t.word\t0x3db */\n/* .L19: */\n/* .L16: */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L27 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tb\t.L22 */\n/* .L28: */\n/* \t.align\t2, 0 */\n/* .L27: */\n/* \t.word\t0x362 */\n/* .L15: */\n/* \tmov\tr0, #0x14 */\n/* \tbl\tVramMalloc */\n/* \tstr\tr0, [r4] */\n/* \tldr\tr0, .L29 */\n/* \tstrh\tr0, [r4, #0xc] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \torr\tr5, r5, r0 */\n/* .L22: */\n/* \tmov\tr1, #0x0 */\n/* \tstrb\tr6, [r4, #0x1a] */\n/* \tmov\tr2, #0x0 */\n/* \tmov\tr0, #0xc0 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tstrh\tr0, [r4, #0x14] */\n/* \tstrh\tr1, [r4, #0xe] */\n/* \tstrh\tr1, [r4, #0x16] */\n/* \tmov\tr0, #0xff */\n/* \tstrb\tr0, [r4, #0x1b] */\n/* \tmov\tr0, #0x10 */\n/* \tstrb\tr0, [r4, #0x1c] */\n/* \tstrb\tr2, [r4, #0x1f] */\n/* \tsub\tr0, r0, #0x11 */\n/* \tstr\tr0, [r4, #0x20] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x5 */\n/* \torr\tr5, r5, r0 */\n/* \tstr\tr5, [r4, #0x8] */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L30: */\n/* \t.align\t2, 0 */\n/* .L29: */\n/* \t.word\t0x362 */\n/* .Lfe1: */\n/* \t.size\t sub_802DFC8,.Lfe1-sub_802DFC8 */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sub_802DFC8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sub_802DFC8': branch target '.L19' 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":166,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sub_802DFC8': branch target '.L19' is not a code block in this function (a data label, or outside the sliced function)"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sub_802DFC8(s16 direction, Sprite *s) {\n s16 temp_r1;\n s32 temp_r0;\n s32 var_r5;\n u8 var_r6;\n\n var_r5 = 0;\n temp_r1 = direction;\n if (8 & temp_r1) {\n var_r6 = 6;\n temp_r0 = 1 & temp_r1;\n var_r5 = ((s32) ((0 - temp_r0) | temp_r0) >> 0x1F) & 0x400;\n } else if (4 & temp_r1) {\n var_r6 = 4;\n if (2 & temp_r1) {\n var_r5 = 0x400;\n }\n if (1 & temp_r1) {\n var_r5 |= 0x800;\n }\n } else if (2 & temp_r1) {\n var_r6 = 2;\n if (1 & temp_r1) {\n var_r5 = 0x400;\n }\n } else {\n var_r6 = 0;\n if (1 & temp_r1) {\n var_r5 = 0x800;\n }\n }\n if (gStageData.gameMode != 7) {\n if ((u32) (u8) (gStageData.act - 3) <= 5U) {\n if (gStageData.zone == 5) {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x3A8;\n } else if (gStageData.zone == 3) {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x3DB;\n } else {\n goto block_18;\n }\n } else {\nblock_18:\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x362;\n }\n } else {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x362;\n var_r5 |= 0x200;\n }\n s->variant = var_r6;\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n}\n","score":0,"maxScore":128,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":86,"lines":61,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_802DFC8` — benchmark function sa3:sub_802DFC8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-0735218e8a5b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_802DFC8(s16 direction, Sprite *s);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_802DFC8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_802DFC8` — benchmark function sa3:sub_802DFC8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_802DFC8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_802DFC8\n\t.type\t sub_802DFC8,function\n\t.thumb_func\nsub_802DFC8:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r1, #0\n\tmov\tr5, #0x0\n\tlsl\tr0, r0, #0x10\n\tasr\tr1, r0, #0x10\n\tmov\tr0, #0x8\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tmov\tr6, #0x6\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tneg\tr1, r0\n\torr\tr1, r1, r0\n\tasr\tr5, r1, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tb\t.L6\n.L3:\n\tmov\tr0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tmov\tr6, #0x4\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L8\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L8:\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L6\n.L7:\n\tmov\tr0, #0x2\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tmov\tr6, #0x2\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tb\t.L6\n.L11:\n\tmov\tr6, #0x0\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n.L6:\n\tldr\tr1, .L23\n\tldrb\tr0, [r1, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L15\t@cond_branch\n\tldrb\tr0, [r1, #0xa]\n\tsub\tr0, r0, #0x3\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tcmp\tr0, #0x5\n\tbhi\t.L16\t@cond_branch\n\tldrb\tr0, [r1, #0x9]\n\tcmp\tr0, #0x5\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr0, #0xea\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L24:\n\t.align\t2, 0\n.L23:\n\t.word\tgStageData\n.L17:\n\tcmp\tr0, #0x3\n\tbne\t.L19\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L25\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L26:\n\t.align\t2, 0\n.L25:\n\t.word\t0x3db\n.L19:\n.L16:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L27\n\tstrh\tr0, [r4, #0xc]\n\tb\t.L22\n.L28:\n\t.align\t2, 0\n.L27:\n\t.word\t0x362\n.L15:\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L29\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L22:\n\tmov\tr1, #0x0\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr2, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L30:\n\t.align\t2, 0\n.L29:\n\t.word\t0x362\n.Lfe1:\n\t.size\t sub_802DFC8,.Lfe1-sub_802DFC8\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_802DFC8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_802DFC8 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_803213C:agbcc","sym":"sub_803213C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","ternary","bitwise","call"],"loc":30,"refSource":"void sub_803213C(u8 unk38, u8 unk39, Sprite *s)\n{\n u32 mask = (unk39 & 0x1) ? SPRITE_FLAG(X_FLIP, 1) : 0;\n\n if (gStageData.gameMode != GAME_MODE_MP_SINGLE_PACK) {\n if (unk38 != 0) {\n s->tiles = ALLOC_TILES(ANIM_RAMP);\n s->anim = ANIM_RAMP;\n s->variant = 0;\n } else {\n s->tiles = ALLOC_TILES_VARIANT(ANIM_RAMP, 1);\n s->anim = ANIM_RAMP;\n s->variant = 1;\n }\n } else {\n s->tiles = ALLOC_TILES_VARIANT(ANIM_RAMP, 1);\n s->anim = ANIM_RAMP;\n s->variant = 1;\n mask |= SPRITE_FLAG(MOSAIC, 1);\n }\n\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = Q(0);\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = HITBOX_STATE_INACTIVE;\n s->frameFlags = SPRITE_FLAG(PRIORITY, 1) | mask;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/ramp.c#L340-L369","targetAsm":"@ Generated by gcc 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_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-c4f423915ef9.i.gz","proto":{"sub_803213C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Struct0 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u8 _pad1[4]; u16 field_20; u16 field_22; u8 _pad2[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad3[2]; u8 field_31; s32 field_32; };\nvoid sub_803213C(s32 a0, s32 a1, struct Struct0 * a2) {\n s32 v0;\n s32 v1;\n v0 = 1;\n if (((u8 *)&gStageData)[3] == 7) {\n a2->field_0 = VramMalloc(15, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = v0;\n v1 = (-((u8)a1 & v0) | (u8)a1 & v0) >> 31 & 128 << 3 | 128 << 2;\n } else {\n if ((u8)a0 == 0) {\n a2->field_0 = VramMalloc(15, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = v0;\n } else {\n a2->field_0 = VramMalloc(20, (u8)a1 & v0, (u8)a0);\n a2->field_12 = 870;\n a2->field_26 = 0;\n }\n v1 = (-((u8)a1 & v0) | (u8)a1 & v0) >> 31 & 128 << 3;\n }\n a2->field_20 = 192 << 3;\n a2->field_14 = 0;\n a2->field_22 = 0;\n a2->field_27 = 255;\n a2->field_28 = 16;\n a2->field_31 = 0;\n a2->field_32 = 16 - 17;\n a2->field_8 = v1 | 128 << 5;\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":32,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'sub_803213C': agbcc failed: /c.c:2338: too many arguments to function `VramMalloc'"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sub_803213C(u8 unk38, u8 unk39, Sprite *s) {\n s32 temp_r1;\n s32 var_r5;\n\n temp_r1 = unk39 & 1;\n var_r5 = ((s32) ((0 - temp_r1) | temp_r1) >> 0x1F) & 0x400;\n if (gStageData.gameMode != 7) {\n if (unk38 != 0) {\n s->tiles = VramMalloc(0x14U);\n s->anim = 0x366;\n s->variant = 0;\n } else {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x366;\n s->variant = 1;\n }\n } else {\n s->tiles = VramMalloc(0xFU);\n s->anim = 0x366;\n s->variant = 1;\n var_r5 |= 0x200;\n }\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n}\n","score":0,"maxScore":71,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":30,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_803213C` — benchmark function sa3:sub_803213C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-c4f423915ef9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_803213C(u8 unk38, u8 unk39, Sprite *s);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_803213C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_803213C` — benchmark function sa3:sub_803213C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_803213C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_803213C\n\t.type\t sub_803213C,function\n\t.thumb_func\nsub_803213C:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tmov\tr6, #0x1\n\tand\tr1, r1, r6\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tasr\tr5, r0, #0x1f\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr5, r5, r0\n\tldr\tr0, .L9\n\tldrb\tr0, [r0, #0x3]\n\tcmp\tr0, #0x7\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr2, #0\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0x14\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr1, #0x0\n\tldr\tr0, .L9+0x4\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr1, [r4, #0x1a]\n\tb\t.L8\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgStageData\n\t.word\t0x366\n.L6:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L11\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tb\t.L8\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\t0x366\n.L5:\n\tmov\tr0, #0xf\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tldr\tr0, .L13\n\tstrh\tr0, [r4, #0xc]\n\tstrb\tr6, [r4, #0x1a]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x2\n\torr\tr5, r5, r0\n.L8:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L14:\n\t.align\t2, 0\n.L13:\n\t.word\t0x366\n.Lfe1:\n\t.size\t sub_803213C,.Lfe1-sub_803213C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_803213C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_803213C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_804D360:agbcc","sym":"sub_804D360","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","branch","switch","bitwise","call","comparison-tree"],"loc":47,"refSource":"void sub_804D360(Sprite *s, s16 i, s16 param2)\n{\n u32 flags = 0;\n\n switch (i) {\n case 0: {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n if (param2 == 2) {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } break;\n\n case 1: {\n if (param2 == 2) {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n }\n } break;\n\n case 2: {\n flags |= SPRITE_FLAG(Y_FLIP, 1);\n\n if (param2 == 0) {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n }\n } break;\n\n case 3: {\n if (param2 == 0) {\n flags |= SPRITE_FLAG(X_FLIP, 1);\n }\n } break;\n }\n\n s->tiles = ALLOC_TILES_VARIANT(ANIM_MAZE, 6);\n s->anim = ANIM_MAZE;\n s->variant = 6;\n s->oamFlags = SPRITE_OAM_ORDER(24);\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->qAnimDelay = 0;\n s->prevVariant = -1;\n s->animSpeed = SPRITE_ANIM_SPEED(1.0);\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = flags | SPRITE_FLAG(PRIORITY, 1);\n UpdateSpriteAnimation(s);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/maze.c#L344-L390","targetAsm":"@ Generated by gcc 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_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-753afb45dfc7.i.gz","proto":{"sub_804D360":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/defsite","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u8 _pad1[4]; u16 field_20; u16 field_22; u8 _pad2[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad3[2]; u8 field_31; s32 field_32; };\nvoid sub_804D360(struct Struct0 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = 0;\n if ((s16)a1 == 1) {\n if ((u16)a2 == 2) v0 = 128 << 4;\n } else {\n if ((s16)a1 > 1) {\n switch ((s16)a1) {\n case 2:\n if ((u16)a2 != 0) {\n v0 = 128 << 4;\n } else {\n v0 = 128 << 4 | 128 << 3;\n }\n break;\n case 3:\n if ((u16)a2 == 0) v0 = 128 << 3;\n break;\n default:\n }\n } else {\n if ((s16)a1 == 0) {\n if ((u16)a2 != 2) {\n v0 = 128 << 3;\n } else {\n v0 = 128 << 3 | 128 << 4;\n }\n }\n }\n }\n a0->field_0 = VramMalloc(9, (s16)a1, (u16)a2);\n a0->field_12 = 235 << 2;\n a0->field_26 = 6;\n a0->field_20 = 192 << 3;\n a0->field_14 = 0;\n a0->field_22 = 0;\n a0->field_27 = 255;\n a0->field_28 = 16;\n a0->field_31 = 0;\n a0->field_32 = 16 - 17;\n a0->field_8 = v0 | 128 << 5;\n UpdateSpriteAnimation(a0, 0, 0);\n return;\n}\n","score":56,"maxScore":91,"compileErrors":null,"breakdown":{"insert":16,"delete":8,"replace":2,"opMismatch":6,"argMismatch":24},"quality":{"score":84,"lines":45,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sub_804D360(Sprite *s, s16 i, s16 param2) {\n s16 temp_r1;\n s32 var_r5;\n u16 temp_r2;\n\n temp_r2 = (u16) param2;\n var_r5 = 0;\n temp_r1 = i;\n switch (temp_r1) { /* irregular */\n case 0:\n var_r5 = 0x400;\n if (temp_r2 == 2) {\n var_r5 = 0x400 | 0x800;\n }\n break;\n case 1:\n if (temp_r2 == 2) {\n var_r5 = 0x800;\n }\n break;\n case 2:\n var_r5 = 0x800;\n if (temp_r2 == 0) {\n var_r5 = 0x800 | 0x400;\n }\n break;\n case 3:\n if (temp_r2 == 0) {\n var_r5 = 0x400;\n }\n break;\n }\n s->tiles = VramMalloc(9U);\n s->anim = 0x3AC;\n s->variant = 6;\n s->oamFlags = 0x600;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->prevVariant = 0xFF;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->hitboxes[0].index = -1;\n s->frameFlags = var_r5 | 0x1000;\n UpdateSpriteAnimation(s);\n}\n","score":6,"maxScore":75,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":44,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":75,"ratio":0.08,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_804D360` — benchmark function sa3:sub_804D360:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-753afb45dfc7.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_804D360(Sprite *s, s16 i, s16 param2);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_804D360 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_804D360` — benchmark function sa3:sub_804D360:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_804D360:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_804D360\n\t.type\t sub_804D360,function\n\t.thumb_func\nsub_804D360:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x10\n\tlsr\tr2, r2, #0x10\n\tmov\tr5, #0x0\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0x1\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbgt\t.L14\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L3\n.L14:\n\tcmp\tr1, #0x2\n\tbeq\t.L8\t@cond_branch\n\tcmp\tr1, #0x3\n\tbeq\t.L10\t@cond_branch\n\tb\t.L3\n.L4:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\torr\tr5, r5, r0\n\tb\t.L3\n.L6:\n\tcmp\tr2, #0x2\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tb\t.L3\n.L8:\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x4\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\torr\tr5, r5, r0\n\tb\t.L3\n.L10:\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n.L3:\n\tmov\tr0, #0x9\n\tbl\tVramMalloc\n\tstr\tr0, [r4]\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr0, #0xeb\n\tlsl\tr0, r0, #0x2\n\tstrh\tr0, [r4, #0xc]\n\tmov\tr0, #0x6\n\tstrb\tr0, [r4, #0x1a]\n\tmov\tr0, #0xc0\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r4, #0x14]\n\tstrh\tr1, [r4, #0xe]\n\tstrh\tr1, [r4, #0x16]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r4, #0x1b]\n\tmov\tr0, #0x10\n\tstrb\tr0, [r4, #0x1c]\n\tstrb\tr2, [r4, #0x1f]\n\tsub\tr0, r0, #0x11\n\tstr\tr0, [r4, #0x20]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\torr\tr5, r5, r0\n\tstr\tr5, [r4, #0x8]\n\tadd\tr0, r4, #0\n\tbl\tUpdateSpriteAnimation\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sub_804D360,.Lfe1-sub_804D360\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_804D360\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_804D360 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_804DC38:agbcc","sym":"sub_804DC38","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","switch","loop","shift","bitwise","soft-div","call","comparison-tree"],"loc":92,"refSource":"u16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me)\n{\n s32 r0;\n s32 r1;\n s32 r2_32;\n s16 r2;\n bool32 r6;\n u16 i;\n\n // TODO(Jace): This was likely not written this way, and might actually be a bug?\n // I don't think MapEntity structs are always aligned in memory.\n u32 data = *((u32 *)&me->d.uData[1]);\n if (data & 0x00FFFF00) {\n if (me->d.uData[3] < me->d.uData[2]) {\n r2_32 = (me->d.uData[2] * (TILE_WIDTH / 2));\n r1 = worldX;\n r0 = worldX + (me->d.sData[0] * TILE_WIDTH);\n r6 = FALSE;\n } else {\n r2_32 = (me->d.uData[3] * (TILE_WIDTH / 2));\n r1 = worldY;\n r0 = worldY + (me->d.sData[1] * TILE_WIDTH);\n r6 = TRUE;\n }\n\n r2 = ((r1 - (r0 + r2_32)) << 14) / r2_32;\n if (r2 >= 0) {\n for (i = 0; (i < Q(1)) && (r2 > SIN(i));) {\n i += 4;\n }\n\n switch (kind) {\n case 0: {\n return Q(2) - i;\n } break;\n\n case 1: {\n if (r6) {\n return i;\n } else {\n return Q(2) - i;\n }\n } break;\n\n case 2: {\n if (!r6) {\n return i;\n } else {\n return Q(2) - i;\n }\n } break;\n\n default: {\n return i;\n }\n }\n\n } else {\n for (i = Q(2); (i < Q(3)) && (r2 < SIN(i));) {\n i += 4;\n }\n\n switch (kind) {\n case 0: {\n return i;\n } break;\n\n case 1: {\n if (!r6) {\n return i;\n } else {\n return Q(6) - i;\n }\n } break;\n\n case 2: {\n if (r6) {\n return i;\n } else {\n return Q(6) - i;\n }\n } break;\n\n case 3: {\n return Q(6) - i;\n } break;\n }\n }\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/interactables/platform_shared.c#L8-L99","targetAsm":"@ Generated by gcc 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_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-dde16f46c6da.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sub_804DC38' — raise: cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — 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\tsub_804DC38 */\n/* \t.type\t sub_804DC38,function */\n/* \t.thumb_func */\n/* sub_804DC38: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr6, r1, #0 */\n/* \tadd\tr5, r2, #0 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr4, r0, #0x18 */\n/* \tldr\tr0, [r3, #0x4] */\n/* \tldr\tr1, .L47 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB16 */\n/* \tb\t.L3\t@long jump */\n/* .LCB16: */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tldrb\tr1, [r3, #0x5] */\n/* \tcmp\tr0, r1 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldrb\tr0, [r3, #0x5] */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr1, r6, #0 */\n/* \tmov\tr0, #0x3 */\n/* \tldrsb\tr0, [r3, r0] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r1, r0 */\n/* \tmov\tr6, #0x0 */\n/* \tb\t.L5 */\n/* .L48: */\n/* \t.align\t2, 0 */\n/* .L47: */\n/* \t.word\t0xffff00 */\n/* .L4: */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tlsl\tr2, r0, #0x2 */\n/* \tadd\tr1, r5, #0 */\n/* \tmov\tr0, #0x4 */\n/* \tldrsb\tr0, [r3, r0] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r1, r0 */\n/* \tmov\tr6, #0x1 */\n/* .L5: */\n/* \tadd\tr0, r0, r2 */\n/* \tsub\tr0, r1, r0 */\n/* \tlsl\tr0, r0, #0xe */\n/* \tadd\tr1, r2, #0 */\n/* \tbl\t__divsi3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tcmp\tr2, #0 */\n/* \tblt\t.L6\t@cond_branch */\n/* \tmov\tr1, #0x0 */\n/* \tldr\tr3, .L49 */\n/* \tmov\tr5, #0x0 */\n/* \tldrsh\tr0, [r3, r5] */\n/* \tcmp\tr2, r0 */\n/* \tble\t.L8\t@cond_branch */\n/* .L10: */\n/* \tadd\tr0, r1, #0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr1, r0, #0x10 */\n/* \tcmp\tr1, #0xff */\n/* \tbhi\t.L8\t@cond_branch */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tbgt\t.L10\t@cond_branch */\n/* .L8: */\n/* \tcmp\tr4, #0x1 */\n/* \tbeq\t.L15\t@cond_branch */\n/* \tcmp\tr4, #0x1 */\n/* \tbgt\t.L23\t@cond_branch */\n/* \tcmp\tr4, #0 */\n/* \tbeq\t.L14\t@cond_branch */\n/* \tb\t.L45 */\n/* .L50: */\n/* \t.align\t2, 0 */\n/* .L49: */\n/* \t.word\tgSineTable */\n/* .L23: */\n/* \tcmp\tr4, #0x2 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tb\t.L45 */\n/* .L14: */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr0, r2, #0 */\n/* \tb\t.L44 */\n/* .L15: */\n/* \tcmp\tr6, #0 */\n/* \tbne\t.L45\t@cond_branch */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x2 */\n/* \tadd\tr0, r5, #0 */\n/* \tb\t.L44 */\n/* .L18: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tmov\tr7, #0x80 */\n/* \tlsl\tr7, r7, #0x2 */\n/* \tb\t.L46 */\n/* .L6: */\n/* \tldr\tr3, .L51 */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tmov\tr5, #0x80 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tadd\tr0, r3, r5 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tbge\t.L26\t@cond_branch */\n/* \tldr\tr5, .L51+0x4 */\n/* .L28: */\n/* \tadd\tr0, r1, #0x4 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr1, r0, #0x10 */\n/* \tcmp\tr1, r5 */\n/* \tbhi\t.L26\t@cond_branch */\n/* \tlsl\tr0, r1, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr7, #0x0 */\n/* \tldrsh\tr0, [r0, r7] */\n/* \tcmp\tr2, r0 */\n/* \tblt\t.L28\t@cond_branch */\n/* .L26: */\n/* \tcmp\tr4, #0x1 */\n/* \tbeq\t.L33\t@cond_branch */\n/* \tcmp\tr4, #0x1 */\n/* \tbgt\t.L42\t@cond_branch */\n/* \tcmp\tr4, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tb\t.L3 */\n/* .L52: */\n/* \t.align\t2, 0 */\n/* .L51: */\n/* \t.word\tgSineTable */\n/* \t.word\t0x2ff */\n/* .L42: */\n/* \tcmp\tr4, #0x2 */\n/* \tbeq\t.L36\t@cond_branch */\n/* \tcmp\tr4, #0x3 */\n/* \tbeq\t.L39\t@cond_branch */\n/* \tb\t.L3 */\n/* .L33: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L45\t@cond_branch */\n/* \tmov\tr2, #0xc0 */\n/* \tlsl\tr2, r2, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tb\t.L44 */\n/* .L36: */\n/* \tcmp\tr6, #0 */\n/* \tbeq\t.L37\t@cond_branch */\n/* .L45: */\n/* \tadd\tr0, r1, #0 */\n/* \tb\t.L43 */\n/* .L37: */\n/* \tmov\tr5, #0xc0 */\n/* \tlsl\tr5, r5, #0x3 */\n/* \tadd\tr0, r5, #0 */\n/* \tb\t.L44 */\n/* .L39: */\n/* \tmov\tr7, #0xc0 */\n/* \tlsl\tr7, r7, #0x3 */\n/* .L46: */\n/* \tadd\tr0, r7, #0 */\n/* .L44: */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tb\t.L43 */\n/* .L3: */\n/* \tmov\tr0, #0x0 */\n/* .L43: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sub_804DC38,.Lfe1-sub_804DC38 */\n/* \t.comm\tgUnknown_03001150, 1136\t@ 1136 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sub_804DC38(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":196,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': field at offset 5 overlaps the prior field (aligned to 8) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"typedef struct MapEntity {\n /* 0x0 */ u8 x;\n /* 0x1 */ u8 y;\n /* 0x2 */ u8 index;\n /* 0x3 */ ? unk3; /* inferred */\n /* 0x3 */ char pad3[1];\n /* 0x4 */ union _anonymous d;\n} MapEntity; /* size = 0xC */\n\nu16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me) {\n s16 temp_r2;\n s32 var_r0;\n s32 var_r0_2;\n s32 var_r1_2;\n s32 var_r2;\n s32 var_r6;\n s32 var_r7;\n u16 var_r1;\n u8 temp_r4;\n\n temp_r4 = kind;\n if (!(me->unk4 & 0xFFFF00)) {\n return 0U;\n }\n if ((u32) (u8) me->d.sData[2] < (u32) (u8) me->d.sData[1]) {\n var_r2 = (u8) me->d.sData[1] * 4;\n var_r1_2 = worldX;\n var_r0_2 = var_r1_2 + (me->unk3 * 8);\n var_r6 = 0;\n } else {\n var_r2 = (u8) me->d.sData[2] * 4;\n var_r1_2 = worldY;\n var_r0_2 = var_r1_2 + (me->d.sData[0] * 8);\n var_r6 = 1;\n }\n temp_r2 = (s16) ((s32) ((var_r1_2 - (var_r0_2 + var_r2)) << 0xE) / var_r2);\n if ((s32) temp_r2 >= 0) {\n var_r1 = 0;\n if ((s32) temp_r2 > (s32) gSineTable->unk0) {\nloop_7:\n var_r1 += 4;\n if ((u32) var_r1 <= 0xFFU) {\n if ((s32) temp_r2 > (s32) gSineTable[var_r1]) {\n goto loop_7;\n }\n }\n }\n switch (temp_r4) { /* switch 1; irregular */\n case 0: /* switch 1 */\n var_r0 = 0x200;\n goto block_38;\n case 1: /* switch 1 */\n if (var_r6 == 0) {\n var_r0 = 0x200;\n goto block_38;\n }\n goto block_34;\n case 2: /* switch 1 */\n if (var_r6 != 0) {\n var_r7 = 0x200;\n goto block_37;\n }\n goto block_34;\n }\n } else {\n var_r1 = 0x200;\n if ((s32) temp_r2 < (s32) gSineTable[0x200]) {\nloop_22:\n var_r1 += 4;\n if ((u32) var_r1 <= 0x2FFU) {\n if ((s32) temp_r2 < (s32) gSineTable[var_r1]) {\n goto loop_22;\n }\n }\n }\n switch (temp_r4) { /* switch 2; irregular */\n case 1: /* switch 2 */\n if (var_r6 != 0) {\n var_r0 = 0x600;\nblock_38:\n return (u16) (var_r0 - var_r1);\n }\n case 0: /* switch 2 */\nblock_34:\n return var_r1;\n case 2: /* switch 2 */\n if (var_r6 != 0) {\n goto block_34;\n }\n var_r0 = 0x600;\n goto block_38;\n case 3: /* switch 2 */\n var_r7 = 0x600;\nblock_37:\n var_r0 = var_r7;\n goto block_38;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":52,"lines":97,"gotos":10,"casts":20,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:996: redefinition of `struct MapEntity'","/c.c:1000: syntax error before `?'","/c.c:1000: warning: no semicolon at end of struct or union","/c.c:1003: syntax error before `}'","/c.c:1003: warning: useless keyword or type name in empty declaration"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_804DC38` — benchmark function sa3:sub_804DC38:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-dde16f46c6da.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 sub_804DC38(u8 kind, s32 worldX, s32 worldY, MapEntity *me);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_804DC38 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_804DC38` — benchmark function sa3:sub_804DC38:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_804DC38:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_804DC38\n\t.type\t sub_804DC38,function\n\t.thumb_func\nsub_804DC38:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr6, r1, #0\n\tadd\tr5, r2, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tldr\tr0, [r3, #0x4]\n\tldr\tr1, .L47\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB16\n\tb\t.L3\t@long jump\n.LCB16:\n\tldrb\tr0, [r3, #0x6]\n\tldrb\tr1, [r3, #0x5]\n\tcmp\tr0, r1\n\tbcs\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0x5]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r6, #0\n\tmov\tr0, #0x3\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x0\n\tb\t.L5\n.L48:\n\t.align\t2, 0\n.L47:\n\t.word\t0xffff00\n.L4:\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x2\n\tadd\tr1, r5, #0\n\tmov\tr0, #0x4\n\tldrsb\tr0, [r3, r0]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r1, r0\n\tmov\tr6, #0x1\n.L5:\n\tadd\tr0, r0, r2\n\tsub\tr0, r1, r0\n\tlsl\tr0, r0, #0xe\n\tadd\tr1, r2, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr2, r0, #0x10\n\tcmp\tr2, #0\n\tblt\t.L6\t@cond_branch\n\tmov\tr1, #0x0\n\tldr\tr3, .L49\n\tmov\tr5, #0x0\n\tldrsh\tr0, [r3, r5]\n\tcmp\tr2, r0\n\tble\t.L8\t@cond_branch\n.L10:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0xff\n\tbhi\t.L8\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbgt\t.L10\t@cond_branch\n.L8:\n\tcmp\tr4, #0x1\n\tbeq\t.L15\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L23\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L14\t@cond_branch\n\tb\t.L45\n.L50:\n\t.align\t2, 0\n.L49:\n\t.word\tgSineTable\n.L23:\n\tcmp\tr4, #0x2\n\tbeq\t.L18\t@cond_branch\n\tb\t.L45\n.L14:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L15:\n\tcmp\tr6, #0\n\tbne\t.L45\t@cond_branch\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x2\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L18:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr7, #0x80\n\tlsl\tr7, r7, #0x2\n\tb\t.L46\n.L6:\n\tldr\tr3, .L51\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tmov\tr5, #0x80\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r3, r5\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tbge\t.L26\t@cond_branch\n\tldr\tr5, .L51+0x4\n.L28:\n\tadd\tr0, r1, #0x4\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, r5\n\tbhi\t.L26\t@cond_branch\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r3\n\tmov\tr7, #0x0\n\tldrsh\tr0, [r0, r7]\n\tcmp\tr2, r0\n\tblt\t.L28\t@cond_branch\n.L26:\n\tcmp\tr4, #0x1\n\tbeq\t.L33\t@cond_branch\n\tcmp\tr4, #0x1\n\tbgt\t.L42\t@cond_branch\n\tcmp\tr4, #0\n\tbeq\t.L45\t@cond_branch\n\tb\t.L3\n.L52:\n\t.align\t2, 0\n.L51:\n\t.word\tgSineTable\n\t.word\t0x2ff\n.L42:\n\tcmp\tr4, #0x2\n\tbeq\t.L36\t@cond_branch\n\tcmp\tr4, #0x3\n\tbeq\t.L39\t@cond_branch\n\tb\t.L3\n.L33:\n\tcmp\tr6, #0\n\tbeq\t.L45\t@cond_branch\n\tmov\tr2, #0xc0\n\tlsl\tr2, r2, #0x3\n\tadd\tr0, r2, #0\n\tb\t.L44\n.L36:\n\tcmp\tr6, #0\n\tbeq\t.L37\t@cond_branch\n.L45:\n\tadd\tr0, r1, #0\n\tb\t.L43\n.L37:\n\tmov\tr5, #0xc0\n\tlsl\tr5, r5, #0x3\n\tadd\tr0, r5, #0\n\tb\t.L44\n.L39:\n\tmov\tr7, #0xc0\n\tlsl\tr7, r7, #0x3\n.L46:\n\tadd\tr0, r7, #0\n.L44:\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L43\n.L3:\n\tmov\tr0, #0x0\n.L43:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sub_804DC38,.Lfe1-sub_804DC38\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 sub_804DC38 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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:sub_806132C:agbcc","sym":"sub_806132C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","global","call"],"loc":54,"refSource":"void sub_806132C(Hariisen *enemy)\n{\n u8 *vram = VramMalloc(18);\n Sprite2 *s = &enemy->s;\n\n s->tiles = vram;\n vram += (gUnknown_080D2044[0].numTiles * TILE_SIZE_4BPP);\n s->anim = gUnknown_080D2044[0].anim;\n s->variant = gUnknown_080D2044[0].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x480;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n\n s = &enemy->s2;\n s->tiles = vram;\n vram += (gUnknown_080D2044[3].numTiles * TILE_SIZE_4BPP);\n s->anim = gUnknown_080D2044[3].anim;\n s->variant = gUnknown_080D2044[3].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x4C0;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n\n s = &enemy->s3;\n s->tiles = vram;\n s->anim = gUnknown_080D2044[4].anim;\n s->variant = gUnknown_080D2044[4].variant;\n s->prevVariant = -1;\n s->x = TO_WORLD_POS_RAW(I(enemy->qPos.x), enemy->region[0]) - gCamera.x;\n s->y = TO_WORLD_POS_RAW(I(enemy->qPos.y), enemy->region[1]) - gCamera.y;\n s->oamFlags = 0x4C0;\n s->animCursor = 0;\n s->qAnimDelay = 0;\n s->animSpeed = 0x10;\n s->palId = 0;\n s->frameFlags = 0x1000;\n s->hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *)s);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/enemies/hariisen.c#L55-L108","targetAsm":"@ Generated by gcc 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_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-8415744e08a9.i.gz","proto":{"sub_806132C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"struct Struct0 { u8 _pad0[6]; u16 field_6; u16 field_8; u8 _pad1[26]; s32 field_36; s32 field_40; u8 _pad2[48]; s32 field_92; };\nstruct Struct1 { u16 field_0; u8 field_2; s32 field_4; u8 _pad0[16]; u16 field_24; u8 field_26; s32 field_28; u16 field_32; };\nstruct Struct2 { u8 _pad0[8]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nstruct Struct3 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nstruct Struct4 { s32 field_0; u8 _pad0[4]; s32 field_8; u16 field_12; u16 field_14; u16 field_16; u16 field_18; u16 field_20; u16 field_22; u8 _pad1[2]; u8 field_26; u8 field_27; u8 field_28; u8 _pad2[2]; u8 field_31; s32 field_32; };\nvoid sub_806132C(struct Struct0 * a0, s32 a1, s32 a2, s32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * p0;\n u16 * p1;\n u8 * p2;\n p0 = (s32 *)&gUnknown_080D2044;\n p1 = (u16 *)&gUnknown_080D2044;\n p2 = (u8 *)&gUnknown_080D2044;\n v0 = VramMalloc(18);\n a0->field_92 = v0;\n v1 = p0[1];\n v2 = 0;\n ((struct Struct2 *)(a0 + 92))->field_12 = *p1;\n ((struct Struct2 *)(a0 + 92))->field_26 = p2[2];\n ((struct Struct2 *)(a0 + 92))->field_27 = 255;\n ((struct Struct2 *)(a0 + 92))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct2 *)(a0 + 92))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct2 *)(a0 + 92))->field_20 = 144 << 3;\n ((struct Struct2 *)(a0 + 92))->field_14 = v2;\n ((struct Struct2 *)(a0 + 92))->field_22 = v2;\n ((struct Struct2 *)(a0 + 92))->field_28 = 16;\n ((struct Struct2 *)(a0 + 92))->field_31 = 0;\n ((struct Struct2 *)(a0 + 92))->field_8 = 128 << 5;\n ((struct Struct2 *)(a0 + 92))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 92, -1, a0 + 92, 0);\n ((struct Struct3 *)(a0 + 140))->field_0 = v0 + (v1 << 5);\n v3 = p0[7];\n ((struct Struct3 *)(a0 + 140))->field_12 = p1[12];\n ((struct Struct3 *)(a0 + 140))->field_26 = p2[26];\n ((struct Struct3 *)(a0 + 140))->field_27 = -1;\n ((struct Struct3 *)(a0 + 140))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct3 *)(a0 + 140))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct3 *)(a0 + 140))->field_20 = 152 << 3;\n ((struct Struct3 *)(a0 + 140))->field_14 = v2;\n ((struct Struct3 *)(a0 + 140))->field_22 = v2;\n ((struct Struct3 *)(a0 + 140))->field_28 = 16;\n ((struct Struct3 *)(a0 + 140))->field_31 = 0;\n ((struct Struct3 *)(a0 + 140))->field_8 = 128 << 5;\n ((struct Struct3 *)(a0 + 140))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 140, -1, a0 + 140, 0);\n ((struct Struct4 *)(a0 + 188))->field_0 = v0 + (v1 << 5) + (v3 << 5);\n ((struct Struct4 *)(a0 + 188))->field_12 = p1[16];\n ((struct Struct4 *)(a0 + 188))->field_26 = p2[34];\n ((struct Struct4 *)(a0 + 188))->field_27 = -1;\n ((struct Struct4 *)(a0 + 188))->field_16 = (a0->field_36 >> 8) + (a0->field_6 << 8) - *(s32 *)&gCamera;\n ((struct Struct4 *)(a0 + 188))->field_18 = (a0->field_40 >> 8) + (a0->field_8 << 8) - ((s32 *)&gCamera)[1];\n ((struct Struct4 *)(a0 + 188))->field_20 = 152 << 3;\n ((struct Struct4 *)(a0 + 188))->field_14 = v2;\n ((struct Struct4 *)(a0 + 188))->field_22 = v2;\n ((struct Struct4 *)(a0 + 188))->field_28 = 16;\n ((struct Struct4 *)(a0 + 188))->field_31 = 0;\n ((struct Struct4 *)(a0 + 188))->field_8 = 128 << 5;\n ((struct Struct4 *)(a0 + 188))->field_32 = -1;\n UpdateSpriteAnimation(a0 + 188, -1, a0 + 188, 0);\n return;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":64,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'sub_806132C': agbcc failed: /c.c:1540: warning: assignment makes integer from pointer without a cast"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sub_806132C(Hariisen *enemy) {\n u8 *temp_r0;\n u8 *temp_r5;\n u8 *temp_r5_2;\n\n temp_r0 = VramMalloc(0x12U);\n enemy->s.tiles = temp_r0;\n temp_r5 = temp_r0 + (gUnknown_080D2044->numTiles << 5);\n enemy->s.anim = gUnknown_080D2044->anim;\n enemy->s.variant = gUnknown_080D2044->variant;\n enemy->s.prevVariant = 0xFF;\n enemy->s.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s.oamFlags = 0x480;\n enemy->s.animCursor = 0;\n enemy->s.qAnimDelay = 0;\n enemy->s.animSpeed = 0x10;\n enemy->s.palId = 0;\n enemy->s.frameFlags = 0x1000;\n enemy->s.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s);\n enemy->s2.tiles = temp_r5;\n temp_r5_2 = temp_r5 + (gUnknown_080D2044[3].numTiles << 5);\n enemy->s2.anim = gUnknown_080D2044[3].anim;\n enemy->s2.variant = gUnknown_080D2044[3].variant;\n enemy->s2.prevVariant = -1U;\n enemy->s2.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s2.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s2.oamFlags = 0x4C0;\n enemy->s2.animCursor = 0;\n enemy->s2.qAnimDelay = 0;\n enemy->s2.animSpeed = 0x10;\n enemy->s2.palId = 0;\n enemy->s2.frameFlags = 0x1000;\n enemy->s2.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s2);\n enemy->s3.tiles = temp_r5_2;\n enemy->s3.anim = gUnknown_080D2044[4].anim;\n enemy->s3.variant = gUnknown_080D2044[4].variant;\n enemy->s3.prevVariant = -1U;\n enemy->s3.x = (((s32) enemy->qPos.x >> 8) + (enemy->region[0] << 8)) - gCamera.x;\n enemy->s3.y = (((s32) enemy->qPos.y >> 8) + (enemy->region[1] << 8)) - gCamera.y;\n enemy->s3.oamFlags = 0x4C0;\n enemy->s3.animCursor = 0;\n enemy->s3.qAnimDelay = 0;\n enemy->s3.animSpeed = 0x10;\n enemy->s3.palId = 0;\n enemy->s3.frameFlags = 0x1000;\n enemy->s3.hitboxes[0].index = -1;\n UpdateSpriteAnimation((Sprite *) &enemy->s3);\n}\n","score":171,"maxScore":216,"compileErrors":null,"breakdown":{"insert":58,"delete":8,"replace":1,"opMismatch":0,"argMismatch":104},"quality":{"score":92,"lines":50,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":171,"maxScore":216,"ratio":0.7916666666666666,"kinds":{"insert":58,"delete":8,"replace":1,"opMismatch":0,"argMismatch":104}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub_806132C` — benchmark function sa3:sub_806132C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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\tsub_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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-8415744e08a9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid sub_806132C(Hariisen *enemy);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub_806132C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk 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_806132C` — benchmark function sa3:sub_806132C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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:sub_806132C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 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_806132C\n\t.type\t sub_806132C,function\n\t.thumb_func\nsub_806132C:\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\tr7, r0, #0\n\tmov\tr0, #0x12\n\tbl\tVramMalloc\n\tadd\tr5, r0, #0\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x5c\n\tstr\tr5, [r7, #0x5c]\n\tldr\tr4, .L3\n\tldr\tr0, [r4, #0x4]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x2]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0xff\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr0, #0x90\n\tlsl\tr0, r0, #0x3\n\tstrh\tr0, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x5\n\tmov\tsl, r0\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tmov\tr9, r1\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0x8c\n\tstr\tr5, [r2]\n\tldr\tr0, [r4, #0x1c]\n\tlsl\tr0, r0, #0x5\n\tadd\tr5, r5, r0\n\tldrh\tr0, [r4, #0x18]\n\tstrh\tr0, [r2, #0xc]\n\tldrb\tr0, [r4, #0x1a]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tmov\tr6, #0x98\n\tlsl\tr6, r6, #0x3\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\n\tadd\tr2, r7, #0\n\tadd\tr2, r2, #0xbc\n\tstr\tr5, [r2]\n\tldrh\tr0, [r4, #0x20]\n\tstrh\tr0, [r2, #0xc]\n\tadd\tr4, r4, #0x22\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2, #0x1a]\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tstrb\tr0, [r2, #0x1b]\n\tldr\tr1, [r7, #0x24]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x6]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr3, .L3+0x4\n\tldr\tr0, [r3]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x10]\n\tldr\tr1, [r7, #0x28]\n\tasr\tr1, r1, #0x8\n\tldrh\tr0, [r7, #0x8]\n\tlsl\tr0, r0, #0x8\n\tadd\tr1, r1, r0\n\tldr\tr0, [r3, #0x4]\n\tsub\tr1, r1, r0\n\tstrh\tr1, [r2, #0x12]\n\tstrh\tr6, [r2, #0x14]\n\tmov\tr0, r8\n\tstrh\tr0, [r2, #0xe]\n\tstrh\tr0, [r2, #0x16]\n\tmov\tr1, #0x10\n\tstrb\tr1, [r2, #0x1c]\n\tmov\tr3, #0x0\n\tstrb\tr3, [r2, #0x1f]\n\tmov\tr0, sl\n\tstr\tr0, [r2, #0x8]\n\tmov\tr1, r9\n\tstr\tr1, [r2, #0x20]\n\tadd\tr0, r2, #0\n\tbl\tUpdateSpriteAnimation\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.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgUnknown_080D2044\n\t.word\tgCamera\n.Lfe1:\n\t.size\t sub_806132C,.Lfe1-sub_806132C\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\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 \"sub_806132C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub_806132C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["pointer","cast","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","branch","loop"],"loc":14,"refSource":"u16 VramGetTotalAllocatedTiles(void)\n{\n u16 i;\n u16 count = 0;\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; ++i) {\n if (gVramHeapState[i]) {\n count += gVramHeapState[i];\n i = gVramHeapState[i] - 1 + i; // next slot to check, -1 because of ++i\n }\n }\n return count * VRAM_TILE_SLOTS_PER_SEGMENT;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gVramHeapMaxTileSlots","shape":"scalar u16"},{"name":"gVramHeapState","shape":"u16[]"}],"outcome":"nonmatch","source":"s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= (u32)v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < (u32)v0 >> 2);\n }\n return (u32)(v2 << 18) >> 16;\n}\n","score":22,"maxScore":43,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":0,"opMismatch":1,"argMismatch":11},"quality":{"score":90,"lines":20,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 VramGetTotalAllocatedTiles(void) {\n u16 temp_r1;\n u16 var_r2;\n u16 var_r3;\n u32 temp_r0;\n\n var_r3 = 0;\n var_r2 = 0;\n temp_r0 = (u16) gVramHeapMaxTileSlots >> 2;\n if (temp_r0 > 0U) {\n do {\n temp_r1 = gVramHeapState[var_r2];\n if (temp_r1 != 0) {\n var_r3 += temp_r1;\n var_r2 = temp_r1 + (var_r2 + 0xFFFF);\n }\n var_r2 += 1;\n } while ((u32) var_r2 < temp_r0);\n }\n return (u16) (var_r3 * 4);\n}\n","score":16,"maxScore":38,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11},"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":38,"ratio":0.42105263157894735,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","branch","pointer","loop","nested-loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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: d8c8ab5ff3898e5411323fd3dd7ef6929c86bb2560871febf0415e4b3261e74f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row'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":["global","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80014440_15040\n lui\t$v0, %hi(gDefaultFontPalette)\n addiu\t$v0, $v0, %lo(gDefaultFontPalette)\n sh\t$zero, 0($v0)\n li\t$a0, 1\n li\t$a1, 0xffff\n addiu\t$v1, $v0, 2\n.L18:\n sh\t$a1, 0($v1)\n addiu\t$a0, $a0, 1\n slti\t$v0, $a0, 256\n bnez\t$v0, .L18\n addiu\t$v1, $v1, 2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80014440_15040 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc","sym":"func_800154A8_160A8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800154A8_160A8\n andi\t$a1, $a1, 0xffff\n beqz\t$a1, .L24\n nop\n addu\t$a1, $a1, $a0\n sb\t$zero, 0($a0)\n.L14:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L14\n sb\t$zero, 0($a0)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800154A8_160A8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc","sym":"func_800167B0_173B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","bitwise","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800167B0_173B0\n addiu\t$sp, $sp, -24\n move\t$a3, $a0\n sw\t$ra, 16($sp)\n lbu\t$v0, 12($a3)\n bnez\t$v0, .L60\n addiu\t$v0, $v0, -1\n lbu\t$v0, 13($a3)\n addiu\t$v0, $v0, 1\n sb\t$v0, 13($a3)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L48\n nop\n lbu\t$v0, 14($a3)\n addiu\t$v0, $v0, 1\n andi\t$v0, $v0, 0x1\n sb\t$v0, 14($a3)\n addiu\t$v0, $v0, 7\n sh\t$v0, 8($a3)\n.L48:\n lbu\t$v1, 13($a3)\n li\t$v0, 16\n bne\t$v1, $v0, .L68\n li\t$a0, 8\n li\t$v0, 30\n sb\t$zero, 13($a3)\n.L60:\n sb\t$v0, 12($a3)\n li\t$a0, 8\n.L68:\n lui\t$a2, %hi(func_8000FED0_10AD0)\n addiu\t$a2, $a2, %lo(func_8000FED0_10AD0)\n jal\tdebugEnqueueCallback\n li\t$a1, 1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800167B0_173B0(Struct16728 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800167B0_173B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc","sym":"func_80018DC0_199C0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","global","branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80018DC0_199C0\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tallocateTaskMemory\n li\t$a0, 4\n sb\t$zero, 2($v0)\n lui\t$v1, %hi(D_800A8CC8_A0038)\n lbu\t$v1, %lo(D_800A8CC8_A0038)($v1)\n sh\t$zero, 0($v0)\n li\t$v0, 4\n beq\t$v1, $v0, .L34\n nop\n jal\tfunc_800574A0_580A0\n li\t$a0, 2\n.L34:\n lui\t$v0, %hi(D_800A8CC8_A0038)\n lbu\t$v0, %lo(D_800A8CC8_A0038)($v0)\n sll\t$v0, $v0, 0x2\n lui\t$a0, %hi(D_8008D78C_8E38C)\n addu\t$a0, $a0, $v0\n lw\t$a0, %lo(D_8008D78C_8E38C)($a0)\n jal\tcreateTaskQueue\n li\t$a1, 90\n lui\t$a0, %hi(func_80018E2C_19A2C)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80018E2C_19A2C)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80018DC0_199C0(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80018DC0_199C0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc","sym":"func_8001BCDC_1C8DC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","global","branch","loop","nested-loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BCDC_1C8DC\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n nop\n move\t$t0, $v0\n move\t$a2, $zero\n.L18:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 8($v0)\n move\t$a1, $zero\n blez\t$v0, .L68\n move\t$a0, $zero\n move\t$a3, $v0\n addu\t$v0, $t0, $a0\n.L38:\n lbu\t$v0, 1434($v0)\n xori\t$v1, $v0, 0x1\n sltiu\t$v1, $v1, 1\n xori\t$v0, $v0, 0x3\n sltiu\t$v0, $v0, 1\n or\t$v1, $v1, $v0\n bnezl\t$v1, .L58\n addiu\t$a1, $a1, 1\n.L58:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a3\n bnez\t$v0, .L38\n addu\t$v0, $t0, $a0\n.L68:\n andi\t$v0, $a1, 0xff\n bnezl\t$v0, .L80\n addiu\t$a2, $a2, 1\n addu\t$v0, $t0, $a2\n sb\t$zero, 1464($v0)\n addiu\t$a2, $a2, 1\n.L80:\n slti\t$v0, $a2, 9\n bnez\t$v0, .L18\n nop\n lw\t$ra, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BCDC_1C8DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc","sym":"func_8001BD74_1C974","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","pointer","memory"],"loc":10,"refSource":"void func_8001BD74_1C974(s8 *a0) {\n if (*a0 == 3) {\n *a0 = 2;\n } else if (*a0 == 8) {\n *a0 = 7;\n } else if (*a0 != 4) {\n } else {\n *a0 = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\n","proto":{"func_8001BD74_1C974":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BD74_1C974' — lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlb\tv1,0(a0) */\n/* 4:\tli\tv0,3 */\n/* 8:\tbne\tv1,v0,1c */\n/* c:\tli\tv0,8 */\n/* 10:\tli\tv0,2 */\n/* 14:\tj\t38 */\n/* 18:\tsb\tv0,0(a0) */\n/* 1c:\tbne\tv1,v0,30 */\n/* 20:\tli\tv0,4 */\n/* 24:\tli\tv0,7 */\n/* 28:\tj\t38 */\n/* 2c:\tsb\tv0,0(a0) */\n/* 30:\tbeql\tv1,v0,38 */\n/* 34:\tsb\tzero,0(a0) */\n/* 38:\tjr\tra */\n/* 3c:\tnop */\nvoid func_8001BD74_1C974(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8001BD74_1C974(s8 *arg0) {\n s8 temp_v1;\n\n temp_v1 = *arg0;\n switch (temp_v1) { /* irregular */\n case 3:\n *arg0 = 2;\n return;\n case 8:\n *arg0 = 7;\n return;\n case 4:\n *arg0 = 0;\n return;\n }\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/1BBA0.c: remaps a state byte through a pointer via an if-chain; pure leaf","gapSize":{"decompiler":"m2c","score":14,"maxScore":23,"ratio":0.6086956521739131,"kinds":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BD74_1C974\n lb\t$v1, 0($a0)\n li\t$v0, 3\n bne\t$v1, $v0, .L1c\n li\t$v0, 8\n li\t$v0, 2\n j\t.L38\n sb\t$v0, 0($a0)\n.L1c:\n bne\t$v1, $v0, .L30\n li\t$v0, 4\n li\t$v0, 7\n j\t.L38\n sb\t$v0, 0($a0)\n.L30:\n beql\t$v1, $v0, .L38\n sb\t$zero, 0($a0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BD74_1C974 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc","sym":"func_8001E104_1ED04","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","union","loop","strength-reduce"],"loc":114,"refSource":"s32 func_8001E104_1ED04(EepromSaveData_type *arg0) {\n s32 temp_a1;\n s32 changed;\n s32 i;\n u8 temp;\n\n temp_a1 = *(s32 *)arg0->unknown_0C;\n changed = 0;\n if (temp_a1 > 0x98967F) {\n *(s32 *)arg0->unknown_0C = 0x98967F;\n changed = 1;\n i = 0;\n } else {\n i = 0;\n if (temp_a1 < 0) {\n *(s32 *)arg0->unknown_0C = 0;\n changed = 1;\n i = 0;\n }\n }\n\n for (i = 0; i < 0x10; i++) {\n temp = arg0->save_slot_status[i];\n if (temp >= 6) {\n arg0->save_slot_status[i] = 0;\n changed = 1;\n }\n temp = arg0->save_slot_data[i];\n if (temp >= 6) {\n arg0->save_slot_data[i] = 0;\n changed = 1;\n }\n }\n\n if (arg0->save_slot_status[0] == 0) {\n arg0->save_slot_status[0] = 5;\n changed = 1;\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->save_slot_data[i];\n if (temp == 0) {\n arg0->save_slot_data[i] = 5;\n changed = 1;\n }\n temp = arg0->save_slot_data[i + 4];\n if (temp == 0) {\n arg0->save_slot_data[i + 4] = 5;\n changed = 1;\n }\n }\n\n for (i = 0; i < 0x12; i++) {\n temp = arg0->character_or_settings[i];\n if (temp >= 0x1A) {\n arg0->character_or_settings[i] = 0;\n changed = 1;\n }\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->character_or_settings[i * 3];\n if (temp == 0) {\n arg0->character_or_settings[i * 3] = i + 1;\n changed = 1;\n }\n }\n\n for (i = 0; i < 0x12; i++) {\n temp = arg0->character_or_settings[i];\n if (temp >= 0x1A) {\n arg0->character_or_settings[i] = 1;\n changed = 1;\n }\n }\n\n for (i = 0; i < 9; i++) {\n temp = arg0->u.setting_42[i];\n if (temp >= 0x12) {\n arg0->u.setting_42[i] = 0x11;\n changed = 1;\n }\n }\n\n for (i = 0; i < 3; i++) {\n temp = arg0->setting_4B[i];\n if (temp >= 0x10) {\n arg0->setting_4B[i] = 0xF;\n changed = 1;\n }\n }\n\n if (arg0->setting_4E >= 2) {\n arg0->setting_4E = 0;\n changed = 1;\n }\n\n if (arg0->setting_4F >= 2) {\n arg0->setting_4F = 0;\n changed = 1;\n }\n\n if (arg0->setting_50 >= 2) {\n arg0->setting_50 = 0;\n changed = 1;\n }\n\n if (arg0->unk51 >= 2) {\n arg0->unk51 = 0;\n changed = 1;\n }\n\n return changed;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1D520.c#L203-L316","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,12(a0)\n 4:\tlui\tv1,0x98\n 8:\tori\tv1,v1,0x967f\n c:\tslt\tv0,v1,a1\n 10:\tbeqz\tv0,20 \n 14:\tmove\ta2,zero\n 18:\tj\t2c \n 1c:\tsw\tv1,12(a0)\n 20:\tbgez\ta1,34 \n 24:\tmove\tv1,zero\n 28:\tsw\tzero,12(a0)\n 2c:\tli\ta2,1\n 30:\tmove\tv1,zero\n 34:\taddu\ta1,a0,v1\n 38:\tlbu\tv0,16(a1)\n 3c:\tsltiu\tv0,v0,6\n 40:\tbnez\tv0,50 \n 44:\tnop\n 48:\tsb\tzero,16(a1)\n 4c:\tli\ta2,1\n 50:\tlbu\tv0,32(a1)\n 54:\tsltiu\tv0,v0,6\n 58:\tbnez\tv0,68 \n 5c:\taddiu\tv1,v1,1\n 60:\tsb\tzero,32(a1)\n 64:\tli\ta2,1\n 68:\tslti\tv0,v1,16\n 6c:\tbnez\tv0,38 \n 70:\taddu\ta1,a0,v1\n 74:\tlbu\tv0,16(a0)\n 78:\tbnez\tv0,8c \n 7c:\tmove\tv1,zero\n 80:\tli\tv0,5\n 84:\tsb\tv0,16(a0)\n 88:\tli\ta2,1\n 8c:\tli\ta3,5\n 90:\taddu\ta1,a0,v1\n 94:\tlbu\tv0,32(a1)\n 98:\tbnez\tv0,a8 \n 9c:\tnop\n a0:\tsb\ta3,32(a1)\n a4:\tli\ta2,1\n a8:\tlbu\tv0,36(a1)\n ac:\tbnez\tv0,bc \n b0:\taddiu\tv1,v1,1\n b4:\tsb\ta3,36(a1)\n b8:\tli\ta2,1\n bc:\tslti\tv0,v1,3\n c0:\tbnez\tv0,94 \n c4:\taddu\ta1,a0,v1\n c8:\tmove\tv1,zero\n cc:\taddu\ta1,a0,v1\n d0:\tlbu\tv0,48(a1)\n d4:\tsltiu\tv0,v0,26\n d8:\tbnez\tv0,e8 \n dc:\taddiu\tv1,v1,1\n e0:\tsb\tzero,48(a1)\n e4:\tli\ta2,1\n e8:\tslti\tv0,v1,18\n ec:\tbnez\tv0,d0 \n f0:\taddu\ta1,a0,v1\n f4:\tmove\tv1,zero\n f8:\tmove\ta1,a0\n fc:\tlbu\tv0,48(a1)\n 100:\tbnezl\tv0,118 \n 104:\taddiu\tv1,v1,1\n 108:\taddiu\tv0,v1,1\n 10c:\tsb\tv0,48(a1)\n 110:\tli\ta2,1\n 114:\taddiu\tv1,v1,1\n 118:\tslti\tv0,v1,3\n 11c:\tbnez\tv0,fc \n 120:\taddiu\ta1,a1,3\n 124:\tmove\tv1,zero\n 128:\tli\ta3,1\n 12c:\taddu\ta1,a0,v1\n 130:\tlbu\tv0,48(a1)\n 134:\tsltiu\tv0,v0,26\n 138:\tbnez\tv0,148 \n 13c:\taddiu\tv1,v1,1\n 140:\tsb\ta3,48(a1)\n 144:\tli\ta2,1\n 148:\tslti\tv0,v1,18\n 14c:\tbnez\tv0,130 \n 150:\taddu\ta1,a0,v1\n 154:\tmove\tv1,zero\n 158:\tli\ta3,17\n 15c:\taddu\ta1,a0,v1\n 160:\tlbu\tv0,66(a1)\n 164:\tsltiu\tv0,v0,18\n 168:\tbnez\tv0,178 \n 16c:\taddiu\tv1,v1,1\n 170:\tsb\ta3,66(a1)\n 174:\tli\ta2,1\n 178:\tslti\tv0,v1,9\n 17c:\tbnez\tv0,160 \n 180:\taddu\ta1,a0,v1\n 184:\tmove\tv1,zero\n 188:\tli\ta3,15\n 18c:\taddu\ta1,a0,v1\n 190:\tlbu\tv0,75(a1)\n 194:\tsltiu\tv0,v0,16\n 198:\tbnez\tv0,1a8 \n 19c:\taddiu\tv1,v1,1\n 1a0:\tsb\ta3,75(a1)\n 1a4:\tli\ta2,1\n 1a8:\tslti\tv0,v1,3\n 1ac:\tbnez\tv0,190 \n 1b0:\taddu\ta1,a0,v1\n 1b4:\tlbu\tv0,78(a0)\n 1b8:\tsltiu\tv0,v0,2\n 1bc:\tbnez\tv0,1cc \n 1c0:\tnop\n 1c4:\tsb\tzero,78(a0)\n 1c8:\tli\ta2,1\n 1cc:\tlbu\tv0,79(a0)\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,1e4 \n 1d8:\tnop\n 1dc:\tsb\tzero,79(a0)\n 1e0:\tli\ta2,1\n 1e4:\tlbu\tv0,80(a0)\n 1e8:\tsltiu\tv0,v0,2\n 1ec:\tbnez\tv0,1fc \n 1f0:\tnop\n 1f4:\tsb\tzero,80(a0)\n 1f8:\tli\ta2,1\n 1fc:\tlbu\tv0,81(a0)\n 200:\tsltiu\tv0,v0,2\n 204:\tbnez\tv0,214 \n 208:\tnop\n 20c:\tsb\tzero,81(a0)\n 210:\tli\ta2,1\n 214:\tjr\tra\n 218:\tmove\tv0,a2\n 21c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4453acd6f88bb589/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000021c func_8001E104_1ED04\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c85000c 3c030098 3463967f 0065102a ....<...4c...e.*\n 0010 10400003 00003021 0800000b ac83000c .@....0!........\n 0020 04a10004 00001821 ac80000c 24060001 .......!....$...\n 0030 00001821 00832821 90a20010 2c420006 ...!..(!....,B..\n 0040 14400003 00000000 a0a00010 24060001 .@..........$...\n 0050 90a20020 2c420006 14400003 24630001 ... ,B...@..$c..\n 0060 a0a00020 24060001 28620010 1440fff2 ... $...(b...@..\n 0070 00832821 90820010 14400004 00001821 ..(!.....@.....!\n 0080 24020005 a0820010 24060001 24070005 $.......$...$...\n 0090 00832821 90a20020 14400003 00000000 ..(!... .@......\n 00a0 a0a70020 24060001 90a20024 14400003 ... $......$.@..\n 00b0 24630001 a0a70024 24060001 28620003 $c.....$$...(b..\n 00c0 1440fff4 00832821 00001821 00832821 .@....(!...!..(!\n 00d0 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 00e0 a0a00030 24060001 28620012 1440fff8 ...0$...(b...@..\n 00f0 00832821 00001821 00802821 90a20030 ..(!...!..(!...0\n 0100 54400005 24630001 24620001 a0a20030 T@..$c..$b.....0\n 0110 24060001 24630001 28620003 1440fff7 $...$c..(b...@..\n 0120 24a50003 00001821 24070001 00832821 $......!$.....(!\n 0130 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 0140 a0a70030 24060001 28620012 1440fff8 ...0$...(b...@..\n 0150 00832821 00001821 24070011 00832821 ..(!...!$.....(!\n 0160 90a20042 2c420012 14400003 24630001 ...B,B...@..$c..\n 0170 a0a70042 24060001 28620009 1440fff8 ...B$...(b...@..\n 0180 00832821 00001821 2407000f 00832821 ..(!...!$.....(!\n 0190 90a2004b 2c420010 14400003 24630001 ...K,B...@..$c..\n 01a0 a0a7004b 24060001 28620003 1440fff8 ...K$...(b...@..\n 01b0 00832821 9082004e 2c420002 14400003 ..(!...N,B...@..\n 01c0 00000000 a080004e 24060001 9082004f .......N$......O\n 01d0 2c420002 14400003 00000000 a080004f ,B...@.........O\n 01e0 24060001 90820050 2c420002 14400003 $......P,B...@..\n 01f0 00000000 a0800050 24060001 90820051 .......P$......Q\n 0200 2c420002 14400003 00000000 a0800051 ,B...@.........Q\n 0210 24060001 03e00008 00c01021 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,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001E104_1ED04' — lift: cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — 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\ta1,12(a0) */\n/* 4:\tlui\tv1,0x98 */\n/* 8:\tori\tv1,v1,0x967f */\n/* c:\tslt\tv0,v1,a1 */\n/* 10:\tbeqz\tv0,20 */\n/* 14:\tmove\ta2,zero */\n/* 18:\tj\t2c */\n/* 1c:\tsw\tv1,12(a0) */\n/* 20:\tbgez\ta1,34 */\n/* 24:\tmove\tv1,zero */\n/* 28:\tsw\tzero,12(a0) */\n/* 2c:\tli\ta2,1 */\n/* 30:\tmove\tv1,zero */\n/* 34:\taddu\ta1,a0,v1 */\n/* 38:\tlbu\tv0,16(a1) */\n/* 3c:\tsltiu\tv0,v0,6 */\n/* 40:\tbnez\tv0,50 */\n/* 44:\tnop */\n/* 48:\tsb\tzero,16(a1) */\n/* 4c:\tli\ta2,1 */\n/* 50:\tlbu\tv0,32(a1) */\n/* 54:\tsltiu\tv0,v0,6 */\n/* 58:\tbnez\tv0,68 */\n/* 5c:\taddiu\tv1,v1,1 */\n/* 60:\tsb\tzero,32(a1) */\n/* 64:\tli\ta2,1 */\n/* 68:\tslti\tv0,v1,16 */\n/* 6c:\tbnez\tv0,38 */\n/* 70:\taddu\ta1,a0,v1 */\n/* 74:\tlbu\tv0,16(a0) */\n/* 78:\tbnez\tv0,8c */\n/* 7c:\tmove\tv1,zero */\n/* 80:\tli\tv0,5 */\n/* 84:\tsb\tv0,16(a0) */\n/* 88:\tli\ta2,1 */\n/* 8c:\tli\ta3,5 */\n/* 90:\taddu\ta1,a0,v1 */\n/* 94:\tlbu\tv0,32(a1) */\n/* 98:\tbnez\tv0,a8 */\n/* 9c:\tnop */\n/* a0:\tsb\ta3,32(a1) */\n/* a4:\tli\ta2,1 */\n/* a8:\tlbu\tv0,36(a1) */\n/* ac:\tbnez\tv0,bc */\n/* b0:\taddiu\tv1,v1,1 */\n/* b4:\tsb\ta3,36(a1) */\n/* b8:\tli\ta2,1 */\n/* bc:\tslti\tv0,v1,3 */\n/* c0:\tbnez\tv0,94 */\n/* c4:\taddu\ta1,a0,v1 */\n/* c8:\tmove\tv1,zero */\n/* cc:\taddu\ta1,a0,v1 */\n/* d0:\tlbu\tv0,48(a1) */\n/* d4:\tsltiu\tv0,v0,26 */\n/* d8:\tbnez\tv0,e8 */\n/* dc:\taddiu\tv1,v1,1 */\n/* e0:\tsb\tzero,48(a1) */\n/* e4:\tli\ta2,1 */\n/* e8:\tslti\tv0,v1,18 */\n/* ec:\tbnez\tv0,d0 */\n/* f0:\taddu\ta1,a0,v1 */\n/* f4:\tmove\tv1,zero */\n/* f8:\tmove\ta1,a0 */\n/* fc:\tlbu\tv0,48(a1) */\n/* 100:\tbnezl\tv0,118 */\n/* 104:\taddiu\tv1,v1,1 */\n/* 108:\taddiu\tv0,v1,1 */\n/* 10c:\tsb\tv0,48(a1) */\n/* 110:\tli\ta2,1 */\n/* 114:\taddiu\tv1,v1,1 */\n/* 118:\tslti\tv0,v1,3 */\n/* 11c:\tbnez\tv0,fc */\n/* 120:\taddiu\ta1,a1,3 */\n/* 124:\tmove\tv1,zero */\n/* 128:\tli\ta3,1 */\n/* 12c:\taddu\ta1,a0,v1 */\n/* 130:\tlbu\tv0,48(a1) */\n/* 134:\tsltiu\tv0,v0,26 */\n/* 138:\tbnez\tv0,148 */\n/* 13c:\taddiu\tv1,v1,1 */\n/* 140:\tsb\ta3,48(a1) */\n/* 144:\tli\ta2,1 */\n/* 148:\tslti\tv0,v1,18 */\n/* 14c:\tbnez\tv0,130 */\n/* 150:\taddu\ta1,a0,v1 */\n/* 154:\tmove\tv1,zero */\n/* 158:\tli\ta3,17 */\n/* 15c:\taddu\ta1,a0,v1 */\n/* 160:\tlbu\tv0,66(a1) */\n/* 164:\tsltiu\tv0,v0,18 */\n/* 168:\tbnez\tv0,178 */\n/* 16c:\taddiu\tv1,v1,1 */\n/* 170:\tsb\ta3,66(a1) */\n/* 174:\tli\ta2,1 */\n/* 178:\tslti\tv0,v1,9 */\n/* 17c:\tbnez\tv0,160 */\n/* 180:\taddu\ta1,a0,v1 */\n/* 184:\tmove\tv1,zero */\n/* 188:\tli\ta3,15 */\n/* 18c:\taddu\ta1,a0,v1 */\n/* 190:\tlbu\tv0,75(a1) */\n/* 194:\tsltiu\tv0,v0,16 */\n/* 198:\tbnez\tv0,1a8 */\n/* 19c:\taddiu\tv1,v1,1 */\n/* 1a0:\tsb\ta3,75(a1) */\n/* 1a4:\tli\ta2,1 */\n/* 1a8:\tslti\tv0,v1,3 */\n/* 1ac:\tbnez\tv0,190 */\n/* 1b0:\taddu\ta1,a0,v1 */\n/* 1b4:\tlbu\tv0,78(a0) */\n/* 1b8:\tsltiu\tv0,v0,2 */\n/* 1bc:\tbnez\tv0,1cc */\n/* 1c0:\tnop */\n/* 1c4:\tsb\tzero,78(a0) */\n/* 1c8:\tli\ta2,1 */\n/* 1cc:\tlbu\tv0,79(a0) */\n/* 1d0:\tsltiu\tv0,v0,2 */\n/* 1d4:\tbnez\tv0,1e4 */\n/* 1d8:\tnop */\n/* 1dc:\tsb\tzero,79(a0) */\n/* 1e0:\tli\ta2,1 */\n/* 1e4:\tlbu\tv0,80(a0) */\n/* 1e8:\tsltiu\tv0,v0,2 */\n/* 1ec:\tbnez\tv0,1fc */\n/* 1f0:\tnop */\n/* 1f4:\tsb\tzero,80(a0) */\n/* 1f8:\tli\ta2,1 */\n/* 1fc:\tlbu\tv0,81(a0) */\n/* 200:\tsltiu\tv0,v0,2 */\n/* 204:\tbnez\tv0,214 */\n/* 208:\tnop */\n/* 20c:\tsb\tzero,81(a0) */\n/* 210:\tli\ta2,1 */\n/* 214:\tjr\tra */\n/* 218:\tmove\tv0,a2 */\n/* 21c:\tnop */\nvoid func_8001E104_1ED04(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":144,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001E104_1ED04': unmodelled control transfer 'bnezl' at 0x100 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_8001E104_1ED04(void *arg0) {\n s32 temp_a1;\n s32 var_a2;\n s32 var_v1;\n s32 var_v1_2;\n s32 var_v1_3;\n s32 var_v1_4;\n s32 var_v1_5;\n s32 var_v1_6;\n s32 var_v1_7;\n void *var_a1;\n void *var_a1_2;\n void *var_a1_3;\n void *var_a1_4;\n void *var_a1_5;\n void *var_a1_6;\n void *var_a1_7;\n\n temp_a1 = arg0->unkC;\n var_a2 = 0;\n if (temp_a1 > 0x98967F) {\n arg0->unkC = 0x98967F;\n goto block_4;\n }\n var_v1 = 0;\n if (temp_a1 < 0) {\n arg0->unkC = 0;\nblock_4:\n var_a2 = 1;\n var_v1 = 0;\n }\n var_a1 = arg0;\n do {\n if ((u8) var_a1->unk10 >= 6U) {\n var_a1->unk10 = 0U;\n var_a2 = 1;\n }\n var_v1 += 1;\n if ((u8) var_a1->unk20 >= 6U) {\n var_a1->unk20 = 0U;\n var_a2 = 1;\n }\n var_a1 = arg0 + var_v1;\n } while (var_v1 < 0x10);\n var_v1_2 = 0;\n if (arg0->unk10 == 0) {\n arg0->unk10 = 5U;\n var_a2 = 1;\n }\n var_a1_2 = arg0;\n do {\n if (var_a1_2->unk20 == 0) {\n var_a1_2->unk20 = 5U;\n var_a2 = 1;\n }\n var_v1_2 += 1;\n if (var_a1_2->unk24 == 0) {\n var_a1_2->unk24 = 5U;\n var_a2 = 1;\n }\n var_a1_2 = arg0 + var_v1_2;\n } while (var_v1_2 < 3);\n var_v1_3 = 0;\n var_a1_3 = arg0;\n do {\n var_v1_3 += 1;\n if ((u8) var_a1_3->unk30 >= 0x1AU) {\n var_a1_3->unk30 = 0U;\n var_a2 = 1;\n }\n var_a1_3 = arg0 + var_v1_3;\n } while (var_v1_3 < 0x12);\n var_v1_4 = 0;\n var_a1_4 = arg0;\n do {\n if (var_a1_4->unk30 == 0) {\n var_a1_4->unk30 = (u8) (var_v1_4 + 1);\n var_a2 = 1;\n }\n var_v1_4 += 1;\n var_a1_4 += 3;\n } while (var_v1_4 < 3);\n var_v1_5 = 0;\n var_a1_5 = arg0;\n do {\n var_v1_5 += 1;\n if ((u8) var_a1_5->unk30 >= 0x1AU) {\n var_a1_5->unk30 = 1U;\n var_a2 = 1;\n }\n var_a1_5 = arg0 + var_v1_5;\n } while (var_v1_5 < 0x12);\n var_v1_6 = 0;\n var_a1_6 = arg0;\n do {\n var_v1_6 += 1;\n if ((u8) var_a1_6->unk42 >= 0x12U) {\n var_a1_6->unk42 = 0x11U;\n var_a2 = 1;\n }\n var_a1_6 = arg0 + var_v1_6;\n } while (var_v1_6 < 9);\n var_v1_7 = 0;\n var_a1_7 = arg0;\n do {\n var_v1_7 += 1;\n if ((u8) var_a1_7->unk4B >= 0x10U) {\n var_a1_7->unk4B = 0xFU;\n var_a2 = 1;\n }\n var_a1_7 = arg0 + var_v1_7;\n } while (var_v1_7 < 3);\n if ((u8) arg0->unk4E >= 2U) {\n arg0->unk4E = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk4F >= 2U) {\n arg0->unk4F = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk50 >= 2U) {\n arg0->unk50 = 0U;\n var_a2 = 1;\n }\n if ((u8) arg0->unk51 >= 2U) {\n arg0->unk51 = 0U;\n var_a2 = 1;\n }\n return var_a2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":129,"gotos":1,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2718: request for member `unkC' in something not a structure or union","/c.i:2721: request for member `unkC' in something not a structure or union","/c.i:2726: request for member `unkC' in something not a structure or union","/c.i:2733: request for member `unk10' in something not a structure or union","/c.i:2734: request for member `unk10' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001E104_1ED04` — benchmark function snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001E104_1ED04\n lw\t$a1, 12($a0)\n lui\t$v1, 0x98\n ori\t$v1, $v1, 0x967f\n slt\t$v0, $v1, $a1\n beqz\t$v0, .L20\n move\t$a2, $zero\n j\t.L2c\n sw\t$v1, 12($a0)\n.L20:\n bgez\t$a1, .L34\n move\t$v1, $zero\n sw\t$zero, 12($a0)\n.L2c:\n li\t$a2, 1\n move\t$v1, $zero\n.L34:\n addu\t$a1, $a0, $v1\n.L38:\n lbu\t$v0, 16($a1)\n sltiu\t$v0, $v0, 6\n bnez\t$v0, .L50\n nop\n sb\t$zero, 16($a1)\n li\t$a2, 1\n.L50:\n lbu\t$v0, 32($a1)\n sltiu\t$v0, $v0, 6\n bnez\t$v0, .L68\n addiu\t$v1, $v1, 1\n sb\t$zero, 32($a1)\n li\t$a2, 1\n.L68:\n slti\t$v0, $v1, 16\n bnez\t$v0, .L38\n addu\t$a1, $a0, $v1\n lbu\t$v0, 16($a0)\n bnez\t$v0, .L8c\n move\t$v1, $zero\n li\t$v0, 5\n sb\t$v0, 16($a0)\n li\t$a2, 1\n.L8c:\n li\t$a3, 5\n addu\t$a1, $a0, $v1\n.L94:\n lbu\t$v0, 32($a1)\n bnez\t$v0, .La8\n nop\n sb\t$a3, 32($a1)\n li\t$a2, 1\n.La8:\n lbu\t$v0, 36($a1)\n bnez\t$v0, .Lbc\n addiu\t$v1, $v1, 1\n sb\t$a3, 36($a1)\n li\t$a2, 1\n.Lbc:\n slti\t$v0, $v1, 3\n bnez\t$v0, .L94\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n addu\t$a1, $a0, $v1\n.Ld0:\n lbu\t$v0, 48($a1)\n sltiu\t$v0, $v0, 26\n bnez\t$v0, .Le8\n addiu\t$v1, $v1, 1\n sb\t$zero, 48($a1)\n li\t$a2, 1\n.Le8:\n slti\t$v0, $v1, 18\n bnez\t$v0, .Ld0\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n move\t$a1, $a0\n.Lfc:\n lbu\t$v0, 48($a1)\n bnezl\t$v0, .L118\n addiu\t$v1, $v1, 1\n addiu\t$v0, $v1, 1\n sb\t$v0, 48($a1)\n li\t$a2, 1\n addiu\t$v1, $v1, 1\n.L118:\n slti\t$v0, $v1, 3\n bnez\t$v0, .Lfc\n addiu\t$a1, $a1, 3\n move\t$v1, $zero\n li\t$a3, 1\n addu\t$a1, $a0, $v1\n.L130:\n lbu\t$v0, 48($a1)\n sltiu\t$v0, $v0, 26\n bnez\t$v0, .L148\n addiu\t$v1, $v1, 1\n sb\t$a3, 48($a1)\n li\t$a2, 1\n.L148:\n slti\t$v0, $v1, 18\n bnez\t$v0, .L130\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n li\t$a3, 17\n addu\t$a1, $a0, $v1\n.L160:\n lbu\t$v0, 66($a1)\n sltiu\t$v0, $v0, 18\n bnez\t$v0, .L178\n addiu\t$v1, $v1, 1\n sb\t$a3, 66($a1)\n li\t$a2, 1\n.L178:\n slti\t$v0, $v1, 9\n bnez\t$v0, .L160\n addu\t$a1, $a0, $v1\n move\t$v1, $zero\n li\t$a3, 15\n addu\t$a1, $a0, $v1\n.L190:\n lbu\t$v0, 75($a1)\n sltiu\t$v0, $v0, 16\n bnez\t$v0, .L1a8\n addiu\t$v1, $v1, 1\n sb\t$a3, 75($a1)\n li\t$a2, 1\n.L1a8:\n slti\t$v0, $v1, 3\n bnez\t$v0, .L190\n addu\t$a1, $a0, $v1\n lbu\t$v0, 78($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1cc\n nop\n sb\t$zero, 78($a0)\n li\t$a2, 1\n.L1cc:\n lbu\t$v0, 79($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1e4\n nop\n sb\t$zero, 79($a0)\n li\t$a2, 1\n.L1e4:\n lbu\t$v0, 80($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L1fc\n nop\n sb\t$zero, 80($a0)\n li\t$a2, 1\n.L1fc:\n lbu\t$v0, 81($a0)\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L214\n nop\n sb\t$zero, 81($a0)\n li\t$a2, 1\n.L214:\n jr\t$ra\n move\t$v0, $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 func_8001E104_1ED04 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001E104_1ED04` — benchmark function snowboardkids2:func_8001E104_1ED04:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001E104_1ED04: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\ta1,12(a0)\n 4:\tlui\tv1,0x98\n 8:\tori\tv1,v1,0x967f\n c:\tslt\tv0,v1,a1\n 10:\tbeqz\tv0,20 \n 14:\tmove\ta2,zero\n 18:\tj\t2c \n 1c:\tsw\tv1,12(a0)\n 20:\tbgez\ta1,34 \n 24:\tmove\tv1,zero\n 28:\tsw\tzero,12(a0)\n 2c:\tli\ta2,1\n 30:\tmove\tv1,zero\n 34:\taddu\ta1,a0,v1\n 38:\tlbu\tv0,16(a1)\n 3c:\tsltiu\tv0,v0,6\n 40:\tbnez\tv0,50 \n 44:\tnop\n 48:\tsb\tzero,16(a1)\n 4c:\tli\ta2,1\n 50:\tlbu\tv0,32(a1)\n 54:\tsltiu\tv0,v0,6\n 58:\tbnez\tv0,68 \n 5c:\taddiu\tv1,v1,1\n 60:\tsb\tzero,32(a1)\n 64:\tli\ta2,1\n 68:\tslti\tv0,v1,16\n 6c:\tbnez\tv0,38 \n 70:\taddu\ta1,a0,v1\n 74:\tlbu\tv0,16(a0)\n 78:\tbnez\tv0,8c \n 7c:\tmove\tv1,zero\n 80:\tli\tv0,5\n 84:\tsb\tv0,16(a0)\n 88:\tli\ta2,1\n 8c:\tli\ta3,5\n 90:\taddu\ta1,a0,v1\n 94:\tlbu\tv0,32(a1)\n 98:\tbnez\tv0,a8 \n 9c:\tnop\n a0:\tsb\ta3,32(a1)\n a4:\tli\ta2,1\n a8:\tlbu\tv0,36(a1)\n ac:\tbnez\tv0,bc \n b0:\taddiu\tv1,v1,1\n b4:\tsb\ta3,36(a1)\n b8:\tli\ta2,1\n bc:\tslti\tv0,v1,3\n c0:\tbnez\tv0,94 \n c4:\taddu\ta1,a0,v1\n c8:\tmove\tv1,zero\n cc:\taddu\ta1,a0,v1\n d0:\tlbu\tv0,48(a1)\n d4:\tsltiu\tv0,v0,26\n d8:\tbnez\tv0,e8 \n dc:\taddiu\tv1,v1,1\n e0:\tsb\tzero,48(a1)\n e4:\tli\ta2,1\n e8:\tslti\tv0,v1,18\n ec:\tbnez\tv0,d0 \n f0:\taddu\ta1,a0,v1\n f4:\tmove\tv1,zero\n f8:\tmove\ta1,a0\n fc:\tlbu\tv0,48(a1)\n 100:\tbnezl\tv0,118 \n 104:\taddiu\tv1,v1,1\n 108:\taddiu\tv0,v1,1\n 10c:\tsb\tv0,48(a1)\n 110:\tli\ta2,1\n 114:\taddiu\tv1,v1,1\n 118:\tslti\tv0,v1,3\n 11c:\tbnez\tv0,fc \n 120:\taddiu\ta1,a1,3\n 124:\tmove\tv1,zero\n 128:\tli\ta3,1\n 12c:\taddu\ta1,a0,v1\n 130:\tlbu\tv0,48(a1)\n 134:\tsltiu\tv0,v0,26\n 138:\tbnez\tv0,148 \n 13c:\taddiu\tv1,v1,1\n 140:\tsb\ta3,48(a1)\n 144:\tli\ta2,1\n 148:\tslti\tv0,v1,18\n 14c:\tbnez\tv0,130 \n 150:\taddu\ta1,a0,v1\n 154:\tmove\tv1,zero\n 158:\tli\ta3,17\n 15c:\taddu\ta1,a0,v1\n 160:\tlbu\tv0,66(a1)\n 164:\tsltiu\tv0,v0,18\n 168:\tbnez\tv0,178 \n 16c:\taddiu\tv1,v1,1\n 170:\tsb\ta3,66(a1)\n 174:\tli\ta2,1\n 178:\tslti\tv0,v1,9\n 17c:\tbnez\tv0,160 \n 180:\taddu\ta1,a0,v1\n 184:\tmove\tv1,zero\n 188:\tli\ta3,15\n 18c:\taddu\ta1,a0,v1\n 190:\tlbu\tv0,75(a1)\n 194:\tsltiu\tv0,v0,16\n 198:\tbnez\tv0,1a8 \n 19c:\taddiu\tv1,v1,1\n 1a0:\tsb\ta3,75(a1)\n 1a4:\tli\ta2,1\n 1a8:\tslti\tv0,v1,3\n 1ac:\tbnez\tv0,190 \n 1b0:\taddu\ta1,a0,v1\n 1b4:\tlbu\tv0,78(a0)\n 1b8:\tsltiu\tv0,v0,2\n 1bc:\tbnez\tv0,1cc \n 1c0:\tnop\n 1c4:\tsb\tzero,78(a0)\n 1c8:\tli\ta2,1\n 1cc:\tlbu\tv0,79(a0)\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,1e4 \n 1d8:\tnop\n 1dc:\tsb\tzero,79(a0)\n 1e0:\tli\ta2,1\n 1e4:\tlbu\tv0,80(a0)\n 1e8:\tsltiu\tv0,v0,2\n 1ec:\tbnez\tv0,1fc \n 1f0:\tnop\n 1f4:\tsb\tzero,80(a0)\n 1f8:\tli\ta2,1\n 1fc:\tlbu\tv0,81(a0)\n 200:\tsltiu\tv0,v0,2\n 204:\tbnez\tv0,214 \n 208:\tnop\n 20c:\tsb\tzero,81(a0)\n 210:\tli\ta2,1\n 214:\tjr\tra\n 218:\tmove\tv0,a2\n 21c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-4453acd6f88bb589/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000021c func_8001E104_1ED04\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c85000c 3c030098 3463967f 0065102a ....<...4c...e.*\n 0010 10400003 00003021 0800000b ac83000c .@....0!........\n 0020 04a10004 00001821 ac80000c 24060001 .......!....$...\n 0030 00001821 00832821 90a20010 2c420006 ...!..(!....,B..\n 0040 14400003 00000000 a0a00010 24060001 .@..........$...\n 0050 90a20020 2c420006 14400003 24630001 ... ,B...@..$c..\n 0060 a0a00020 24060001 28620010 1440fff2 ... $...(b...@..\n 0070 00832821 90820010 14400004 00001821 ..(!.....@.....!\n 0080 24020005 a0820010 24060001 24070005 $.......$...$...\n 0090 00832821 90a20020 14400003 00000000 ..(!... .@......\n 00a0 a0a70020 24060001 90a20024 14400003 ... $......$.@..\n 00b0 24630001 a0a70024 24060001 28620003 $c.....$$...(b..\n 00c0 1440fff4 00832821 00001821 00832821 .@....(!...!..(!\n 00d0 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 00e0 a0a00030 24060001 28620012 1440fff8 ...0$...(b...@..\n 00f0 00832821 00001821 00802821 90a20030 ..(!...!..(!...0\n 0100 54400005 24630001 24620001 a0a20030 T@..$c..$b.....0\n 0110 24060001 24630001 28620003 1440fff7 $...$c..(b...@..\n 0120 24a50003 00001821 24070001 00832821 $......!$.....(!\n 0130 90a20030 2c42001a 14400003 24630001 ...0,B...@..$c..\n 0140 a0a70030 24060001 28620012 1440fff8 ...0$...(b...@..\n 0150 00832821 00001821 24070011 00832821 ..(!...!$.....(!\n 0160 90a20042 2c420012 14400003 24630001 ...B,B...@..$c..\n 0170 a0a70042 24060001 28620009 1440fff8 ...B$...(b...@..\n 0180 00832821 00001821 2407000f 00832821 ..(!...!$.....(!\n 0190 90a2004b 2c420010 14400003 24630001 ...K,B...@..$c..\n 01a0 a0a7004b 24060001 28620003 1440fff8 ...K$...(b...@..\n 01b0 00832821 9082004e 2c420002 14400003 ..(!...N,B...@..\n 01c0 00000000 a080004e 24060001 9082004f .......N$......O\n 01d0 2c420002 14400003 00000000 a080004f ,B...@.........O\n 01e0 24060001 90820050 2c420002 14400003 $......P,B...@..\n 01f0 00000000 a0800050 24060001 90820051 .......P$......Q\n 0200 2c420002 14400003 00000000 a0800051 ,B...@.........Q\n 0210 24060001 03e00008 00c01021 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 ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8001E104_1ED04 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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":["branch","compare","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021C00_22800\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 255\n bne\t$v1, $v0, .L38\n li\t$v0, 1\n lui\t$a0, %hi(func_80021D00_22900)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80021D00_22900)\n j\t.L4c\n nop\n.L38:\n bne\t$v1, $v0, .L4c\n nop\n lui\t$a0, %hi(func_80021C58_22858)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021C58_22858)\n.L4c:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021C00_22800(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021C00_22800 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021D88_22988:gcc2.7.2kmc","sym":"func_80021D88_22988","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021D88_22988\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tgetCurrentAllocation\n nop\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 1\n bne\t$v1, $v0, .L40\n li\t$v0, 255\n lui\t$a0, %hi(func_80021DE8_229E8)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021DE8_229E8)\n j\t.L54\n nop\n.L40:\n bne\t$v1, $v0, .L54\n nop\n lui\t$a0, %hi(func_80022108_22D08)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80022108_22D08)\n.L54:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021D88_22988(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021D88_22988 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc","sym":"func_80028BB0_297B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028BB0_297B0' — lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\tlhu\ta1,44(s0) */\n/* 24:\taddiu\ta0,s0,4 */\n/* 28:\tandi\tv0,v0,0xf */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\tv0,90(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,20(sp) */\n/* 4c:\tlw\ts0,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80028BB0_297B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028BB0_297B0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n lhu\t$a1, 44($s0)\n addiu\t$a0, $s0, 4\n andi\t$v0, $v0, 0xf\n jal\tcreateYRotationMatrix\n sh\t$v0, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028C08_29808)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028C08_29808)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028BB0_297B0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028BB0_297B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028D90_29990:gcc2.7.2kmc","sym":"func_80028D90_29990","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028D90_29990' — lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\taddiu\ta0,s0,4 */\n/* 24:\tlhu\tv1,90(s0) */\n/* 28:\tlhu\ta1,44(s0) */\n/* 2c:\tandi\tv0,v0,0xf */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\tjal\t0 */\n/* 38:\tsh\tv1,90(s0) */\n/* 3c:\tjal\t0 */\n/* 40:\tmove\ta0,s0 */\n/* 44:\tlui\ta0,0x0 */\n/* 48:\tjal\t0 */\n/* 4c:\taddiu\ta0,a0,0 */\n/* 50:\tlw\tra,20(sp) */\n/* 54:\tlw\ts0,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80028D90_29990(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = (u16) arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028D90_29990\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n addiu\t$a0, $s0, 4\n lhu\t$v1, 90($s0)\n lhu\t$a1, 44($s0)\n andi\t$v0, $v0, 0xf\n addu\t$v1, $v1, $v0\n jal\tcreateYRotationMatrix\n sh\t$v1, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028DF0_299F0)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028DF0_299F0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028D90_29990(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028D90_29990 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc","sym":"func_8002A2D0_2AED0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","bitwise","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A2D0_2AED0\n addiu\t$sp, $sp, -32\n sw\t$s0, 24($sp)\n sw\t$ra, 28($sp)\n jal\tgetCurrentAllocation\n move\t$s0, $a0\n lw\t$a0, 0($s0)\n jal\tapplyTransformToModel\n addiu\t$a1, $s0, 4\n lh\t$v1, 80($s0)\n lh\t$v0, 82($s0)\n beq\t$v1, $v0, .L44\n move\t$a2, $v1\n lw\t$a0, 0($s0)\n lh\t$a1, 80($s0)\n jal\tsetModelAnimation\n sh\t$a2, 82($s0)\n sb\t$zero, 98($s0)\n.L44:\n lb\t$v1, 98($s0)\n li\t$v0, -1\n beq\t$v1, $v0, .L60\n move\t$v0, $zero\n lw\t$a0, 0($s0)\n jal\tclearModelRotation\n nop\n.L60:\n beqz\t$v0, .La0\n li\t$v1, 1\n lbu\t$v0, 98($s0)\n sb\t$v1, 55($s0)\n lh\t$v1, 80($s0)\n andi\t$v0, $v0, 0x7f\n addiu\t$v0, $v0, 1\n sb\t$v0, 98($s0)\n li\t$v0, 152\n bne\t$v1, $v0, .La0\n li\t$v0, 2\n lbu\t$v1, 94($s0)\n beq\t$v1, $v0, .L9c\n li\t$v0, 144\n lhu\t$v0, 88($s0)\n.L9c:\n sh\t$v0, 80($s0)\n.La0:\n jal\tupdateModelGeometry\n lw\t$a0, 0($s0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002A2D0_2AED0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A2D0_2AED0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc","sym":"func_8002A390_2AF90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","switch","call","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A390_2AF90\n addiu\t$sp, $sp, -32\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n lbu\t$v1, 94($s0)\n move\t$s1, $v0\n slti\t$v0, $v1, 5\n beqzl\t$v0, .L44\n li\t$v0, 68\n bnez\t$v1, .Lc0\n nop\n beqz\t$v1, .L54\n move\t$v0, $zero\n j\t.L108\n nop\n.L44:\n beq\t$v1, $v0, .Le0\n move\t$v0, $zero\n j\t.L108\n nop\n.L54:\n lbu\t$a1, 93($s0)\n jal\tfunc_8002A4AC_2B0AC\n addiu\t$a0, $s0, 4\n bnez\t$v0, .L108\n li\t$v0, 1\n lbu\t$v0, 1057($s1)\n bnez\t$v0, .L108\n move\t$v0, $zero\n lw\t$a0, 24($s0)\n lw\t$a1, 32($s0)\n jal\tfunc_8002ACFC_2B8FC\n lh\t$a2, 46($s0)\n beqz\t$v0, .L108\n move\t$v0, $zero\n lhu\t$v0, 80($s0)\n lbu\t$v1, 93($s0)\n sh\t$v0, 84($s0)\n li\t$v0, 5\n bnel\t$v1, $v0, .Lac\n sh\t$zero, 80($s0)\n li\t$v0, 33\n sh\t$v0, 80($s0)\n.Lac:\n lbu\t$v1, 94($s0)\n li\t$v0, 68\n sb\t$v0, 94($s0)\n j\t.L104\n sb\t$v1, 97($s0)\n.Lc0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n sb\t$zero, 94($s0)\n j\t.L104\n sb\t$v0, 97($s0)\n.Le0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n lhu\t$v1, 84($s0)\n sb\t$zero, 94($s0)\n sb\t$v0, 97($s0)\n sh\t$v1, 80($s0)\n.L104:\n move\t$v0, $zero\n.L108:\n lw\t$ra, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A390_2AF90 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc","sym":"func_8002ACFC_2B8FC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixed-point","branch","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ACFC_2B8FC\n addiu\t$sp, $sp, -40\n sw\t$s2, 24($sp)\n move\t$s2, $a0\n sw\t$s3, 28($sp)\n move\t$s3, $a1\n sw\t$s0, 16($sp)\n move\t$s0, $a2\n sw\t$ra, 32($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n move\t$s1, $v0\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n move\t$a2, $s2\n jal\tfunc_8006D21C_6DE1C\n move\t$a3, $s3\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n addiu\t$v1, $s0, -568\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n slt\t$v1, $v1, $a0\n beqz\t$v1, .L98\n addiu\t$v0, $s0, 568\n slt\t$v0, $a0, $v0\n beqz\t$v0, .L9c\n move\t$v0, $zero\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n subu\t$a0, $a0, $s2\n jal\tdistance_2d\n subu\t$a1, $a1, $s3\n lui\t$v1, 0x28\n slt\t$v1, $v1, $v0\n bnez\t$v1, .L9c\n move\t$v0, $zero\n j\t.L9c\n li\t$v0, 1\n.L98:\n move\t$v0, $zero\n.L9c:\n lw\t$ra, 32($sp)\n lw\t$s3, 28($sp)\n lw\t$s2, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ACFC_2B8FC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc","sym":"func_8002ADB4_2B9B4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixed-point","branch","compare","goto","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ADB4_2B9B4\n move\t$t0, $a0\n sll\t$v0, $a0, 0x10\n sra\t$a2, $v0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v1, $v0, 0x10\n beq\t$a2, $v1, .Lc0\n move\t$a3, $a1\n subu\t$v0, $a2, $v1\n bltzl\t$v0, .L28\n negu\t$v0, $v0\n.L28:\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 4097\n bnez\t$v0, .L50\n sll\t$v0, $t0, 0x10\n slt\t$v0, $v1, $a2\n beqzl\t$v0, .L4c\n addiu\t$t0, $a0, 8192\n addiu\t$a3, $a1, 8192\n.L4c:\n sll\t$v0, $t0, 0x10\n.L50:\n sra\t$a1, $v0, 0x10\n sll\t$v0, $a3, 0x10\n sra\t$v1, $v0, 0x10\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L6c\n move\t$a2, $v0\n negu\t$a2, $a2\n.L6c:\n sll\t$v0, $a2, 0x10\n sra\t$a0, $v0, 0x10\n slti\t$v0, $a0, 2731\n bnezl\t$v0, .L88\n slt\t$v0, $v1, $a1\n j\t.Lc0\n addiu\t$a3, $a3, 4096\n.L88:\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n ori\t$v1, $v0, 0x1\n slti\t$v0, $a0, 128\n bnez\t$v0, .Lac\n nop\n sll\t$v0, $v1, 0x7\n j\t.Lc0\n addu\t$a3, $a3, $v0\n.Lac:\n nop\n mult\t$a2, $v1\n mflo\t$v0\n addu\t$v0, $a3, $v0\n andi\t$a3, $v0, 0x1fff\n.Lc0:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ADB4_2B9B4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc","sym":"func_8002B4B8_2C0B8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","fixed-point","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002B4B8_2C0B8\n andi\t$a0, $a0, 0x1fff\n andi\t$a1, $a1, 0x1fff\n subu\t$a1, $a1, $a0\n andi\t$a1, $a1, 0x1fff\n slti\t$v0, $a1, 4097\n bnez\t$v0, .L20\n move\t$v1, $a1\n ori\t$v1, $a1, 0xe000\n.L20:\n sll\t$v0, $v1, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002B4B8_2C0B8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc","sym":"func_8002BE94_2CA94","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","loop","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002BE94_2CA94\n addiu\t$sp, $sp, -40\n sw\t$s2, 32($sp)\n move\t$s2, $a0\n sw\t$ra, 36($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v0, 213($s2)\n blez\t$v0, .L48\n move\t$s1, $zero\n move\t$s0, $s2\n.L28:\n lw\t$a0, 0($s0)\n jal\tdestroySceneModel\n addiu\t$s1, $s1, 1\n sw\t$v0, 0($s0)\n lbu\t$v0, 213($s2)\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L28\n addiu\t$s0, $s0, 100\n.L48:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002BE94_2CA94 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc","sym":"func_80035F80_36B80","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","cast","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80035F80_36B80\n addiu\t$sp, $sp, -24\n andi\t$a0, $a0, 0xff\n li\t$v0, 1\n bne\t$a0, $v0, .L2c\n sw\t$ra, 16($sp)\n lui\t$a0, %hi(_459E00_ROM_START)\n addiu\t$a0, $a0, %lo(_459E00_ROM_START)\n lui\t$a1, %hi(_459E00_ROM_END)\n addiu\t$a1, $a1, %lo(_459E00_ROM_END)\n j\t.L40\n li\t$a2, 8936\n.L2c:\n lui\t$a0, %hi(_3F6950_ROM_START)\n addiu\t$a0, $a0, %lo(_3F6950_ROM_START)\n lui\t$a1, %hi(_3F6950_ROM_END)\n addiu\t$a1, $a1, %lo(_3F6950_ROM_END)\n li\t$a2, 1288\n.L40:\n jal\tloadCompressedData\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80035F80_36B80(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80035F80_36B80 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc","sym":"func_80037FE0_38BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["array","global","compare","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80037FE0_38BE0\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n andi\t$a0, $a0, 0xff\n addu\t$v0, $v0, $a0\n lbu\t$v0, 16($v0)\n xori\t$v0, $v0, 0x1\n jr\t$ra\n sltiu\t$v0, $v0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80037FE0_38BE0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038000_38C00:gcc2.7.2kmc","sym":"func_80038000_38C00","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","struct","field","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80038000_38C00\n andi\t$a0, $a0, 0xff\n sltiu\t$v0, $a0, 6\n bnez\t$v0, .L50\n li\t$v0, 1\n li\t$v0, 6\n bne\t$a0, $v0, .L2c\n li\t$v0, 7\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 78($v0)\n.L2c:\n beq\t$a0, $v0, .L44\n nop\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 80($v0)\n.L44:\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n lbu\t$v0, 79($v0)\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038000_38C00 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038090_38C90:gcc2.7.2kmc","sym":"func_80038090_38C90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","bitwise","call"],"loc":79,"refSource":"void func_80038090_38C90(s16 arg0) {\n u8 temp;\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xB) {\n EepromSaveData->setting_4E = 1;\n func_800383D8_38FD8(0xF);\n }\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xE) {\n EepromSaveData->setting_4F = 1;\n func_800383D8_38FD8(0xD);\n }\n\n temp = D_800AFE8C_A71FC->saveSlotIndex;\n if (temp == 0xD) {\n if (arg0 == 7) {\n EepromSaveData->setting_50 = 1;\n func_800383D8_38FD8(0xE);\n }\n }\n\n if (D_800AFE8C_A71FC->unk24 != 0) {\n if (D_800AFE8C_A71FC->saveSlotIndex == 1) {\n if (func_80038388_38F88(0xA) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 2;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 3) {\n if (func_80038388_38F88(0xB) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 3;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 9) {\n if (func_80038388_38F88(0xC) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 4;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 5) {\n if (func_80038388_38F88(0xE) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 6;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 8) {\n if (func_80038388_38F88(0xF) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 7;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xB) {\n if (func_80038388_38F88(0x10) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 8;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 0) {\n if (func_80038388_38F88(0xD) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 5;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 4) {\n if (func_80038388_38F88(9) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 1;\n }\n }\n\n if (D_800AFE8C_A71FC->saveSlotIndex == 7) {\n if (func_80038388_38F88(0x11) & 0xFF) {\n D_800AFE8C_A71FC->errorFlag = 9;\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38C90.c#L8-L86","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:\taddiu\tsp,sp,-24\n c:\tsw\tra,20(sp)\n 10:\tsw\ts0,16(sp)\n 14:\tlbu\tv1,7(v0)\n 18:\tli\tv0,11\n 1c:\tbne\tv1,v0,3c \n 20:\tmove\ts0,a0\n 24:\tlui\tv1,0x0\n 28:\tlw\tv1,0(v1)\n 2c:\tli\ta0,15\n 30:\tli\tv0,1\n 34:\tjal\t0 \n 38:\tsb\tv0,78(v1)\n 3c:\tlui\tv0,0x0\n 40:\tlw\tv0,0(v0)\n 44:\tlbu\tv1,7(v0)\n 48:\tli\tv0,14\n 4c:\tbne\tv1,v0,68 \n 50:\tli\ta0,13\n 54:\tlui\tv1,0x0\n 58:\tlw\tv1,0(v1)\n 5c:\tli\tv0,1\n 60:\tjal\t0 \n 64:\tsb\tv0,79(v1)\n 68:\tlui\tv0,0x0\n 6c:\tlw\tv0,0(v0)\n 70:\tlbu\tv1,7(v0)\n 74:\tli\tv0,13\n 78:\tbne\tv1,v0,a4 \n 7c:\tsll\tv0,s0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tli\tv1,7\n 88:\tbne\tv0,v1,a4 \n 8c:\tli\ta0,14\n 90:\tlui\tv1,0x0\n 94:\tlw\tv1,0(v1)\n 98:\tli\tv0,1\n 9c:\tjal\t0 \n a0:\tsb\tv0,80(v1)\n a4:\tlui\tv1,0x0\n a8:\tlw\tv1,0(v1)\n ac:\tlbu\tv0,36(v1)\n b0:\tbeqz\tv0,2a0 \n b4:\tli\tv0,1\n b8:\tlbu\tv1,7(v1)\n bc:\tbne\tv1,v0,e4 \n c0:\tnop\n c4:\tjal\t0 \n c8:\tli\ta0,10\n cc:\tandi\tv0,v0,0xff\n d0:\tbeqz\tv0,e4 \n d4:\tli\tv0,2\n d8:\tlui\tv1,0x0\n dc:\tlw\tv1,0(v1)\n e0:\tsb\tv0,35(v1)\n e4:\tlui\tv0,0x0\n e8:\tlw\tv0,0(v0)\n ec:\tlbu\tv1,7(v0)\n f0:\tli\tv0,3\n f4:\tbne\tv1,v0,11c \n f8:\tnop\n fc:\tjal\t0 \n 100:\tli\ta0,11\n 104:\tandi\tv0,v0,0xff\n 108:\tbeqz\tv0,11c \n 10c:\tli\tv0,3\n 110:\tlui\tv1,0x0\n 114:\tlw\tv1,0(v1)\n 118:\tsb\tv0,35(v1)\n 11c:\tlui\tv0,0x0\n 120:\tlw\tv0,0(v0)\n 124:\tlbu\tv1,7(v0)\n 128:\tli\tv0,9\n 12c:\tbne\tv1,v0,154 \n 130:\tnop\n 134:\tjal\t0 \n 138:\tli\ta0,12\n 13c:\tandi\tv0,v0,0xff\n 140:\tbeqz\tv0,154 \n 144:\tli\tv0,4\n 148:\tlui\tv1,0x0\n 14c:\tlw\tv1,0(v1)\n 150:\tsb\tv0,35(v1)\n 154:\tlui\tv0,0x0\n 158:\tlw\tv0,0(v0)\n 15c:\tlbu\tv1,7(v0)\n 160:\tli\tv0,5\n 164:\tbne\tv1,v0,18c \n 168:\tnop\n 16c:\tjal\t0 \n 170:\tli\ta0,14\n 174:\tandi\tv0,v0,0xff\n 178:\tbeqz\tv0,18c \n 17c:\tli\tv0,6\n 180:\tlui\tv1,0x0\n 184:\tlw\tv1,0(v1)\n 188:\tsb\tv0,35(v1)\n 18c:\tlui\tv0,0x0\n 190:\tlw\tv0,0(v0)\n 194:\tlbu\tv1,7(v0)\n 198:\tli\tv0,8\n 19c:\tbne\tv1,v0,1c4 \n 1a0:\tnop\n 1a4:\tjal\t0 \n 1a8:\tli\ta0,15\n 1ac:\tandi\tv0,v0,0xff\n 1b0:\tbeqz\tv0,1c4 \n 1b4:\tli\tv0,7\n 1b8:\tlui\tv1,0x0\n 1bc:\tlw\tv1,0(v1)\n 1c0:\tsb\tv0,35(v1)\n 1c4:\tlui\tv0,0x0\n 1c8:\tlw\tv0,0(v0)\n 1cc:\tlbu\tv1,7(v0)\n 1d0:\tli\tv0,11\n 1d4:\tbne\tv1,v0,1fc \n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tli\ta0,16\n 1e4:\tandi\tv0,v0,0xff\n 1e8:\tbeqz\tv0,1fc \n 1ec:\tli\tv0,8\n 1f0:\tlui\tv1,0x0\n 1f4:\tlw\tv1,0(v1)\n 1f8:\tsb\tv0,35(v1)\n 1fc:\tlui\tv0,0x0\n 200:\tlw\tv0,0(v0)\n 204:\tlbu\tv0,7(v0)\n 208:\tbnez\tv0,230 \n 20c:\tnop\n 210:\tjal\t0 \n 214:\tli\ta0,13\n 218:\tandi\tv0,v0,0xff\n 21c:\tbeqz\tv0,230 \n 220:\tli\tv0,5\n 224:\tlui\tv1,0x0\n 228:\tlw\tv1,0(v1)\n 22c:\tsb\tv0,35(v1)\n 230:\tlui\tv0,0x0\n 234:\tlw\tv0,0(v0)\n 238:\tlbu\tv1,7(v0)\n 23c:\tli\tv0,4\n 240:\tbne\tv1,v0,268 \n 244:\tnop\n 248:\tjal\t0 \n 24c:\tli\ta0,9\n 250:\tandi\tv0,v0,0xff\n 254:\tbeqz\tv0,268 \n 258:\tli\tv0,1\n 25c:\tlui\tv1,0x0\n 260:\tlw\tv1,0(v1)\n 264:\tsb\tv0,35(v1)\n 268:\tlui\tv0,0x0\n 26c:\tlw\tv0,0(v0)\n 270:\tlbu\tv1,7(v0)\n 274:\tli\tv0,7\n 278:\tbne\tv1,v0,2a0 \n 27c:\tnop\n 280:\tjal\t0 \n 284:\tli\ta0,17\n 288:\tandi\tv0,v0,0xff\n 28c:\tbeqz\tv0,2a0 \n 290:\tli\tv0,9\n 294:\tlui\tv1,0x0\n 298:\tlw\tv1,0(v1)\n 29c:\tsb\tv0,35(v1)\n 2a0:\tlw\tra,20(sp)\n 2a4:\tlw\ts0,16(sp)\n 2a8:\tjr\tra\n 2ac:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-61ff2cd29f43.i.gz","proto":{"func_80038090_38C90":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-df837f696b53489d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000002b0 func_80038090_38C90\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n00000000 *UND*\t00000000 EepromSaveData\n00000000 *UND*\t00000000 func_800383D8_38FD8\n00000000 *UND*\t00000000 func_80038388_38F88\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800AFE8C_A71FC\n00000004 R_MIPS_LO16 D_800AFE8C_A71FC\n00000024 R_MIPS_HI16 EepromSaveData\n00000028 R_MIPS_LO16 EepromSaveData\n00000034 R_MIPS_26 func_800383D8_38FD8\n0000003c R_MIPS_HI16 D_800AFE8C_A71FC\n00000040 R_MIPS_LO16 D_800AFE8C_A71FC\n00000054 R_MIPS_HI16 EepromSaveData\n00000058 R_MIPS_LO16 EepromSaveData\n00000060 R_MIPS_26 func_800383D8_38FD8\n00000068 R_MIPS_HI16 D_800AFE8C_A71FC\n0000006c R_MIPS_LO16 D_800AFE8C_A71FC\n00000090 R_MIPS_HI16 EepromSaveData\n00000094 R_MIPS_LO16 EepromSaveData\n0000009c R_MIPS_26 func_800383D8_38FD8\n000000a4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000a8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000c4 R_MIPS_26 func_80038388_38F88\n000000d8 R_MIPS_HI16 D_800AFE8C_A71FC\n000000dc R_MIPS_LO16 D_800AFE8C_A71FC\n000000e4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000e8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000fc R_MIPS_26 func_80038388_38F88\n00000110 R_MIPS_HI16 D_800AFE8C_A71FC\n00000114 R_MIPS_LO16 D_800AFE8C_A71FC\n0000011c R_MIPS_HI16 D_800AFE8C_A71FC\n00000120 R_MIPS_LO16 D_800AFE8C_A71FC\n00000134 R_MIPS_26 func_80038388_38F88\n00000148 R_MIPS_HI16 D_800AFE8C_A71FC\n0000014c R_MIPS_LO16 D_800AFE8C_A71FC\n00000154 R_MIPS_HI16 D_800AFE8C_A71FC\n00000158 R_MIPS_LO16 D_800AFE8C_A71FC\n0000016c R_MIPS_26 func_80038388_38F88\n00000180 R_MIPS_HI16 D_800AFE8C_A71FC\n00000184 R_MIPS_LO16 D_800AFE8C_A71FC\n0000018c R_MIPS_HI16 D_800AFE8C_A71FC\n00000190 R_MIPS_LO16 D_800AFE8C_A71FC\n000001a4 R_MIPS_26 func_80038388_38F88\n000001b8 R_MIPS_HI16 D_800AFE8C_A71FC\n000001bc R_MIPS_LO16 D_800AFE8C_A71FC\n000001c4 R_MIPS_HI16 D_800AFE8C_A71FC\n000001c8 R_MIPS_LO16 D_800AFE8C_A71FC\n000001dc R_MIPS_26 func_80038388_38F88\n000001f0 R_MIPS_HI16 D_800AFE8C_A71FC\n000001f4 R_MIPS_LO16 D_800AFE8C_A71FC\n000001fc R_MIPS_HI16 D_800AFE8C_A71FC\n00000200 R_MIPS_LO16 D_800AFE8C_A71FC\n00000210 R_MIPS_26 func_80038388_38F88\n00000224 R_MIPS_HI16 D_800AFE8C_A71FC\n00000228 R_MIPS_LO16 D_800AFE8C_A71FC\n00000230 R_MIPS_HI16 D_800AFE8C_A71FC\n00000234 R_MIPS_LO16 D_800AFE8C_A71FC\n00000248 R_MIPS_26 func_80038388_38F88\n0000025c R_MIPS_HI16 D_800AFE8C_A71FC\n00000260 R_MIPS_LO16 D_800AFE8C_A71FC\n00000268 R_MIPS_HI16 D_800AFE8C_A71FC\n0000026c R_MIPS_LO16 D_800AFE8C_A71FC\n00000280 R_MIPS_26 func_80038388_38F88\n00000294 R_MIPS_HI16 D_800AFE8C_A71FC\n00000298 R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 3c020000 8c420000 27bdffe8 afbf0014 <....B..'.......\n 0010 afb00010 90430007 2402000b 14620007 .....C..$....b..\n 0020 00808021 3c030000 8c630000 2404000f ...!<....c..$...\n 0030 24020001 0c000000 a062004e 3c020000 $........b.N<...\n 0040 8c420000 90430007 2402000e 14620006 .B...C..$....b..\n 0050 2404000d 3c030000 8c630000 24020001 $...<....c..$...\n 0060 0c000000 a062004f 3c020000 8c420000 .....b.O<....B..\n 0070 90430007 2402000d 1462000a 00101400 .C..$....b......\n 0080 00021403 24030007 14430006 2404000e ....$....C..$...\n 0090 3c030000 8c630000 24020001 0c000000 <....c..$.......\n 00a0 a0620050 3c030000 8c630000 90620024 .b.P<....c...b.$\n 00b0 1040007b 24020001 90630007 14620009 .@.{$....c...b..\n 00c0 00000000 0c000000 2404000a 304200ff ........$...0B..\n 00d0 10400004 24020002 3c030000 8c630000 .@..$...<....c..\n 00e0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 00f0 24020003 14620009 00000000 0c000000 $....b..........\n 0100 2404000b 304200ff 10400004 24020003 $...0B...@..$...\n 0110 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0120 8c420000 90430007 24020009 14620009 .B...C..$....b..\n 0130 00000000 0c000000 2404000c 304200ff ........$...0B..\n 0140 10400004 24020004 3c030000 8c630000 .@..$...<....c..\n 0150 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 0160 24020005 14620009 00000000 0c000000 $....b..........\n 0170 2404000e 304200ff 10400004 24020006 $...0B...@..$...\n 0180 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0190 8c420000 90430007 24020008 14620009 .B...C..$....b..\n 01a0 00000000 0c000000 2404000f 304200ff ........$...0B..\n 01b0 10400004 24020007 3c030000 8c630000 .@..$...<....c..\n 01c0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 01d0 2402000b 14620009 00000000 0c000000 $....b..........\n 01e0 24040010 304200ff 10400004 24020008 $...0B...@..$...\n 01f0 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0200 8c420000 90420007 14400009 00000000 .B...B...@......\n 0210 0c000000 2404000d 304200ff 10400004 ....$...0B...@..\n 0220 24020005 3c030000 8c630000 a0620023 $...<....c...b.#\n 0230 3c020000 8c420000 90430007 24020004 <....B...C..$...\n 0240 14620009 00000000 0c000000 24040009 .b..........$...\n 0250 304200ff 10400004 24020001 3c030000 0B...@..$...<...\n 0260 8c630000 a0620023 3c020000 8c420000 .c...b.#<....B..\n 0270 90430007 24020007 14620009 00000000 .C..$....b......\n 0280 0c000000 24040011 304200ff 10400004 ....$...0B...@..\n 0290 24020009 3c030000 8c630000 a0620023 $...<....c...b.#\n 02a0 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_80038090_38C90' — lift: cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tv0,0x0 */\n/* 4:\tlw\tv0,0(v0) */\n/* 8:\taddiu\tsp,sp,-24 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsw\ts0,16(sp) */\n/* 14:\tlbu\tv1,7(v0) */\n/* 18:\tli\tv0,11 */\n/* 1c:\tbne\tv1,v0,3c */\n/* 20:\tmove\ts0,a0 */\n/* 24:\tlui\tv1,0x0 */\n/* 28:\tlw\tv1,0(v1) */\n/* 2c:\tli\ta0,15 */\n/* 30:\tli\tv0,1 */\n/* 34:\tjal\t0 */\n/* 38:\tsb\tv0,78(v1) */\n/* 3c:\tlui\tv0,0x0 */\n/* 40:\tlw\tv0,0(v0) */\n/* 44:\tlbu\tv1,7(v0) */\n/* 48:\tli\tv0,14 */\n/* 4c:\tbne\tv1,v0,68 */\n/* 50:\tli\ta0,13 */\n/* 54:\tlui\tv1,0x0 */\n/* 58:\tlw\tv1,0(v1) */\n/* 5c:\tli\tv0,1 */\n/* 60:\tjal\t0 */\n/* 64:\tsb\tv0,79(v1) */\n/* 68:\tlui\tv0,0x0 */\n/* 6c:\tlw\tv0,0(v0) */\n/* 70:\tlbu\tv1,7(v0) */\n/* 74:\tli\tv0,13 */\n/* 78:\tbne\tv1,v0,a4 */\n/* 7c:\tsll\tv0,s0,0x10 */\n/* 80:\tsra\tv0,v0,0x10 */\n/* 84:\tli\tv1,7 */\n/* 88:\tbne\tv0,v1,a4 */\n/* 8c:\tli\ta0,14 */\n/* 90:\tlui\tv1,0x0 */\n/* 94:\tlw\tv1,0(v1) */\n/* 98:\tli\tv0,1 */\n/* 9c:\tjal\t0 */\n/* a0:\tsb\tv0,80(v1) */\n/* a4:\tlui\tv1,0x0 */\n/* a8:\tlw\tv1,0(v1) */\n/* ac:\tlbu\tv0,36(v1) */\n/* b0:\tbeqz\tv0,2a0 */\n/* b4:\tli\tv0,1 */\n/* b8:\tlbu\tv1,7(v1) */\n/* bc:\tbne\tv1,v0,e4 */\n/* c0:\tnop */\n/* c4:\tjal\t0 */\n/* c8:\tli\ta0,10 */\n/* cc:\tandi\tv0,v0,0xff */\n/* d0:\tbeqz\tv0,e4 */\n/* d4:\tli\tv0,2 */\n/* d8:\tlui\tv1,0x0 */\n/* dc:\tlw\tv1,0(v1) */\n/* e0:\tsb\tv0,35(v1) */\n/* e4:\tlui\tv0,0x0 */\n/* e8:\tlw\tv0,0(v0) */\n/* ec:\tlbu\tv1,7(v0) */\n/* f0:\tli\tv0,3 */\n/* f4:\tbne\tv1,v0,11c */\n/* f8:\tnop */\n/* fc:\tjal\t0 */\n/* 100:\tli\ta0,11 */\n/* 104:\tandi\tv0,v0,0xff */\n/* 108:\tbeqz\tv0,11c */\n/* 10c:\tli\tv0,3 */\n/* 110:\tlui\tv1,0x0 */\n/* 114:\tlw\tv1,0(v1) */\n/* 118:\tsb\tv0,35(v1) */\n/* 11c:\tlui\tv0,0x0 */\n/* 120:\tlw\tv0,0(v0) */\n/* 124:\tlbu\tv1,7(v0) */\n/* 128:\tli\tv0,9 */\n/* 12c:\tbne\tv1,v0,154 */\n/* 130:\tnop */\n/* 134:\tjal\t0 */\n/* 138:\tli\ta0,12 */\n/* 13c:\tandi\tv0,v0,0xff */\n/* 140:\tbeqz\tv0,154 */\n/* 144:\tli\tv0,4 */\n/* 148:\tlui\tv1,0x0 */\n/* 14c:\tlw\tv1,0(v1) */\n/* 150:\tsb\tv0,35(v1) */\n/* 154:\tlui\tv0,0x0 */\n/* 158:\tlw\tv0,0(v0) */\n/* 15c:\tlbu\tv1,7(v0) */\n/* 160:\tli\tv0,5 */\n/* 164:\tbne\tv1,v0,18c */\n/* 168:\tnop */\n/* 16c:\tjal\t0 */\n/* 170:\tli\ta0,14 */\n/* 174:\tandi\tv0,v0,0xff */\n/* 178:\tbeqz\tv0,18c */\n/* 17c:\tli\tv0,6 */\n/* 180:\tlui\tv1,0x0 */\n/* 184:\tlw\tv1,0(v1) */\n/* 188:\tsb\tv0,35(v1) */\n/* 18c:\tlui\tv0,0x0 */\n/* 190:\tlw\tv0,0(v0) */\n/* 194:\tlbu\tv1,7(v0) */\n/* 198:\tli\tv0,8 */\n/* 19c:\tbne\tv1,v0,1c4 */\n/* 1a0:\tnop */\n/* 1a4:\tjal\t0 */\n/* 1a8:\tli\ta0,15 */\n/* 1ac:\tandi\tv0,v0,0xff */\n/* 1b0:\tbeqz\tv0,1c4 */\n/* 1b4:\tli\tv0,7 */\n/* 1b8:\tlui\tv1,0x0 */\n/* 1bc:\tlw\tv1,0(v1) */\n/* 1c0:\tsb\tv0,35(v1) */\n/* 1c4:\tlui\tv0,0x0 */\n/* 1c8:\tlw\tv0,0(v0) */\n/* 1cc:\tlbu\tv1,7(v0) */\n/* 1d0:\tli\tv0,11 */\n/* 1d4:\tbne\tv1,v0,1fc */\n/* 1d8:\tnop */\n/* 1dc:\tjal\t0 */\n/* 1e0:\tli\ta0,16 */\n/* 1e4:\tandi\tv0,v0,0xff */\n/* 1e8:\tbeqz\tv0,1fc */\n/* 1ec:\tli\tv0,8 */\n/* 1f0:\tlui\tv1,0x0 */\n/* 1f4:\tlw\tv1,0(v1) */\n/* 1f8:\tsb\tv0,35(v1) */\n/* 1fc:\tlui\tv0,0x0 */\n/* 200:\tlw\tv0,0(v0) */\n/* 204:\tlbu\tv0,7(v0) */\n/* 208:\tbnez\tv0,230 */\n/* 20c:\tnop */\n/* 210:\tjal\t0 */\n/* 214:\tli\ta0,13 */\n/* 218:\tandi\tv0,v0,0xff */\n/* 21c:\tbeqz\tv0,230 */\n/* 220:\tli\tv0,5 */\n/* 224:\tlui\tv1,0x0 */\n/* 228:\tlw\tv1,0(v1) */\n/* 22c:\tsb\tv0,35(v1) */\n/* 230:\tlui\tv0,0x0 */\n/* 234:\tlw\tv0,0(v0) */\n/* 238:\tlbu\tv1,7(v0) */\n/* 23c:\tli\tv0,4 */\n/* 240:\tbne\tv1,v0,268 */\n/* 244:\tnop */\n/* 248:\tjal\t0 */\n/* 24c:\tli\ta0,9 */\n/* 250:\tandi\tv0,v0,0xff */\n/* 254:\tbeqz\tv0,268 */\n/* 258:\tli\tv0,1 */\n/* 25c:\tlui\tv1,0x0 */\n/* 260:\tlw\tv1,0(v1) */\n/* 264:\tsb\tv0,35(v1) */\n/* 268:\tlui\tv0,0x0 */\n/* 26c:\tlw\tv0,0(v0) */\n/* 270:\tlbu\tv1,7(v0) */\n/* 274:\tli\tv0,7 */\n/* 278:\tbne\tv1,v0,2a0 */\n/* 27c:\tnop */\n/* 280:\tjal\t0 */\n/* 284:\tli\ta0,17 */\n/* 288:\tandi\tv0,v0,0xff */\n/* 28c:\tbeqz\tv0,2a0 */\n/* 290:\tli\tv0,9 */\n/* 294:\tlui\tv1,0x0 */\n/* 298:\tlw\tv1,0(v1) */\n/* 29c:\tsb\tv0,35(v1) */\n/* 2a0:\tlw\tra,20(sp) */\n/* 2a4:\tlw\ts0,16(sp) */\n/* 2a8:\tjr\tra */\n/* 2ac:\taddiu\tsp,sp,24 */\nvoid func_80038090_38C90(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":180,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80038090_38C90': function call 'jal' at 0x34 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 func_80038388_38F88(?); /* extern */\n? func_800383D8_38FD8(?); /* extern */\n\nvoid func_80038090_38C90(s16 arg0) {\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xB) {\n EepromSaveData->setting_4E = 1;\n func_800383D8_38FD8(0xF);\n }\n if (D_800AFE8C_A71FC->saveSlotIndex == 0xE) {\n EepromSaveData->setting_4F = 1;\n func_800383D8_38FD8(0xD);\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0xD) && (arg0 == 7)) {\n EepromSaveData->setting_50 = 1;\n func_800383D8_38FD8(0xE);\n }\n if (D_800AFE8C_A71FC->unk24 != 0) {\n if ((D_800AFE8C_A71FC->saveSlotIndex == 1) && (func_80038388_38F88(0xA) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 2;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 3) && (func_80038388_38F88(0xB) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 3;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 9) && (func_80038388_38F88(0xC) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 4;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 5) && (func_80038388_38F88(0xE) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 6;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 8) && (func_80038388_38F88(0xF) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 7;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0xB) && (func_80038388_38F88(0x10) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 8;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 0) && (func_80038388_38F88(0xD) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 5;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 4) && (func_80038388_38F88(9) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 1;\n }\n if ((D_800AFE8C_A71FC->saveSlotIndex == 7) && (func_80038388_38F88(0x11) & 0xFF)) {\n D_800AFE8C_A71FC->errorFlag = 9;\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":45,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80038090_38C90` — benchmark function snowboardkids2:func_80038090_38C90:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_80038090_38C90\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$s0, 16($sp)\n lbu\t$v1, 7($v0)\n li\t$v0, 11\n bne\t$v1, $v0, .L3c\n move\t$s0, $a0\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$a0, 15\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 78($v1)\n.L3c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 14\n bne\t$v1, $v0, .L68\n li\t$a0, 13\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 79($v1)\n.L68:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 13\n bne\t$v1, $v0, .La4\n sll\t$v0, $s0, 0x10\n sra\t$v0, $v0, 0x10\n li\t$v1, 7\n bne\t$v0, $v1, .La4\n li\t$a0, 14\n lui\t$v1, %hi(EepromSaveData)\n lw\t$v1, %lo(EepromSaveData)($v1)\n li\t$v0, 1\n jal\tfunc_800383D8_38FD8\n sb\t$v0, 80($v1)\n.La4:\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n lbu\t$v0, 36($v1)\n beqz\t$v0, .L2a0\n li\t$v0, 1\n lbu\t$v1, 7($v1)\n bne\t$v1, $v0, .Le4\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 10\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .Le4\n li\t$v0, 2\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.Le4:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 3\n bne\t$v1, $v0, .L11c\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 11\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L11c\n li\t$v0, 3\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L11c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 9\n bne\t$v1, $v0, .L154\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 12\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L154\n li\t$v0, 4\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L154:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 5\n bne\t$v1, $v0, .L18c\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 14\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L18c\n li\t$v0, 6\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L18c:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 8\n bne\t$v1, $v0, .L1c4\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 15\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L1c4\n li\t$v0, 7\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L1c4:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 11\n bne\t$v1, $v0, .L1fc\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 16\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L1fc\n li\t$v0, 8\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L1fc:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 7($v0)\n bnez\t$v0, .L230\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 13\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L230\n li\t$v0, 5\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L230:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 4\n bne\t$v1, $v0, .L268\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 9\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L268\n li\t$v0, 1\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L268:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v1, 7($v0)\n li\t$v0, 7\n bne\t$v1, $v0, .L2a0\n nop\n jal\tfunc_80038388_38F88\n li\t$a0, 17\n andi\t$v0, $v0, 0xff\n beqz\t$v0, .L2a0\n li\t$v0, 9\n lui\t$v1, %hi(D_800AFE8C_A71FC)\n lw\t$v1, %lo(D_800AFE8C_A71FC)($v1)\n sb\t$v0, 35($v1)\n.L2a0:\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-61ff2cd29f43.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80038090_38C90(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038090_38C90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038090_38C90` — benchmark function snowboardkids2:func_80038090_38C90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038090_38C90: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:\taddiu\tsp,sp,-24\n c:\tsw\tra,20(sp)\n 10:\tsw\ts0,16(sp)\n 14:\tlbu\tv1,7(v0)\n 18:\tli\tv0,11\n 1c:\tbne\tv1,v0,3c \n 20:\tmove\ts0,a0\n 24:\tlui\tv1,0x0\n 28:\tlw\tv1,0(v1)\n 2c:\tli\ta0,15\n 30:\tli\tv0,1\n 34:\tjal\t0 \n 38:\tsb\tv0,78(v1)\n 3c:\tlui\tv0,0x0\n 40:\tlw\tv0,0(v0)\n 44:\tlbu\tv1,7(v0)\n 48:\tli\tv0,14\n 4c:\tbne\tv1,v0,68 \n 50:\tli\ta0,13\n 54:\tlui\tv1,0x0\n 58:\tlw\tv1,0(v1)\n 5c:\tli\tv0,1\n 60:\tjal\t0 \n 64:\tsb\tv0,79(v1)\n 68:\tlui\tv0,0x0\n 6c:\tlw\tv0,0(v0)\n 70:\tlbu\tv1,7(v0)\n 74:\tli\tv0,13\n 78:\tbne\tv1,v0,a4 \n 7c:\tsll\tv0,s0,0x10\n 80:\tsra\tv0,v0,0x10\n 84:\tli\tv1,7\n 88:\tbne\tv0,v1,a4 \n 8c:\tli\ta0,14\n 90:\tlui\tv1,0x0\n 94:\tlw\tv1,0(v1)\n 98:\tli\tv0,1\n 9c:\tjal\t0 \n a0:\tsb\tv0,80(v1)\n a4:\tlui\tv1,0x0\n a8:\tlw\tv1,0(v1)\n ac:\tlbu\tv0,36(v1)\n b0:\tbeqz\tv0,2a0 \n b4:\tli\tv0,1\n b8:\tlbu\tv1,7(v1)\n bc:\tbne\tv1,v0,e4 \n c0:\tnop\n c4:\tjal\t0 \n c8:\tli\ta0,10\n cc:\tandi\tv0,v0,0xff\n d0:\tbeqz\tv0,e4 \n d4:\tli\tv0,2\n d8:\tlui\tv1,0x0\n dc:\tlw\tv1,0(v1)\n e0:\tsb\tv0,35(v1)\n e4:\tlui\tv0,0x0\n e8:\tlw\tv0,0(v0)\n ec:\tlbu\tv1,7(v0)\n f0:\tli\tv0,3\n f4:\tbne\tv1,v0,11c \n f8:\tnop\n fc:\tjal\t0 \n 100:\tli\ta0,11\n 104:\tandi\tv0,v0,0xff\n 108:\tbeqz\tv0,11c \n 10c:\tli\tv0,3\n 110:\tlui\tv1,0x0\n 114:\tlw\tv1,0(v1)\n 118:\tsb\tv0,35(v1)\n 11c:\tlui\tv0,0x0\n 120:\tlw\tv0,0(v0)\n 124:\tlbu\tv1,7(v0)\n 128:\tli\tv0,9\n 12c:\tbne\tv1,v0,154 \n 130:\tnop\n 134:\tjal\t0 \n 138:\tli\ta0,12\n 13c:\tandi\tv0,v0,0xff\n 140:\tbeqz\tv0,154 \n 144:\tli\tv0,4\n 148:\tlui\tv1,0x0\n 14c:\tlw\tv1,0(v1)\n 150:\tsb\tv0,35(v1)\n 154:\tlui\tv0,0x0\n 158:\tlw\tv0,0(v0)\n 15c:\tlbu\tv1,7(v0)\n 160:\tli\tv0,5\n 164:\tbne\tv1,v0,18c \n 168:\tnop\n 16c:\tjal\t0 \n 170:\tli\ta0,14\n 174:\tandi\tv0,v0,0xff\n 178:\tbeqz\tv0,18c \n 17c:\tli\tv0,6\n 180:\tlui\tv1,0x0\n 184:\tlw\tv1,0(v1)\n 188:\tsb\tv0,35(v1)\n 18c:\tlui\tv0,0x0\n 190:\tlw\tv0,0(v0)\n 194:\tlbu\tv1,7(v0)\n 198:\tli\tv0,8\n 19c:\tbne\tv1,v0,1c4 \n 1a0:\tnop\n 1a4:\tjal\t0 \n 1a8:\tli\ta0,15\n 1ac:\tandi\tv0,v0,0xff\n 1b0:\tbeqz\tv0,1c4 \n 1b4:\tli\tv0,7\n 1b8:\tlui\tv1,0x0\n 1bc:\tlw\tv1,0(v1)\n 1c0:\tsb\tv0,35(v1)\n 1c4:\tlui\tv0,0x0\n 1c8:\tlw\tv0,0(v0)\n 1cc:\tlbu\tv1,7(v0)\n 1d0:\tli\tv0,11\n 1d4:\tbne\tv1,v0,1fc \n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tli\ta0,16\n 1e4:\tandi\tv0,v0,0xff\n 1e8:\tbeqz\tv0,1fc \n 1ec:\tli\tv0,8\n 1f0:\tlui\tv1,0x0\n 1f4:\tlw\tv1,0(v1)\n 1f8:\tsb\tv0,35(v1)\n 1fc:\tlui\tv0,0x0\n 200:\tlw\tv0,0(v0)\n 204:\tlbu\tv0,7(v0)\n 208:\tbnez\tv0,230 \n 20c:\tnop\n 210:\tjal\t0 \n 214:\tli\ta0,13\n 218:\tandi\tv0,v0,0xff\n 21c:\tbeqz\tv0,230 \n 220:\tli\tv0,5\n 224:\tlui\tv1,0x0\n 228:\tlw\tv1,0(v1)\n 22c:\tsb\tv0,35(v1)\n 230:\tlui\tv0,0x0\n 234:\tlw\tv0,0(v0)\n 238:\tlbu\tv1,7(v0)\n 23c:\tli\tv0,4\n 240:\tbne\tv1,v0,268 \n 244:\tnop\n 248:\tjal\t0 \n 24c:\tli\ta0,9\n 250:\tandi\tv0,v0,0xff\n 254:\tbeqz\tv0,268 \n 258:\tli\tv0,1\n 25c:\tlui\tv1,0x0\n 260:\tlw\tv1,0(v1)\n 264:\tsb\tv0,35(v1)\n 268:\tlui\tv0,0x0\n 26c:\tlw\tv0,0(v0)\n 270:\tlbu\tv1,7(v0)\n 274:\tli\tv0,7\n 278:\tbne\tv1,v0,2a0 \n 27c:\tnop\n 280:\tjal\t0 \n 284:\tli\ta0,17\n 288:\tandi\tv0,v0,0xff\n 28c:\tbeqz\tv0,2a0 \n 290:\tli\tv0,9\n 294:\tlui\tv1,0x0\n 298:\tlw\tv1,0(v1)\n 29c:\tsb\tv0,35(v1)\n 2a0:\tlw\tra,20(sp)\n 2a4:\tlw\ts0,16(sp)\n 2a8:\tjr\tra\n 2ac:\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-df837f696b53489d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000002b0 func_80038090_38C90\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n00000000 *UND*\t00000000 EepromSaveData\n00000000 *UND*\t00000000 func_800383D8_38FD8\n00000000 *UND*\t00000000 func_80038388_38F88\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800AFE8C_A71FC\n00000004 R_MIPS_LO16 D_800AFE8C_A71FC\n00000024 R_MIPS_HI16 EepromSaveData\n00000028 R_MIPS_LO16 EepromSaveData\n00000034 R_MIPS_26 func_800383D8_38FD8\n0000003c R_MIPS_HI16 D_800AFE8C_A71FC\n00000040 R_MIPS_LO16 D_800AFE8C_A71FC\n00000054 R_MIPS_HI16 EepromSaveData\n00000058 R_MIPS_LO16 EepromSaveData\n00000060 R_MIPS_26 func_800383D8_38FD8\n00000068 R_MIPS_HI16 D_800AFE8C_A71FC\n0000006c R_MIPS_LO16 D_800AFE8C_A71FC\n00000090 R_MIPS_HI16 EepromSaveData\n00000094 R_MIPS_LO16 EepromSaveData\n0000009c R_MIPS_26 func_800383D8_38FD8\n000000a4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000a8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000c4 R_MIPS_26 func_80038388_38F88\n000000d8 R_MIPS_HI16 D_800AFE8C_A71FC\n000000dc R_MIPS_LO16 D_800AFE8C_A71FC\n000000e4 R_MIPS_HI16 D_800AFE8C_A71FC\n000000e8 R_MIPS_LO16 D_800AFE8C_A71FC\n000000fc R_MIPS_26 func_80038388_38F88\n00000110 R_MIPS_HI16 D_800AFE8C_A71FC\n00000114 R_MIPS_LO16 D_800AFE8C_A71FC\n0000011c R_MIPS_HI16 D_800AFE8C_A71FC\n00000120 R_MIPS_LO16 D_800AFE8C_A71FC\n00000134 R_MIPS_26 func_80038388_38F88\n00000148 R_MIPS_HI16 D_800AFE8C_A71FC\n0000014c R_MIPS_LO16 D_800AFE8C_A71FC\n00000154 R_MIPS_HI16 D_800AFE8C_A71FC\n00000158 R_MIPS_LO16 D_800AFE8C_A71FC\n0000016c R_MIPS_26 func_80038388_38F88\n00000180 R_MIPS_HI16 D_800AFE8C_A71FC\n00000184 R_MIPS_LO16 D_800AFE8C_A71FC\n0000018c R_MIPS_HI16 D_800AFE8C_A71FC\n00000190 R_MIPS_LO16 D_800AFE8C_A71FC\n000001a4 R_MIPS_26 func_80038388_38F88\n000001b8 R_MIPS_HI16 D_800AFE8C_A71FC\n000001bc R_MIPS_LO16 D_800AFE8C_A71FC\n000001c4 R_MIPS_HI16 D_800AFE8C_A71FC\n000001c8 R_MIPS_LO16 D_800AFE8C_A71FC\n000001dc R_MIPS_26 func_80038388_38F88\n000001f0 R_MIPS_HI16 D_800AFE8C_A71FC\n000001f4 R_MIPS_LO16 D_800AFE8C_A71FC\n000001fc R_MIPS_HI16 D_800AFE8C_A71FC\n00000200 R_MIPS_LO16 D_800AFE8C_A71FC\n00000210 R_MIPS_26 func_80038388_38F88\n00000224 R_MIPS_HI16 D_800AFE8C_A71FC\n00000228 R_MIPS_LO16 D_800AFE8C_A71FC\n00000230 R_MIPS_HI16 D_800AFE8C_A71FC\n00000234 R_MIPS_LO16 D_800AFE8C_A71FC\n00000248 R_MIPS_26 func_80038388_38F88\n0000025c R_MIPS_HI16 D_800AFE8C_A71FC\n00000260 R_MIPS_LO16 D_800AFE8C_A71FC\n00000268 R_MIPS_HI16 D_800AFE8C_A71FC\n0000026c R_MIPS_LO16 D_800AFE8C_A71FC\n00000280 R_MIPS_26 func_80038388_38F88\n00000294 R_MIPS_HI16 D_800AFE8C_A71FC\n00000298 R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 3c020000 8c420000 27bdffe8 afbf0014 <....B..'.......\n 0010 afb00010 90430007 2402000b 14620007 .....C..$....b..\n 0020 00808021 3c030000 8c630000 2404000f ...!<....c..$...\n 0030 24020001 0c000000 a062004e 3c020000 $........b.N<...\n 0040 8c420000 90430007 2402000e 14620006 .B...C..$....b..\n 0050 2404000d 3c030000 8c630000 24020001 $...<....c..$...\n 0060 0c000000 a062004f 3c020000 8c420000 .....b.O<....B..\n 0070 90430007 2402000d 1462000a 00101400 .C..$....b......\n 0080 00021403 24030007 14430006 2404000e ....$....C..$...\n 0090 3c030000 8c630000 24020001 0c000000 <....c..$.......\n 00a0 a0620050 3c030000 8c630000 90620024 .b.P<....c...b.$\n 00b0 1040007b 24020001 90630007 14620009 .@.{$....c...b..\n 00c0 00000000 0c000000 2404000a 304200ff ........$...0B..\n 00d0 10400004 24020002 3c030000 8c630000 .@..$...<....c..\n 00e0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 00f0 24020003 14620009 00000000 0c000000 $....b..........\n 0100 2404000b 304200ff 10400004 24020003 $...0B...@..$...\n 0110 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0120 8c420000 90430007 24020009 14620009 .B...C..$....b..\n 0130 00000000 0c000000 2404000c 304200ff ........$...0B..\n 0140 10400004 24020004 3c030000 8c630000 .@..$...<....c..\n 0150 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 0160 24020005 14620009 00000000 0c000000 $....b..........\n 0170 2404000e 304200ff 10400004 24020006 $...0B...@..$...\n 0180 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0190 8c420000 90430007 24020008 14620009 .B...C..$....b..\n 01a0 00000000 0c000000 2404000f 304200ff ........$...0B..\n 01b0 10400004 24020007 3c030000 8c630000 .@..$...<....c..\n 01c0 a0620023 3c020000 8c420000 90430007 .b.#<....B...C..\n 01d0 2402000b 14620009 00000000 0c000000 $....b..........\n 01e0 24040010 304200ff 10400004 24020008 $...0B...@..$...\n 01f0 3c030000 8c630000 a0620023 3c020000 <....c...b.#<...\n 0200 8c420000 90420007 14400009 00000000 .B...B...@......\n 0210 0c000000 2404000d 304200ff 10400004 ....$...0B...@..\n 0220 24020005 3c030000 8c630000 a0620023 $...<....c...b.#\n 0230 3c020000 8c420000 90430007 24020004 <....B...C..$...\n 0240 14620009 00000000 0c000000 24040009 .b..........$...\n 0250 304200ff 10400004 24020001 3c030000 0B...@..$...<...\n 0260 8c630000 a0620023 3c020000 8c420000 .c...b.#<....B..\n 0270 90430007 24020007 14620009 00000000 .C..$....b......\n 0280 0c000000 24040011 304200ff 10400004 ....$...0B...@..\n 0290 24020009 3c030000 8c630000 a0620023 $...<....c...b.#\n 02a0 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_80038090_38C90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_80038090_38C90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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","array","call","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80051C80_52880\n addiu\t$sp, $sp, -64\n sw\t$s3, 52($sp)\n move\t$s3, $a0\n sw\t$s4, 56($sp)\n move\t$s4, $a1\n sw\t$ra, 60($sp)\n sw\t$s2, 48($sp)\n sw\t$s1, 44($sp)\n sw\t$s0, 40($sp)\n lw\t$a0, 0($s3)\n jal\tdistance_2d\n lw\t$a1, 8($s3)\n move\t$v1, $v0\n lui\t$v0, 0x1\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .Lb4\n nop\n beqz\t$v1, .Lac\n lui\t$s2, 0x2\n lw\t$v0, 0($s3)\n mult\t$v0, $s2\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 8($s3)\n mult\t$a0, $s2\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n j\t.Lb4\n sw\t$v1, 8($s3)\n.Lac:\n lui\t$v0, 0x2\n sw\t$v0, 8($s3)\n.Lb4:\n lw\t$a0, 0($s3)\n lw\t$a1, 4($s3)\n jal\tdistance_3d\n lw\t$a2, 8($s3)\n move\t$v1, $v0\n beqz\t$v1, .L14c\n move\t$s1, $v1\n lw\t$v0, 0($s3)\n mult\t$v0, $s4\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 4($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n lw\t$a0, 8($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 4($s3)\n sw\t$v1, 8($s3)\n.L14c:\n lw\t$ra, 60($sp)\n lw\t$s4, 56($sp)\n lw\t$s3, 52($sp)\n lw\t$s2, 48($sp)\n lw\t$s1, 44($sp)\n lw\t$s0, 40($sp)\n jr\t$ra\n addiu\t$sp, $sp, 64\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80051C80_52880 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc","sym":"func_8005AB58_5B758","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["int64","memory","struct","arithmetic","loop","bitwise","call","magic-div"],"loc":82,"refSource":"void func_8005AB58_5B758(Player *player) {\n Vec3i deltaPos;\n GameState *allocation;\n s32 unused1;\n s32 combinedRadius;\n s32 playerIndex;\n Player *targetPlayer;\n s32 numPlayers;\n\n allocation = (GameState *)getCurrentAllocation();\n numPlayers = allocation->numPlayers;\n\n for (playerIndex = 0; playerIndex < allocation->numPlayers; playerIndex++) {\n targetPlayer = &allocation->players[playerIndex];\n\n /* Skip collision if players are on the same team */\n if (player->unkBB8 == targetPlayer->unkBB8) {\n continue;\n }\n\n /* Skip if either player has collision disabled (flag 0x10) */\n if (player->unkB88 & 0x10) {\n continue;\n }\n if (targetPlayer->unkB88 & 0x10) {\n continue;\n }\n\n /* Copy target's collision box local position */\n memcpy(&deltaPos, &targetPlayer->unkAD4, 0xC);\n\n /* Convert to world space */\n deltaPos.x += targetPlayer->worldPos.x;\n deltaPos.y += targetPlayer->worldPos.y;\n deltaPos.z += targetPlayer->worldPos.z;\n\n /* Calculate relative position to player's collision box */\n deltaPos.x -= player->worldPos.x + player->unkAD4[0];\n deltaPos.y -= player->worldPos.y + player->unkAD4[1];\n deltaPos.z -= player->worldPos.z + player->unkAD4[2];\n\n /* Sum of both collision box radii */\n combinedRadius = targetPlayer->unkAE0 + player->unkAE0;\n\n /* Quick AABB check before expensive distance calculation */\n if (-combinedRadius < deltaPos.x && deltaPos.x < combinedRadius && -combinedRadius < deltaPos.y &&\n deltaPos.y < combinedRadius && -combinedRadius < deltaPos.z && deltaPos.z < combinedRadius) {\n s32 dist;\n\n dist = isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.y * deltaPos.y + (s64)deltaPos.z * deltaPos.z);\n\n if (dist < combinedRadius) {\n /* Avoid divide by zero */\n if (dist == 0) {\n dist = 1;\n }\n\n /* Calculate push vector to separate the players */\n deltaPos.x = ((s64)deltaPos.x * combinedRadius / dist) - deltaPos.x;\n deltaPos.y = ((s64)deltaPos.y * combinedRadius / dist) - deltaPos.y;\n deltaPos.z = ((s64)deltaPos.z * combinedRadius / dist) - deltaPos.z;\n\n /* Skip push if player has flag 0x80 */\n if (player->unkB84 & 0x80) {\n continue;\n }\n\n /* If target has flag 0x80, do full push */\n if (targetPlayer->unkB84 & 0x80) {\n player->worldPos.x -= deltaPos.x;\n player->worldPos.y -= deltaPos.y;\n player->worldPos.z -= deltaPos.z;\n } else {\n /* Half push */\n player->worldPos.x -= deltaPos.x / 2;\n player->worldPos.y -= deltaPos.y / 2;\n player->worldPos.z -= deltaPos.z / 2;\n }\n }\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5AA90.c#L128-L209","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-104\n 4:\tsw\ts6,88(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,100(sp)\n 10:\tsw\ts8,96(sp)\n 14:\tsw\ts7,92(sp)\n 18:\tsw\ts5,84(sp)\n 1c:\tsw\ts4,80(sp)\n 20:\tsw\ts3,76(sp)\n 24:\tsw\ts2,72(sp)\n 28:\tsw\ts1,68(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,64(sp)\n 34:\tsw\tv0,36(sp)\n 38:\tlbu\tv0,94(v0)\n 3c:\tblez\tv0,304 \n 40:\tmove\ts8,zero\n 44:\tsw\tzero,52(sp)\n 48:\tlw\tt0,36(sp)\n 4c:\tlw\tt1,52(sp)\n 50:\tlw\tv0,16(t0)\n 54:\tlbu\tv1,3000(s6)\n 58:\taddu\ts7,v0,t1\n 5c:\tlbu\tv0,3000(s7)\n 60:\tbeq\tv1,v0,2ec \n 64:\tnop\n 68:\tlw\tv0,2952(s6)\n 6c:\tandi\tv0,v0,0x10\n 70:\tbnez\tv0,2ec \n 74:\tnop\n 78:\tlw\tv0,2952(s7)\n 7c:\tandi\tv0,v0,0x10\n 80:\tbnez\tv0,2ec \n 84:\taddiu\ta0,sp,16\n 88:\taddiu\ta1,s7,2772\n 8c:\tjal\t0 \n 90:\tli\ta2,12\n 94:\tlw\ta0,16(sp)\n 98:\tlw\tv0,1076(s7)\n 9c:\tlw\ta1,20(sp)\n a0:\taddu\ta0,a0,v0\n a4:\tsw\ta0,16(sp)\n a8:\tlw\tv0,1080(s7)\n ac:\tlw\ta2,24(sp)\n b0:\taddu\ta1,a1,v0\n b4:\tsw\ta1,20(sp)\n b8:\tlw\tv0,1084(s7)\n bc:\taddu\ta2,a2,v0\n c0:\tsw\ta2,24(sp)\n c4:\tlw\tv0,1076(s6)\n c8:\tlw\tv1,2772(s6)\n cc:\taddu\tv0,v0,v1\n d0:\tsubu\ta0,a0,v0\n d4:\tsw\ta0,16(sp)\n d8:\tlw\tv0,1080(s6)\n dc:\tlw\tv1,2776(s6)\n e0:\taddu\tv0,v0,v1\n e4:\tsubu\ta3,a1,v0\n e8:\tsw\ta3,20(sp)\n ec:\tlw\tv0,1084(s6)\n f0:\tlw\tv1,2780(s6)\n f4:\taddu\tv0,v0,v1\n f8:\tsubu\ta2,a2,v0\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2784(s7)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,2e4 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,2e4 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,2e4 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,2e4 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,2e4 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,2e4 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,56(sp)\n 170:\tsw\tt1,60(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\tv1,v0\n 1a4:\tslt\tv0,v1,s5\n 1a8:\tbeqz\tv0,2e4 \n 1ac:\tnop\n 1b0:\tbeqzl\tv1,1b8 \n 1b4:\tli\tv1,1\n 1b8:\tlw\ts4,16(sp)\n 1bc:\tmult\ts4,s5\n 1c0:\tmove\ts1,v1\n 1c4:\tsra\ts0,v1,0x1f\n 1c8:\tlw\ts3,20(sp)\n 1cc:\tmfhi\ta0\n 1d0:\tmflo\ta1\n 1d4:\tmove\ta2,s0\n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tmove\ta3,s1\n 1e4:\tnop\n 1e8:\tmult\ts3,s5\n 1ec:\tmove\ta2,s0\n 1f0:\tmove\ta3,s1\n 1f4:\tlw\ts2,24(sp)\n 1f8:\tmfhi\ta0\n 1fc:\tmflo\ta1\n\t...\n 208:\tjal\t0 \n 20c:\tsubu\ts4,v1,s4\n 210:\tnop\n 214:\tmult\ts2,s5\n 218:\tmove\ta2,s0\n 21c:\tmove\ta3,s1\n 220:\tsubu\ts3,v1,s3\n 224:\tsw\ts4,16(sp)\n 228:\tmfhi\ta0\n 22c:\tmflo\ta1\n\t...\n 238:\tjal\t0 \n 23c:\tsw\ts3,20(sp)\n 240:\tsubu\ts2,v1,s2\n 244:\tsw\ts2,24(sp)\n 248:\tlw\tv0,2948(s6)\n 24c:\tandi\tv0,v0,0x80\n 250:\tbnez\tv0,2e4 \n 254:\tnop\n 258:\tlw\tv0,2948(s7)\n 25c:\tandi\tv0,v0,0x80\n 260:\tbeqz\tv0,298 \n 264:\tsrl\tv0,s4,0x1f\n 268:\tlw\tv0,1076(s6)\n 26c:\tsubu\tv0,v0,s4\n 270:\tsw\tv0,1076(s6)\n 274:\tlw\tv0,1080(s6)\n 278:\tlw\tv1,20(sp)\n 27c:\tsubu\tv0,v0,v1\n 280:\tsw\tv0,1080(s6)\n 284:\tlw\tv0,1084(s6)\n 288:\tlw\tv1,24(sp)\n 28c:\tsubu\tv0,v0,v1\n 290:\tj\t2e4 \n 294:\tsw\tv0,1084(s6)\n 298:\tlw\tv1,1076(s6)\n 29c:\taddu\tv0,s4,v0\n 2a0:\tsra\tv0,v0,0x1\n 2a4:\tsubu\tv1,v1,v0\n 2a8:\tsw\tv1,1076(s6)\n 2ac:\tlw\tv0,20(sp)\n 2b0:\tlw\tv1,1080(s6)\n 2b4:\tsrl\ta0,v0,0x1f\n 2b8:\taddu\tv0,v0,a0\n 2bc:\tsra\tv0,v0,0x1\n 2c0:\tsubu\tv1,v1,v0\n 2c4:\tsw\tv1,1080(s6)\n 2c8:\tlw\tv0,24(sp)\n 2cc:\tlw\tv1,1084(s6)\n 2d0:\tsrl\ta0,v0,0x1f\n 2d4:\taddu\tv0,v0,a0\n 2d8:\tsra\tv0,v0,0x1\n 2dc:\tsubu\tv1,v1,v0\n 2e0:\tsw\tv1,1084(s6)\n 2e4:\tlw\tt0,36(sp)\n 2e8:\tlw\tt1,52(sp)\n 2ec:\tlbu\tv0,94(t0)\n 2f0:\taddiu\ts8,s8,1\n 2f4:\taddiu\tt1,t1,3048\n 2f8:\tslt\tv0,s8,v0\n 2fc:\tbnez\tv0,48 \n 300:\tsw\tt1,52(sp)\n 304:\tlw\tra,100(sp)\n 308:\tlw\ts8,96(sp)\n 30c:\tlw\ts7,92(sp)\n 310:\tlw\ts6,88(sp)\n 314:\tlw\ts5,84(sp)\n 318:\tlw\ts4,80(sp)\n 31c:\tlw\ts3,76(sp)\n 320:\tlw\ts2,72(sp)\n 324:\tlw\ts1,68(sp)\n 328:\tlw\ts0,64(sp)\n 32c:\tjr\tra\n 330:\taddiu\tsp,sp,104\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-3c0ef0b3e2c0.i.gz","proto":{"func_8005AB58_5B758":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-9c00ae27ec8e5d7c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t00000334 func_8005AB58_5B758\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n0000008c R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n000001dc R_MIPS_26 __divdi3\n00000208 R_MIPS_26 __divdi3\n00000238 R_MIPS_26 __divdi3\n00000290 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdff98 afb60058 0080b021 afbf0064 '......X...!...d\n 0010 afbe0060 afb7005c afb50054 afb40050 ...`...\\...T...P\n 0020 afb3004c afb20048 afb10044 0c000000 ...L...H...D....\n 0030 afb00040 afa20024 9042005e 184000b1 ...@...$.B.^.@..\n 0040 0000f021 afa00034 8fa80024 8fa90034 ...!...4...$...4\n 0050 8d020010 92c30bb8 0049b821 92e20bb8 .........I.!....\n 0060 106200a2 00000000 8ec20b88 30420010 .b..........0B..\n 0070 1440009e 00000000 8ee20b88 30420010 .@..........0B..\n 0080 1440009a 27a40010 26e50ad4 0c000000 .@..'...&.......\n 0090 2406000c 8fa40010 8ee20434 8fa50014 $..........4....\n 00a0 00822021 afa40010 8ee20438 8fa60018 .. !.......8....\n 00b0 00a22821 afa50014 8ee2043c 00c23021 ..(!.......<..0!\n 00c0 afa60018 8ec20434 8ec30ad4 00431021 .......4.....C.!\n 00d0 00822023 afa40010 8ec20438 8ec30ad8 .. #.......8....\n 00e0 00431021 00a23823 afa70014 8ec2043c .C.!..8#.......<\n 00f0 8ec30adc 00431021 00c23023 afa60018 .....C.!..0#....\n 0100 8ee30ae0 8ec20ae0 0062a821 00151823 .........b.!...#\n 0110 0064102a 10400073 0095102a 10400071 .d.*.@.s...*.@.q\n 0120 0067102a 1040006f 00f5102a 1040006d .g.*.@.o...*.@.m\n 0130 0066102a 1040006b 00d5102a 10400069 .f.*.@.k...*.@.i\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80038 ...............8\n 0170 afa9003c 00a92821 00a9302b 00882021 ...<..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00401821 0075102a 1040004e 00000000 .@.!.u.*.@.N....\n 01b0 50600001 24030001 8fb40010 02950018 P`..$...........\n 01c0 00608821 000387c3 8fb30014 00002010 .`.!.......... .\n 01d0 00002812 02003021 00000000 0c000000 ..(...0!........\n 01e0 02203821 00000000 02750018 02003021 . 8!.....u....0!\n 01f0 02203821 8fb20018 00002010 00002812 . 8!...... ...(.\n 0200 00000000 00000000 0c000000 0074a023 .............t.#\n 0210 00000000 02550018 02003021 02203821 .....U....0!. 8!\n 0220 00739823 afb40010 00002010 00002812 .s.#...... ...(.\n 0230 00000000 00000000 0c000000 afb30014 ................\n 0240 00729023 afb20018 8ec20b84 30420080 .r.#........0B..\n 0250 14400024 00000000 8ee20b84 30420080 .@.$........0B..\n 0260 1040000d 001417c2 8ec20434 00541023 .@.........4.T.#\n 0270 aec20434 8ec20438 8fa30014 00431023 ...4...8.....C.#\n 0280 aec20438 8ec2043c 8fa30018 00431023 ...8...<.....C.#\n 0290 080000b9 aec2043c 8ec30434 02821021 .......<...4...!\n 02a0 00021043 00621823 aec30434 8fa20014 ...C.b.#...4....\n 02b0 8ec30438 000227c2 00441021 00021043 ...8..'..D.!...C\n 02c0 00621823 aec30438 8fa20018 8ec3043c .b.#...8.......<\n 02d0 000227c2 00441021 00021043 00621823 ..'..D.!...C.b.#\n 02e0 aec3043c 8fa80024 8fa90034 9102005e ...<...$...4...^\n 02f0 27de0001 25290be8 03c2102a 1440ff52 '...%).....*.@.R\n 0300 afa90034 8fbf0064 8fbe0060 8fb7005c ...4...d...`...\\\n 0310 8fb60058 8fb50054 8fb40050 8fb3004c ...X...T...P...L\n 0320 8fb20048 8fb10044 8fb00040 03e00008 ...H...D...@....\n 0330 27bd0068 00000000 00000000 00000000 '..h............\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005AB58_5B758' — lift: cannot lift 'func_8005AB58_5B758': 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,-104 */\n/* 4:\tsw\ts6,88(sp) */\n/* 8:\tmove\ts6,a0 */\n/* c:\tsw\tra,100(sp) */\n/* 10:\tsw\ts8,96(sp) */\n/* 14:\tsw\ts7,92(sp) */\n/* 18:\tsw\ts5,84(sp) */\n/* 1c:\tsw\ts4,80(sp) */\n/* 20:\tsw\ts3,76(sp) */\n/* 24:\tsw\ts2,72(sp) */\n/* 28:\tsw\ts1,68(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\ts0,64(sp) */\n/* 34:\tsw\tv0,36(sp) */\n/* 38:\tlbu\tv0,94(v0) */\n/* 3c:\tblez\tv0,304 */\n/* 40:\tmove\ts8,zero */\n/* 44:\tsw\tzero,52(sp) */\n/* 48:\tlw\tt0,36(sp) */\n/* 4c:\tlw\tt1,52(sp) */\n/* 50:\tlw\tv0,16(t0) */\n/* 54:\tlbu\tv1,3000(s6) */\n/* 58:\taddu\ts7,v0,t1 */\n/* 5c:\tlbu\tv0,3000(s7) */\n/* 60:\tbeq\tv1,v0,2ec */\n/* 64:\tnop */\n/* 68:\tlw\tv0,2952(s6) */\n/* 6c:\tandi\tv0,v0,0x10 */\n/* 70:\tbnez\tv0,2ec */\n/* 74:\tnop */\n/* 78:\tlw\tv0,2952(s7) */\n/* 7c:\tandi\tv0,v0,0x10 */\n/* 80:\tbnez\tv0,2ec */\n/* 84:\taddiu\ta0,sp,16 */\n/* 88:\taddiu\ta1,s7,2772 */\n/* 8c:\tjal\t0 */\n/* 90:\tli\ta2,12 */\n/* 94:\tlw\ta0,16(sp) */\n/* 98:\tlw\tv0,1076(s7) */\n/* 9c:\tlw\ta1,20(sp) */\n/* a0:\taddu\ta0,a0,v0 */\n/* a4:\tsw\ta0,16(sp) */\n/* a8:\tlw\tv0,1080(s7) */\n/* ac:\tlw\ta2,24(sp) */\n/* b0:\taddu\ta1,a1,v0 */\n/* b4:\tsw\ta1,20(sp) */\n/* b8:\tlw\tv0,1084(s7) */\n/* bc:\taddu\ta2,a2,v0 */\n/* c0:\tsw\ta2,24(sp) */\n/* c4:\tlw\tv0,1076(s6) */\n/* c8:\tlw\tv1,2772(s6) */\n/* cc:\taddu\tv0,v0,v1 */\n/* d0:\tsubu\ta0,a0,v0 */\n/* d4:\tsw\ta0,16(sp) */\n/* d8:\tlw\tv0,1080(s6) */\n/* dc:\tlw\tv1,2776(s6) */\n/* e0:\taddu\tv0,v0,v1 */\n/* e4:\tsubu\ta3,a1,v0 */\n/* e8:\tsw\ta3,20(sp) */\n/* ec:\tlw\tv0,1084(s6) */\n/* f0:\tlw\tv1,2780(s6) */\n/* f4:\taddu\tv0,v0,v1 */\n/* f8:\tsubu\ta2,a2,v0 */\n/* fc:\tsw\ta2,24(sp) */\n/* 100:\tlw\tv1,2784(s7) */\n/* 104:\tlw\tv0,2784(s6) */\n/* 108:\taddu\ts5,v1,v0 */\n/* 10c:\tnegu\tv1,s5 */\n/* 110:\tslt\tv0,v1,a0 */\n/* 114:\tbeqz\tv0,2e4 */\n/* 118:\tslt\tv0,a0,s5 */\n/* 11c:\tbeqz\tv0,2e4 */\n/* 120:\tslt\tv0,v1,a3 */\n/* 124:\tbeqz\tv0,2e4 */\n/* 128:\tslt\tv0,a3,s5 */\n/* 12c:\tbeqz\tv0,2e4 */\n/* 130:\tslt\tv0,v1,a2 */\n/* 134:\tbeqz\tv0,2e4 */\n/* 138:\tslt\tv0,a2,s5 */\n/* 13c:\tbeqz\tv0,2e4 */\n/* 140:\tmult\ta0,a0 */\n/* 144:\tmfhi\ta0 */\n/* 148:\tmflo\ta1 */\n/* \t... */\n/* 154:\tmult\ta3,a3 */\n/* 158:\tmfhi\tt0 */\n/* 15c:\tmflo\tt1 */\n/* \t... */\n/* 168:\tmult\ta2,a2 */\n/* 16c:\tsw\tt0,56(sp) */\n/* 170:\tsw\tt1,60(sp) */\n/* 174:\taddu\ta1,a1,t1 */\n/* 178:\tsltu\ta2,a1,t1 */\n/* 17c:\taddu\ta0,a0,t0 */\n/* 180:\taddu\ta0,a0,a2 */\n/* 184:\tmfhi\tv0 */\n/* 188:\tmflo\tv1 */\n/* 18c:\taddu\ta1,a1,v1 */\n/* 190:\tsltu\ta2,a1,v1 */\n/* 194:\taddu\ta0,a0,v0 */\n/* 198:\tjal\t0 */\n/* 19c:\taddu\ta0,a0,a2 */\n/* 1a0:\tmove\tv1,v0 */\n/* 1a4:\tslt\tv0,v1,s5 */\n/* 1a8:\tbeqz\tv0,2e4 */\n/* 1ac:\tnop */\n/* 1b0:\tbeqzl\tv1,1b8 */\n/* 1b4:\tli\tv1,1 */\n/* 1b8:\tlw\ts4,16(sp) */\n/* 1bc:\tmult\ts4,s5 */\n/* 1c0:\tmove\ts1,v1 */\n/* 1c4:\tsra\ts0,v1,0x1f */\n/* 1c8:\tlw\ts3,20(sp) */\n/* 1cc:\tmfhi\ta0 */\n/* 1d0:\tmflo\ta1 */\n/* 1d4:\tmove\ta2,s0 */\n/* 1d8:\tnop */\n/* 1dc:\tjal\t0 */\n/* 1e0:\tmove\ta3,s1 */\n/* 1e4:\tnop */\n/* 1e8:\tmult\ts3,s5 */\n/* 1ec:\tmove\ta2,s0 */\n/* 1f0:\tmove\ta3,s1 */\n/* 1f4:\tlw\ts2,24(sp) */\n/* 1f8:\tmfhi\ta0 */\n/* 1fc:\tmflo\ta1 */\n/* \t... */\n/* 208:\tjal\t0 */\n/* 20c:\tsubu\ts4,v1,s4 */\n/* 210:\tnop */\n/* 214:\tmult\ts2,s5 */\n/* 218:\tmove\ta2,s0 */\n/* 21c:\tmove\ta3,s1 */\n/* 220:\tsubu\ts3,v1,s3 */\n/* 224:\tsw\ts4,16(sp) */\n/* 228:\tmfhi\ta0 */\n/* 22c:\tmflo\ta1 */\n/* \t... */\n/* 238:\tjal\t0 */\n/* 23c:\tsw\ts3,20(sp) */\n/* 240:\tsubu\ts2,v1,s2 */\n/* 244:\tsw\ts2,24(sp) */\n/* 248:\tlw\tv0,2948(s6) */\n/* 24c:\tandi\tv0,v0,0x80 */\n/* 250:\tbnez\tv0,2e4 */\n/* 254:\tnop */\n/* 258:\tlw\tv0,2948(s7) */\n/* 25c:\tandi\tv0,v0,0x80 */\n/* 260:\tbeqz\tv0,298 */\n/* 264:\tsrl\tv0,s4,0x1f */\n/* 268:\tlw\tv0,1076(s6) */\n/* 26c:\tsubu\tv0,v0,s4 */\n/* 270:\tsw\tv0,1076(s6) */\n/* 274:\tlw\tv0,1080(s6) */\n/* 278:\tlw\tv1,20(sp) */\n/* 27c:\tsubu\tv0,v0,v1 */\n/* 280:\tsw\tv0,1080(s6) */\n/* 284:\tlw\tv0,1084(s6) */\n/* 288:\tlw\tv1,24(sp) */\n/* 28c:\tsubu\tv0,v0,v1 */\n/* 290:\tj\t2e4 */\n/* 294:\tsw\tv0,1084(s6) */\n/* 298:\tlw\tv1,1076(s6) */\n/* 29c:\taddu\tv0,s4,v0 */\n/* 2a0:\tsra\tv0,v0,0x1 */\n/* 2a4:\tsubu\tv1,v1,v0 */\n/* 2a8:\tsw\tv1,1076(s6) */\n/* 2ac:\tlw\tv0,20(sp) */\n/* 2b0:\tlw\tv1,1080(s6) */\n/* 2b4:\tsrl\ta0,v0,0x1f */\n/* 2b8:\taddu\tv0,v0,a0 */\n/* 2bc:\tsra\tv0,v0,0x1 */\n/* 2c0:\tsubu\tv1,v1,v0 */\n/* 2c4:\tsw\tv1,1080(s6) */\n/* 2c8:\tlw\tv0,24(sp) */\n/* 2cc:\tlw\tv1,1084(s6) */\n/* 2d0:\tsrl\ta0,v0,0x1f */\n/* 2d4:\taddu\tv0,v0,a0 */\n/* 2d8:\tsra\tv0,v0,0x1 */\n/* 2dc:\tsubu\tv1,v1,v0 */\n/* 2e0:\tsw\tv1,1084(s6) */\n/* 2e4:\tlw\tt0,36(sp) */\n/* 2e8:\tlw\tt1,52(sp) */\n/* 2ec:\tlbu\tv0,94(t0) */\n/* 2f0:\taddiu\ts8,s8,1 */\n/* 2f4:\taddiu\tt1,t1,3048 */\n/* 2f8:\tslt\tv0,s8,v0 */\n/* 2fc:\tbnez\tv0,48 */\n/* 300:\tsw\tt1,52(sp) */\n/* 304:\tlw\tra,100(sp) */\n/* 308:\tlw\ts8,96(sp) */\n/* 30c:\tlw\ts7,92(sp) */\n/* 310:\tlw\ts6,88(sp) */\n/* 314:\tlw\ts5,84(sp) */\n/* 318:\tlw\ts4,80(sp) */\n/* 31c:\tlw\ts3,76(sp) */\n/* 320:\tlw\ts2,72(sp) */\n/* 324:\tlw\ts1,68(sp) */\n/* 328:\tlw\ts0,64(sp) */\n/* 32c:\tjr\tra */\n/* 330:\taddiu\tsp,sp,104 */\n/* \t... */\nvoid func_8005AB58_5B758(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005AB58_5B758': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":210,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005AB58_5B758': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\n\nvoid func_8005AB58_5B758(Player *player) {\n s32 sp10; /* compiler-managed */\n s32 sp14;\n s32 sp18;\n void *sp24;\n s32 sp34;\n s32 sp38;\n u32 sp3C;\n s32 temp_a0;\n s32 temp_a0_2;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a3;\n s32 temp_hi;\n s32 temp_s0;\n s32 temp_s3;\n s32 temp_s5;\n s32 temp_v1;\n s32 var_s8;\n s32 var_v1;\n u32 temp_a1_2;\n u32 temp_a1_3;\n u32 temp_lo;\n u32 temp_lo_2;\n u32 temp_s4;\n void *temp_s7;\n void *temp_v0;\n\n temp_v0 = getCurrentAllocation();\n sp24 = temp_v0;\n var_s8 = 0;\n if ((s32) temp_v0->unk5E > 0) {\n sp34 = 0;\n do {\n temp_s7 = sp24->unk10 + sp34;\n if ((player->unkBB8 != temp_s7->unkBB8) && !(player->unkB88 & 0x10) && !(temp_s7->unkB88 & 0x10)) {\n memcpy(&sp10, temp_s7 + 0xAD4, 0xCU);\n temp_a0 = sp10 + temp_s7->unk434;\n sp10 = temp_a0;\n temp_a1 = sp14 + temp_s7->unk438;\n sp14 = temp_a1;\n temp_a2 = sp18 + temp_s7->unk43C;\n sp18 = temp_a2;\n temp_a0_2 = temp_a0 - (player->worldPos.x + player->unkAD4[0]);\n sp10 = temp_a0_2;\n temp_a3 = temp_a1 - (player->worldPos.y + player->unkAD4[1]);\n sp14 = temp_a3;\n temp_a2_2 = temp_a2 - (player->worldPos.z + player->unkAD4[2]);\n sp18 = temp_a2_2;\n temp_s5 = temp_s7->unkAE0 + player->unkAE0;\n temp_v1 = -temp_s5;\n if ((temp_v1 < temp_a0_2) && (temp_a0_2 < temp_s5) && (temp_v1 < temp_a3) && (temp_a3 < temp_s5) && (temp_v1 < temp_a2_2) && (temp_a2_2 < temp_s5)) {\n temp_hi = MULT_HI(temp_a3, temp_a3);\n temp_lo = temp_a3 * temp_a3;\n temp_lo_2 = temp_a2_2 * temp_a2_2;\n sp38 = temp_hi;\n sp3C = temp_lo;\n temp_a1_2 = (temp_a0_2 * temp_a0_2) + temp_lo;\n temp_a1_3 = temp_a1_2 + temp_lo_2;\n var_v1 = isqrt64(/* s64+0x0 */ (MULT_HI(temp_a0_2, temp_a0_2) + temp_hi + (temp_a1_2 < temp_lo) + MULT_HI(temp_a2_2, temp_a2_2) + (temp_a1_3 < temp_lo_2)), /* s64+0x4 */ temp_a1_3);\n if (var_v1 < temp_s5) {\n if (var_v1 == 0) {\n var_v1 = 1;\n }\n temp_s0 = var_v1 >> 0x1F;\n temp_s4 = (u32) __divdi3(MULT_HI(sp10, temp_s5), sp10 * temp_s5, temp_s0, var_v1) - sp10;\n temp_s3 = (u32) __divdi3(MULT_HI(sp14, temp_s5), sp14 * temp_s5, temp_s0, var_v1) - sp14;\n sp10 = temp_s4;\n sp14 = temp_s3;\n sp18 = (u32) __divdi3(MULT_HI(sp18, temp_s5), sp18 * temp_s5, temp_s0, var_v1) - sp18;\n if (!(player->unkB84 & 0x80)) {\n if (temp_s7->unkB84 & 0x80) {\n player->worldPos.x -= temp_s4;\n player->worldPos.y -= sp14;\n player->worldPos.z -= sp18;\n } else {\n player->worldPos.x -= (s32) (temp_s4 + (temp_s4 >> 0x1F)) >> 1;\n player->worldPos.y -= sp14 / 2;\n player->worldPos.z -= sp18 / 2;\n }\n }\n }\n }\n }\n var_s8 += 1;\n sp34 += 0xBE8;\n } while (var_s8 < (s32) sp24->unk5E);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":90,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2780: request for member `unk5E' in something not a structure or union","/c.i:2783: request for member `unk10' in something not a structure or union","/c.i:2784: request for member `unkBB8' in something not a structure or union","/c.i:2784: request for member `unkB88' in something not a structure or union","/c.i:2786: request for member `unk434' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005AB58_5B758` — benchmark function snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_8005AB58_5B758\n addiu\t$sp, $sp, -104\n sw\t$s6, 88($sp)\n move\t$s6, $a0\n sw\t$ra, 100($sp)\n sw\t$s8, 96($sp)\n sw\t$s7, 92($sp)\n sw\t$s5, 84($sp)\n sw\t$s4, 80($sp)\n sw\t$s3, 76($sp)\n sw\t$s2, 72($sp)\n sw\t$s1, 68($sp)\n jal\tgetCurrentAllocation\n sw\t$s0, 64($sp)\n sw\t$v0, 36($sp)\n lbu\t$v0, 94($v0)\n blez\t$v0, .L304\n move\t$s8, $zero\n sw\t$zero, 52($sp)\n.L48:\n lw\t$t0, 36($sp)\n lw\t$t1, 52($sp)\n lw\t$v0, 16($t0)\n lbu\t$v1, 3000($s6)\n addu\t$s7, $v0, $t1\n lbu\t$v0, 3000($s7)\n beq\t$v1, $v0, .L2ec\n nop\n lw\t$v0, 2952($s6)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L2ec\n nop\n lw\t$v0, 2952($s7)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L2ec\n addiu\t$a0, $sp, 16\n addiu\t$a1, $s7, 2772\n jal\tmemcpy\n li\t$a2, 12\n lw\t$a0, 16($sp)\n lw\t$v0, 1076($s7)\n lw\t$a1, 20($sp)\n addu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s7)\n lw\t$a2, 24($sp)\n addu\t$a1, $a1, $v0\n sw\t$a1, 20($sp)\n lw\t$v0, 1084($s7)\n addu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v0, 1076($s6)\n lw\t$v1, 2772($s6)\n addu\t$v0, $v0, $v1\n subu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s6)\n lw\t$v1, 2776($s6)\n addu\t$v0, $v0, $v1\n subu\t$a3, $a1, $v0\n sw\t$a3, 20($sp)\n lw\t$v0, 1084($s6)\n lw\t$v1, 2780($s6)\n addu\t$v0, $v0, $v1\n subu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v1, 2784($s7)\n lw\t$v0, 2784($s6)\n addu\t$s5, $v1, $v0\n negu\t$v1, $s5\n slt\t$v0, $v1, $a0\n beqz\t$v0, .L2e4\n slt\t$v0, $a0, $s5\n beqz\t$v0, .L2e4\n slt\t$v0, $v1, $a3\n beqz\t$v0, .L2e4\n slt\t$v0, $a3, $s5\n beqz\t$v0, .L2e4\n slt\t$v0, $v1, $a2\n beqz\t$v0, .L2e4\n slt\t$v0, $a2, $s5\n beqz\t$v0, .L2e4\n mult\t$a0, $a0\n mfhi\t$a0\n mflo\t$a1\n mult\t$a3, $a3\n mfhi\t$t0\n mflo\t$t1\n mult\t$a2, $a2\n sw\t$t0, 56($sp)\n sw\t$t1, 60($sp)\n addu\t$a1, $a1, $t1\n sltu\t$a2, $a1, $t1\n addu\t$a0, $a0, $t0\n addu\t$a0, $a0, $a2\n mfhi\t$v0\n mflo\t$v1\n addu\t$a1, $a1, $v1\n sltu\t$a2, $a1, $v1\n addu\t$a0, $a0, $v0\n jal\tisqrt64\n addu\t$a0, $a0, $a2\n move\t$v1, $v0\n slt\t$v0, $v1, $s5\n beqz\t$v0, .L2e4\n nop\n beqzl\t$v1, .L1b8\n li\t$v1, 1\n.L1b8:\n lw\t$s4, 16($sp)\n mult\t$s4, $s5\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n lw\t$s3, 20($sp)\n mfhi\t$a0\n mflo\t$a1\n move\t$a2, $s0\n nop\n jal\t__divdi3\n move\t$a3, $s1\n nop\n mult\t$s3, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n lw\t$s2, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n subu\t$s4, $v1, $s4\n nop\n mult\t$s2, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n subu\t$s3, $v1, $s3\n sw\t$s4, 16($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$s3, 20($sp)\n subu\t$s2, $v1, $s2\n sw\t$s2, 24($sp)\n lw\t$v0, 2948($s6)\n andi\t$v0, $v0, 0x80\n bnez\t$v0, .L2e4\n nop\n lw\t$v0, 2948($s7)\n andi\t$v0, $v0, 0x80\n beqz\t$v0, .L298\n srl\t$v0, $s4, 0x1f\n lw\t$v0, 1076($s6)\n subu\t$v0, $v0, $s4\n sw\t$v0, 1076($s6)\n lw\t$v0, 1080($s6)\n lw\t$v1, 20($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1080($s6)\n lw\t$v0, 1084($s6)\n lw\t$v1, 24($sp)\n subu\t$v0, $v0, $v1\n j\t.L2e4\n sw\t$v0, 1084($s6)\n.L298:\n lw\t$v1, 1076($s6)\n addu\t$v0, $s4, $v0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1076($s6)\n lw\t$v0, 20($sp)\n lw\t$v1, 1080($s6)\n srl\t$a0, $v0, 0x1f\n addu\t$v0, $v0, $a0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1080($s6)\n lw\t$v0, 24($sp)\n lw\t$v1, 1084($s6)\n srl\t$a0, $v0, 0x1f\n addu\t$v0, $v0, $a0\n sra\t$v0, $v0, 0x1\n subu\t$v1, $v1, $v0\n sw\t$v1, 1084($s6)\n.L2e4:\n lw\t$t0, 36($sp)\n lw\t$t1, 52($sp)\n.L2ec:\n lbu\t$v0, 94($t0)\n addiu\t$s8, $s8, 1\n addiu\t$t1, $t1, 3048\n slt\t$v0, $s8, $v0\n bnez\t$v0, .L48\n sw\t$t1, 52($sp)\n.L304:\n lw\t$ra, 100($sp)\n lw\t$s8, 96($sp)\n lw\t$s7, 92($sp)\n lw\t$s6, 88($sp)\n lw\t$s5, 84($sp)\n lw\t$s4, 80($sp)\n lw\t$s3, 76($sp)\n lw\t$s2, 72($sp)\n lw\t$s1, 68($sp)\n lw\t$s0, 64($sp)\n jr\t$ra\n addiu\t$sp, $sp, 104\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-3c0ef0b3e2c0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8005AB58_5B758(Player *player);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005AB58_5B758 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005AB58_5B758` — benchmark function snowboardkids2:func_8005AB58_5B758:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005AB58_5B758: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,-104\n 4:\tsw\ts6,88(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,100(sp)\n 10:\tsw\ts8,96(sp)\n 14:\tsw\ts7,92(sp)\n 18:\tsw\ts5,84(sp)\n 1c:\tsw\ts4,80(sp)\n 20:\tsw\ts3,76(sp)\n 24:\tsw\ts2,72(sp)\n 28:\tsw\ts1,68(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,64(sp)\n 34:\tsw\tv0,36(sp)\n 38:\tlbu\tv0,94(v0)\n 3c:\tblez\tv0,304 \n 40:\tmove\ts8,zero\n 44:\tsw\tzero,52(sp)\n 48:\tlw\tt0,36(sp)\n 4c:\tlw\tt1,52(sp)\n 50:\tlw\tv0,16(t0)\n 54:\tlbu\tv1,3000(s6)\n 58:\taddu\ts7,v0,t1\n 5c:\tlbu\tv0,3000(s7)\n 60:\tbeq\tv1,v0,2ec \n 64:\tnop\n 68:\tlw\tv0,2952(s6)\n 6c:\tandi\tv0,v0,0x10\n 70:\tbnez\tv0,2ec \n 74:\tnop\n 78:\tlw\tv0,2952(s7)\n 7c:\tandi\tv0,v0,0x10\n 80:\tbnez\tv0,2ec \n 84:\taddiu\ta0,sp,16\n 88:\taddiu\ta1,s7,2772\n 8c:\tjal\t0 \n 90:\tli\ta2,12\n 94:\tlw\ta0,16(sp)\n 98:\tlw\tv0,1076(s7)\n 9c:\tlw\ta1,20(sp)\n a0:\taddu\ta0,a0,v0\n a4:\tsw\ta0,16(sp)\n a8:\tlw\tv0,1080(s7)\n ac:\tlw\ta2,24(sp)\n b0:\taddu\ta1,a1,v0\n b4:\tsw\ta1,20(sp)\n b8:\tlw\tv0,1084(s7)\n bc:\taddu\ta2,a2,v0\n c0:\tsw\ta2,24(sp)\n c4:\tlw\tv0,1076(s6)\n c8:\tlw\tv1,2772(s6)\n cc:\taddu\tv0,v0,v1\n d0:\tsubu\ta0,a0,v0\n d4:\tsw\ta0,16(sp)\n d8:\tlw\tv0,1080(s6)\n dc:\tlw\tv1,2776(s6)\n e0:\taddu\tv0,v0,v1\n e4:\tsubu\ta3,a1,v0\n e8:\tsw\ta3,20(sp)\n ec:\tlw\tv0,1084(s6)\n f0:\tlw\tv1,2780(s6)\n f4:\taddu\tv0,v0,v1\n f8:\tsubu\ta2,a2,v0\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2784(s7)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,2e4 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,2e4 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,2e4 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,2e4 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,2e4 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,2e4 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,56(sp)\n 170:\tsw\tt1,60(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\tv1,v0\n 1a4:\tslt\tv0,v1,s5\n 1a8:\tbeqz\tv0,2e4 \n 1ac:\tnop\n 1b0:\tbeqzl\tv1,1b8 \n 1b4:\tli\tv1,1\n 1b8:\tlw\ts4,16(sp)\n 1bc:\tmult\ts4,s5\n 1c0:\tmove\ts1,v1\n 1c4:\tsra\ts0,v1,0x1f\n 1c8:\tlw\ts3,20(sp)\n 1cc:\tmfhi\ta0\n 1d0:\tmflo\ta1\n 1d4:\tmove\ta2,s0\n 1d8:\tnop\n 1dc:\tjal\t0 \n 1e0:\tmove\ta3,s1\n 1e4:\tnop\n 1e8:\tmult\ts3,s5\n 1ec:\tmove\ta2,s0\n 1f0:\tmove\ta3,s1\n 1f4:\tlw\ts2,24(sp)\n 1f8:\tmfhi\ta0\n 1fc:\tmflo\ta1\n\t...\n 208:\tjal\t0 \n 20c:\tsubu\ts4,v1,s4\n 210:\tnop\n 214:\tmult\ts2,s5\n 218:\tmove\ta2,s0\n 21c:\tmove\ta3,s1\n 220:\tsubu\ts3,v1,s3\n 224:\tsw\ts4,16(sp)\n 228:\tmfhi\ta0\n 22c:\tmflo\ta1\n\t...\n 238:\tjal\t0 \n 23c:\tsw\ts3,20(sp)\n 240:\tsubu\ts2,v1,s2\n 244:\tsw\ts2,24(sp)\n 248:\tlw\tv0,2948(s6)\n 24c:\tandi\tv0,v0,0x80\n 250:\tbnez\tv0,2e4 \n 254:\tnop\n 258:\tlw\tv0,2948(s7)\n 25c:\tandi\tv0,v0,0x80\n 260:\tbeqz\tv0,298 \n 264:\tsrl\tv0,s4,0x1f\n 268:\tlw\tv0,1076(s6)\n 26c:\tsubu\tv0,v0,s4\n 270:\tsw\tv0,1076(s6)\n 274:\tlw\tv0,1080(s6)\n 278:\tlw\tv1,20(sp)\n 27c:\tsubu\tv0,v0,v1\n 280:\tsw\tv0,1080(s6)\n 284:\tlw\tv0,1084(s6)\n 288:\tlw\tv1,24(sp)\n 28c:\tsubu\tv0,v0,v1\n 290:\tj\t2e4 \n 294:\tsw\tv0,1084(s6)\n 298:\tlw\tv1,1076(s6)\n 29c:\taddu\tv0,s4,v0\n 2a0:\tsra\tv0,v0,0x1\n 2a4:\tsubu\tv1,v1,v0\n 2a8:\tsw\tv1,1076(s6)\n 2ac:\tlw\tv0,20(sp)\n 2b0:\tlw\tv1,1080(s6)\n 2b4:\tsrl\ta0,v0,0x1f\n 2b8:\taddu\tv0,v0,a0\n 2bc:\tsra\tv0,v0,0x1\n 2c0:\tsubu\tv1,v1,v0\n 2c4:\tsw\tv1,1080(s6)\n 2c8:\tlw\tv0,24(sp)\n 2cc:\tlw\tv1,1084(s6)\n 2d0:\tsrl\ta0,v0,0x1f\n 2d4:\taddu\tv0,v0,a0\n 2d8:\tsra\tv0,v0,0x1\n 2dc:\tsubu\tv1,v1,v0\n 2e0:\tsw\tv1,1084(s6)\n 2e4:\tlw\tt0,36(sp)\n 2e8:\tlw\tt1,52(sp)\n 2ec:\tlbu\tv0,94(t0)\n 2f0:\taddiu\ts8,s8,1\n 2f4:\taddiu\tt1,t1,3048\n 2f8:\tslt\tv0,s8,v0\n 2fc:\tbnez\tv0,48 \n 300:\tsw\tt1,52(sp)\n 304:\tlw\tra,100(sp)\n 308:\tlw\ts8,96(sp)\n 30c:\tlw\ts7,92(sp)\n 310:\tlw\ts6,88(sp)\n 314:\tlw\ts5,84(sp)\n 318:\tlw\ts4,80(sp)\n 31c:\tlw\ts3,76(sp)\n 320:\tlw\ts2,72(sp)\n 324:\tlw\ts1,68(sp)\n 328:\tlw\ts0,64(sp)\n 32c:\tjr\tra\n 330:\taddiu\tsp,sp,104\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-9c00ae27ec8e5d7c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t00000334 func_8005AB58_5B758\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n0000008c R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n000001dc R_MIPS_26 __divdi3\n00000208 R_MIPS_26 __divdi3\n00000238 R_MIPS_26 __divdi3\n00000290 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdff98 afb60058 0080b021 afbf0064 '......X...!...d\n 0010 afbe0060 afb7005c afb50054 afb40050 ...`...\\...T...P\n 0020 afb3004c afb20048 afb10044 0c000000 ...L...H...D....\n 0030 afb00040 afa20024 9042005e 184000b1 ...@...$.B.^.@..\n 0040 0000f021 afa00034 8fa80024 8fa90034 ...!...4...$...4\n 0050 8d020010 92c30bb8 0049b821 92e20bb8 .........I.!....\n 0060 106200a2 00000000 8ec20b88 30420010 .b..........0B..\n 0070 1440009e 00000000 8ee20b88 30420010 .@..........0B..\n 0080 1440009a 27a40010 26e50ad4 0c000000 .@..'...&.......\n 0090 2406000c 8fa40010 8ee20434 8fa50014 $..........4....\n 00a0 00822021 afa40010 8ee20438 8fa60018 .. !.......8....\n 00b0 00a22821 afa50014 8ee2043c 00c23021 ..(!.......<..0!\n 00c0 afa60018 8ec20434 8ec30ad4 00431021 .......4.....C.!\n 00d0 00822023 afa40010 8ec20438 8ec30ad8 .. #.......8....\n 00e0 00431021 00a23823 afa70014 8ec2043c .C.!..8#.......<\n 00f0 8ec30adc 00431021 00c23023 afa60018 .....C.!..0#....\n 0100 8ee30ae0 8ec20ae0 0062a821 00151823 .........b.!...#\n 0110 0064102a 10400073 0095102a 10400071 .d.*.@.s...*.@.q\n 0120 0067102a 1040006f 00f5102a 1040006d .g.*.@.o...*.@.m\n 0130 0066102a 1040006b 00d5102a 10400069 .f.*.@.k...*.@.i\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80038 ...............8\n 0170 afa9003c 00a92821 00a9302b 00882021 ...<..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00401821 0075102a 1040004e 00000000 .@.!.u.*.@.N....\n 01b0 50600001 24030001 8fb40010 02950018 P`..$...........\n 01c0 00608821 000387c3 8fb30014 00002010 .`.!.......... .\n 01d0 00002812 02003021 00000000 0c000000 ..(...0!........\n 01e0 02203821 00000000 02750018 02003021 . 8!.....u....0!\n 01f0 02203821 8fb20018 00002010 00002812 . 8!...... ...(.\n 0200 00000000 00000000 0c000000 0074a023 .............t.#\n 0210 00000000 02550018 02003021 02203821 .....U....0!. 8!\n 0220 00739823 afb40010 00002010 00002812 .s.#...... ...(.\n 0230 00000000 00000000 0c000000 afb30014 ................\n 0240 00729023 afb20018 8ec20b84 30420080 .r.#........0B..\n 0250 14400024 00000000 8ee20b84 30420080 .@.$........0B..\n 0260 1040000d 001417c2 8ec20434 00541023 .@.........4.T.#\n 0270 aec20434 8ec20438 8fa30014 00431023 ...4...8.....C.#\n 0280 aec20438 8ec2043c 8fa30018 00431023 ...8...<.....C.#\n 0290 080000b9 aec2043c 8ec30434 02821021 .......<...4...!\n 02a0 00021043 00621823 aec30434 8fa20014 ...C.b.#...4....\n 02b0 8ec30438 000227c2 00441021 00021043 ...8..'..D.!...C\n 02c0 00621823 aec30438 8fa20018 8ec3043c .b.#...8.......<\n 02d0 000227c2 00441021 00021043 00621823 ..'..D.!...C.b.#\n 02e0 aec3043c 8fa80024 8fa90034 9102005e ...<...$...4...^\n 02f0 27de0001 25290be8 03c2102a 1440ff52 '...%).....*.@.R\n 0300 afa90034 8fbf0064 8fbe0060 8fb7005c ...4...d...`...\\\n 0310 8fb60058 8fb50054 8fb40050 8fb3004c ...X...T...P...L\n 0320 8fb20048 8fb10044 8fb00040 03e00008 ...H...D...@....\n 0330 27bd0068 00000000 00000000 00000000 '..h............\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005AB58_5B758\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005AB58_5B758 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_8005AE8C_5BA8C:gcc2.7.2kmc","sym":"func_8005AE8C_5BA8C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["int64","memory","struct","goto","do-while","loop","bitwise","call","magic-div"],"loc":109,"refSource":"void func_8005AE8C_5BA8C(Player *player) {\n Vec3i deltaPos;\n u8 pad[0x8];\n void *collisionBoxPtr;\n s32 unused1;\n s32 unused2;\n s32 combinedRadius;\n s32 negRadius;\n s32 dist;\n s32 boxIndex;\n Player *targetPlayer;\n Player *players;\n\n players = ((GameState *)getCurrentAllocation())->players;\n targetPlayer = players + 1;\n\n /* Skip collision if players are on the same team */\n if (player->unkBB8 == targetPlayer->unkBB8) {\n return;\n }\n /* Skip if either player has collision disabled (flag 0x10) */\n if (player->unkB88 & 0x10) {\n return;\n }\n if (targetPlayer->unkB88 & 0x10) {\n return;\n }\n\n if ((s8)targetPlayer->unkBB4 > 0) {\n boxIndex = 0;\n collisionBoxPtr = targetPlayer;\n do {\n /* Copy target's collision box local position (offset 0xAE4 is unkAE4 array) */\n memcpy(&deltaPos, (u8 *)collisionBoxPtr + 0xAE4, 0xC);\n\n /* Convert to world space */\n deltaPos.x += targetPlayer->worldPos.x;\n deltaPos.y += targetPlayer->worldPos.y;\n deltaPos.z += targetPlayer->worldPos.z;\n\n /* Calculate relative position to player's collision box */\n deltaPos.x -= player->worldPos.x + player->unkAD4[0];\n deltaPos.y -= player->worldPos.y + player->unkAD4[1];\n deltaPos.z -= player->worldPos.z + player->unkAD4[2];\n\n /* Sum of both collision box radii */\n combinedRadius = (&targetPlayer->unkB2C)[boxIndex] + player->unkAE0;\n negRadius = -combinedRadius;\n\n /* Quick AABB check before expensive distance calculation */\n if (negRadius < deltaPos.x && deltaPos.x < combinedRadius && negRadius < deltaPos.y &&\n deltaPos.y < combinedRadius && negRadius < deltaPos.z && deltaPos.z < combinedRadius) {\n\n dist =\n isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.y * deltaPos.y + (s64)deltaPos.z * deltaPos.z);\n\n if (dist < combinedRadius) {\n /* Check for special knockback on collision boxes 4-5 when target is in state 1 */\n if (targetPlayer->unkBD9 == 1) {\n if ((targetPlayer->unkB84 & 0x40000) && (u32)(boxIndex - 4) < 2U) {\n func_80058B30_59730(player);\n goto next;\n }\n }\n /* Check for special knockback on collision boxes 1-2 when target is in state 3 */\n if (targetPlayer->unkBD9 == 3 && (targetPlayer->unkB84 & 0x40000) && (u32)(boxIndex - 1) < 2U) {\n func_80058B30_59730(player);\n goto next;\n }\n\n /* Avoid divide by zero */\n if (dist == 0) {\n dist = 1;\n }\n\n /* Calculate push vector to separate the players */\n deltaPos.x = ((s64)deltaPos.x * combinedRadius / dist) - deltaPos.x;\n deltaPos.y = ((s64)deltaPos.y * combinedRadius / dist) - deltaPos.y;\n deltaPos.z = ((s64)deltaPos.z * combinedRadius / dist) - deltaPos.z;\n\n /* Push player out of collision */\n player->worldPos.x -= deltaPos.x;\n player->worldPos.y -= deltaPos.y;\n player->worldPos.z -= deltaPos.z;\n\n /* Apply knockback if target is in state 2 and colliding with main collision box */\n if ((targetPlayer->unkBD9 == 2) & (boxIndex == 0)) {\n dist = isqrt64((s64)deltaPos.x * deltaPos.x + (s64)deltaPos.z * deltaPos.z);\n if (dist > 0x30000) {\n func_80058950_59550(\n player,\n func_8006D21C_6DE1C(\n targetPlayer->worldPos.x,\n targetPlayer->worldPos.z,\n player->worldPos.x,\n player->worldPos.z\n ),\n dist\n );\n }\n }\n }\n }\n next:\n boxIndex++;\n collisionBoxPtr = (u8 *)collisionBoxPtr + 0xC;\n } while (boxIndex < (s8)targetPlayer->unkBB4);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5AA90.c#L215-L323","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-96\n 4:\tsw\ts6,80(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,92(sp)\n 10:\tsw\ts8,88(sp)\n 14:\tsw\ts7,84(sp)\n 18:\tsw\ts5,76(sp)\n 1c:\tsw\ts4,72(sp)\n 20:\tsw\ts3,68(sp)\n 24:\tsw\ts2,64(sp)\n 28:\tsw\ts1,60(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,56(sp)\n 34:\tlw\ta0,16(v0)\n 38:\tlbu\tv1,3000(s6)\n 3c:\tlbu\tv0,6048(a0)\n 40:\tbeq\tv1,v0,390 \n 44:\taddiu\ts7,a0,3048\n 48:\tlw\tv0,2952(s6)\n 4c:\tandi\tv0,v0,0x10\n 50:\tbnez\tv0,390 \n 54:\tnop\n 58:\tlw\tv0,6000(a0)\n 5c:\tandi\tv0,v0,0x10\n 60:\tbnez\tv0,390 \n 64:\tnop\n 68:\tlb\tv0,6044(a0)\n 6c:\tblez\tv0,390 \n 70:\tmove\ts8,zero\n 74:\tsw\ts7,44(sp)\n 78:\tlw\tt0,44(sp)\n 7c:\taddiu\ta0,sp,16\n 80:\tli\ta2,12\n 84:\tjal\t0 \n 88:\taddiu\ta1,t0,2788\n 8c:\tlw\ta0,16(sp)\n 90:\tlw\tv0,1076(s7)\n 94:\tlw\ta1,20(sp)\n 98:\taddu\ta0,a0,v0\n 9c:\tsw\ta0,16(sp)\n a0:\tlw\tv0,1080(s7)\n a4:\tlw\ta2,24(sp)\n a8:\taddu\ta1,a1,v0\n ac:\tsw\ta1,20(sp)\n b0:\tlw\tv0,1084(s7)\n b4:\taddu\ta2,a2,v0\n b8:\tsw\ta2,24(sp)\n bc:\tlw\tv0,1076(s6)\n c0:\tlw\tv1,2772(s6)\n c4:\taddu\tv0,v0,v1\n c8:\tsubu\ta0,a0,v0\n cc:\tsw\ta0,16(sp)\n d0:\tlw\tv0,1080(s6)\n d4:\tlw\tv1,2776(s6)\n d8:\taddu\tv0,v0,v1\n dc:\tsubu\ta3,a1,v0\n e0:\tsw\ta3,20(sp)\n e4:\tlw\tv0,1084(s6)\n e8:\tlw\tv1,2780(s6)\n ec:\taddu\tv0,v0,v1\n f0:\tsubu\ta2,a2,v0\n f4:\tsll\tv0,s8,0x2\n f8:\taddu\tv0,v0,s7\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2860(v0)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,374 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,374 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,374 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,374 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,374 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,374 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,48(sp)\n 170:\tsw\tt1,52(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\ts2,v0\n 1a4:\tslt\tv0,s2,s5\n 1a8:\tbeqz\tv0,374 \n 1ac:\tli\tv0,1\n 1b0:\tlbu\tv1,3033(s7)\n 1b4:\tbne\tv1,v0,1e0 \n 1b8:\tli\tv0,3\n 1bc:\tlw\tv0,2948(s7)\n 1c0:\tlui\tt0,0x4\n 1c4:\tand\tv0,v0,t0\n 1c8:\tbeqz\tv0,1dc \n 1cc:\taddiu\tv0,s8,-4\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,204 \n 1d8:\tnop\n 1dc:\tli\tv0,3\n 1e0:\tbne\tv1,v0,214 \n 1e4:\tlui\tt1,0x4\n 1e8:\tlw\tv0,2948(s7)\n 1ec:\tand\tv0,v0,t1\n 1f0:\tbeqz\tv0,214 \n 1f4:\taddiu\tv0,s8,-1\n 1f8:\tsltiu\tv0,v0,2\n 1fc:\tbeqz\tv0,214 \n 200:\tnop\n 204:\tjal\t0 \n 208:\tmove\ta0,s6\n 20c:\tj\t374 \n 210:\tnop\n 214:\tbeqzl\ts2,21c \n 218:\tli\ts2,1\n 21c:\tlw\ts4,16(sp)\n 220:\tmult\ts4,s5\n 224:\tmove\ts1,s2\n 228:\tsra\ts0,s2,0x1f\n 22c:\tlw\ts3,20(sp)\n 230:\tmfhi\ta0\n 234:\tmflo\ta1\n 238:\tmove\ta2,s0\n 23c:\tnop\n 240:\tjal\t0 \n 244:\tmove\ta3,s1\n 248:\tnop\n 24c:\tmult\ts3,s5\n 250:\tmove\ta2,s0\n 254:\tmove\ta3,s1\n 258:\tlw\ts2,24(sp)\n 25c:\tmfhi\ta0\n 260:\tmflo\ta1\n\t...\n 26c:\tjal\t0 \n 270:\tsubu\ts4,v1,s4\n 274:\tnop\n 278:\tmult\ts2,s5\n 27c:\tmove\ta2,s0\n 280:\tmove\ta3,s1\n 284:\tsubu\ts3,v1,s3\n 288:\tsw\ts4,16(sp)\n 28c:\tmfhi\ta0\n 290:\tmflo\ta1\n\t...\n 29c:\tjal\t0 \n 2a0:\tsw\ts3,20(sp)\n 2a4:\tsubu\ts2,v1,s2\n 2a8:\tsw\ts2,24(sp)\n 2ac:\tlw\tv0,1076(s6)\n 2b0:\tsubu\tv0,v0,s4\n 2b4:\tsw\tv0,1076(s6)\n 2b8:\tlw\tv0,1080(s6)\n 2bc:\tlw\tv1,20(sp)\n 2c0:\tsubu\tv0,v0,v1\n 2c4:\tsw\tv0,1080(s6)\n 2c8:\tlw\tv0,1084(s6)\n 2cc:\tlw\tv1,24(sp)\n 2d0:\tsubu\tv0,v0,v1\n 2d4:\tsw\tv0,1084(s6)\n 2d8:\tlbu\tv0,3033(s7)\n 2dc:\tsltiu\tv1,s8,1\n 2e0:\txori\tv0,v0,0x2\n 2e4:\tsltiu\tv0,v0,1\n 2e8:\tand\tv0,v0,v1\n 2ec:\tbeqz\tv0,374 \n 2f0:\tnop\n 2f4:\tlw\tv0,16(sp)\n 2f8:\tmult\tv0,v0\n 2fc:\tlw\tv0,24(sp)\n 300:\tmfhi\ta0\n 304:\tmflo\ta1\n\t...\n 310:\tmult\tv0,v0\n 314:\tmfhi\tt0\n 318:\tmflo\tt1\n 31c:\tsw\tt0,48(sp)\n 320:\tsw\tt1,52(sp)\n 324:\taddu\ta1,a1,t1\n 328:\tsltu\tv0,a1,t1\n 32c:\taddu\ta0,a0,t0\n 330:\tjal\t0 \n 334:\taddu\ta0,a0,v0\n 338:\tmove\ts2,v0\n 33c:\tlui\tv0,0x3\n 340:\tslt\tv0,v0,s2\n 344:\tbeqz\tv0,374 \n 348:\tnop\n 34c:\tlw\ta0,1076(s7)\n 350:\tlw\ta1,1084(s7)\n 354:\tlw\ta2,1076(s6)\n 358:\tjal\t0 \n 35c:\tlw\ta3,1084(s6)\n 360:\tmove\ta0,s6\n 364:\tsll\tv0,v0,0x10\n 368:\tsra\ta1,v0,0x10\n 36c:\tjal\t0 \n 370:\tmove\ta2,s2\n 374:\tlw\tt0,44(sp)\n 378:\tlb\tv0,2996(s7)\n 37c:\taddiu\ts8,s8,1\n 380:\taddiu\tt0,t0,12\n 384:\tslt\tv0,s8,v0\n 388:\tbnez\tv0,78 \n 38c:\tsw\tt0,44(sp)\n 390:\tlw\tra,92(sp)\n 394:\tlw\ts8,88(sp)\n 398:\tlw\ts7,84(sp)\n 39c:\tlw\ts6,80(sp)\n 3a0:\tlw\ts5,76(sp)\n 3a4:\tlw\ts4,72(sp)\n 3a8:\tlw\ts3,68(sp)\n 3ac:\tlw\ts2,64(sp)\n 3b0:\tlw\ts1,60(sp)\n 3b4:\tlw\ts0,56(sp)\n 3b8:\tjr\tra\n 3bc:\taddiu\tsp,sp,96\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-3c0ef0b3e2c0.i.gz","proto":{"func_8005AE8C_5BA8C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-84d07a69b637e7e0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t000003c0 func_8005AE8C_5BA8C\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n00000000 *UND*\t00000000 func_80058B30_59730\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 func_80058950_59550\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n00000084 R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n00000204 R_MIPS_26 func_80058B30_59730\n0000020c R_MIPS_26 .text\n00000240 R_MIPS_26 __divdi3\n0000026c R_MIPS_26 __divdi3\n0000029c R_MIPS_26 __divdi3\n00000330 R_MIPS_26 isqrt64\n00000358 R_MIPS_26 func_8006D21C_6DE1C\n0000036c R_MIPS_26 func_80058950_59550\n\n\nContents of section .text:\n 0000 27bdffa0 afb60050 0080b021 afbf005c '......P...!...\\\n 0010 afbe0058 afb70054 afb5004c afb40048 ...X...T...L...H\n 0020 afb30044 afb20040 afb1003c 0c000000 ...D...@...<....\n 0030 afb00038 8c440010 92c30bb8 908217a0 ...8.D..........\n 0040 106200d3 24970be8 8ec20b88 30420010 .b..$.......0B..\n 0050 144000cf 00000000 8c821770 30420010 .@.........p0B..\n 0060 144000cb 00000000 8082179c 184000c8 .@...........@..\n 0070 0000f021 afb7002c 8fa8002c 27a40010 ...!...,...,'...\n 0080 2406000c 0c000000 25050ae4 8fa40010 $.......%.......\n 0090 8ee20434 8fa50014 00822021 afa40010 ...4...... !....\n 00a0 8ee20438 8fa60018 00a22821 afa50014 ...8......(!....\n 00b0 8ee2043c 00c23021 afa60018 8ec20434 ...<..0!.......4\n 00c0 8ec30ad4 00431021 00822023 afa40010 .....C.!.. #....\n 00d0 8ec20438 8ec30ad8 00431021 00a23823 ...8.....C.!..8#\n 00e0 afa70014 8ec2043c 8ec30adc 00431021 .......<.....C.!\n 00f0 00c23023 001e1080 00571021 afa60018 ..0#.....W.!....\n 0100 8c430b2c 8ec20ae0 0062a821 00151823 .C.,.....b.!...#\n 0110 0064102a 10400097 0095102a 10400095 .d.*.@.....*.@..\n 0120 0067102a 10400093 00f5102a 10400091 .g.*.@.....*.@..\n 0130 0066102a 1040008f 00d5102a 1040008d .f.*.@.....*.@..\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80030 ...............0\n 0170 afa90034 00a92821 00a9302b 00882021 ...4..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00409021 0255102a 10400072 24020001 .@.!.U.*.@.r$...\n 01b0 92e30bd9 1462000a 24020003 8ee20b84 .....b..$.......\n 01c0 3c080004 00481024 10400004 27c2fffc <....H.$.@..'...\n 01d0 2c420002 1440000b 00000000 24020003 ,B...@......$...\n 01e0 1462000c 3c090004 8ee20b84 00491024 .b..<........I.$\n 01f0 10400008 27c2ffff 2c420002 10400005 .@..'...,B...@..\n 0200 00000000 0c000000 02c02021 080000dd .......... !....\n 0210 00000000 52400001 24120001 8fb40010 ....R@..$.......\n 0220 02950018 02408821 001287c3 8fb30014 .....@.!........\n 0230 00002010 00002812 02003021 00000000 .. ...(...0!....\n 0240 0c000000 02203821 00000000 02750018 ..... 8!.....u..\n 0250 02003021 02203821 8fb20018 00002010 ..0!. 8!...... .\n 0260 00002812 00000000 00000000 0c000000 ..(.............\n 0270 0074a023 00000000 02550018 02003021 .t.#.....U....0!\n 0280 02203821 00739823 afb40010 00002010 . 8!.s.#...... .\n 0290 00002812 00000000 00000000 0c000000 ..(.............\n 02a0 afb30014 00729023 afb20018 8ec20434 .....r.#.......4\n 02b0 00541023 aec20434 8ec20438 8fa30014 .T.#...4...8....\n 02c0 00431023 aec20438 8ec2043c 8fa30018 .C.#...8...<....\n 02d0 00431023 aec2043c 92e20bd9 2fc30001 .C.#...<..../...\n 02e0 38420002 2c420001 00431024 10400021 8B..,B...C.$.@.!\n 02f0 00000000 8fa20010 00420018 8fa20018 .........B......\n 0300 00002010 00002812 00000000 00000000 .. ...(.........\n 0310 00420018 00004010 00004812 afa80030 .B....@...H....0\n 0320 afa90034 00a92821 00a9102b 00882021 ...4..(!...+.. !\n 0330 0c000000 00822021 00409021 3c020003 ...... !.@.!<...\n 0340 0052102a 1040000b 00000000 8ee40434 .R.*.@.........4\n 0350 8ee5043c 8ec60434 0c000000 8ec7043c ...<...4.......<\n 0360 02c02021 00021400 00022c03 0c000000 .. !......,.....\n 0370 02403021 8fa8002c 82e20bb4 27de0001 .@0!...,....'...\n 0380 2508000c 03c2102a 1440ff3b afa8002c %......*.@.;...,\n 0390 8fbf005c 8fbe0058 8fb70054 8fb60050 ...\\...X...T...P\n 03a0 8fb5004c 8fb40048 8fb30044 8fb20040 ...L...H...D...@\n 03b0 8fb1003c 8fb00038 03e00008 27bd0060 ...<...8....'..`\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005AE8C_5BA8C' — lift: cannot lift 'func_8005AE8C_5BA8C': 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,-96 */\n/* 4:\tsw\ts6,80(sp) */\n/* 8:\tmove\ts6,a0 */\n/* c:\tsw\tra,92(sp) */\n/* 10:\tsw\ts8,88(sp) */\n/* 14:\tsw\ts7,84(sp) */\n/* 18:\tsw\ts5,76(sp) */\n/* 1c:\tsw\ts4,72(sp) */\n/* 20:\tsw\ts3,68(sp) */\n/* 24:\tsw\ts2,64(sp) */\n/* 28:\tsw\ts1,60(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\ts0,56(sp) */\n/* 34:\tlw\ta0,16(v0) */\n/* 38:\tlbu\tv1,3000(s6) */\n/* 3c:\tlbu\tv0,6048(a0) */\n/* 40:\tbeq\tv1,v0,390 */\n/* 44:\taddiu\ts7,a0,3048 */\n/* 48:\tlw\tv0,2952(s6) */\n/* 4c:\tandi\tv0,v0,0x10 */\n/* 50:\tbnez\tv0,390 */\n/* 54:\tnop */\n/* 58:\tlw\tv0,6000(a0) */\n/* 5c:\tandi\tv0,v0,0x10 */\n/* 60:\tbnez\tv0,390 */\n/* 64:\tnop */\n/* 68:\tlb\tv0,6044(a0) */\n/* 6c:\tblez\tv0,390 */\n/* 70:\tmove\ts8,zero */\n/* 74:\tsw\ts7,44(sp) */\n/* 78:\tlw\tt0,44(sp) */\n/* 7c:\taddiu\ta0,sp,16 */\n/* 80:\tli\ta2,12 */\n/* 84:\tjal\t0 */\n/* 88:\taddiu\ta1,t0,2788 */\n/* 8c:\tlw\ta0,16(sp) */\n/* 90:\tlw\tv0,1076(s7) */\n/* 94:\tlw\ta1,20(sp) */\n/* 98:\taddu\ta0,a0,v0 */\n/* 9c:\tsw\ta0,16(sp) */\n/* a0:\tlw\tv0,1080(s7) */\n/* a4:\tlw\ta2,24(sp) */\n/* a8:\taddu\ta1,a1,v0 */\n/* ac:\tsw\ta1,20(sp) */\n/* b0:\tlw\tv0,1084(s7) */\n/* b4:\taddu\ta2,a2,v0 */\n/* b8:\tsw\ta2,24(sp) */\n/* bc:\tlw\tv0,1076(s6) */\n/* c0:\tlw\tv1,2772(s6) */\n/* c4:\taddu\tv0,v0,v1 */\n/* c8:\tsubu\ta0,a0,v0 */\n/* cc:\tsw\ta0,16(sp) */\n/* d0:\tlw\tv0,1080(s6) */\n/* d4:\tlw\tv1,2776(s6) */\n/* d8:\taddu\tv0,v0,v1 */\n/* dc:\tsubu\ta3,a1,v0 */\n/* e0:\tsw\ta3,20(sp) */\n/* e4:\tlw\tv0,1084(s6) */\n/* e8:\tlw\tv1,2780(s6) */\n/* ec:\taddu\tv0,v0,v1 */\n/* f0:\tsubu\ta2,a2,v0 */\n/* f4:\tsll\tv0,s8,0x2 */\n/* f8:\taddu\tv0,v0,s7 */\n/* fc:\tsw\ta2,24(sp) */\n/* 100:\tlw\tv1,2860(v0) */\n/* 104:\tlw\tv0,2784(s6) */\n/* 108:\taddu\ts5,v1,v0 */\n/* 10c:\tnegu\tv1,s5 */\n/* 110:\tslt\tv0,v1,a0 */\n/* 114:\tbeqz\tv0,374 */\n/* 118:\tslt\tv0,a0,s5 */\n/* 11c:\tbeqz\tv0,374 */\n/* 120:\tslt\tv0,v1,a3 */\n/* 124:\tbeqz\tv0,374 */\n/* 128:\tslt\tv0,a3,s5 */\n/* 12c:\tbeqz\tv0,374 */\n/* 130:\tslt\tv0,v1,a2 */\n/* 134:\tbeqz\tv0,374 */\n/* 138:\tslt\tv0,a2,s5 */\n/* 13c:\tbeqz\tv0,374 */\n/* 140:\tmult\ta0,a0 */\n/* 144:\tmfhi\ta0 */\n/* 148:\tmflo\ta1 */\n/* \t... */\n/* 154:\tmult\ta3,a3 */\n/* 158:\tmfhi\tt0 */\n/* 15c:\tmflo\tt1 */\n/* \t... */\n/* 168:\tmult\ta2,a2 */\n/* 16c:\tsw\tt0,48(sp) */\n/* 170:\tsw\tt1,52(sp) */\n/* 174:\taddu\ta1,a1,t1 */\n/* 178:\tsltu\ta2,a1,t1 */\n/* 17c:\taddu\ta0,a0,t0 */\n/* 180:\taddu\ta0,a0,a2 */\n/* 184:\tmfhi\tv0 */\n/* 188:\tmflo\tv1 */\n/* 18c:\taddu\ta1,a1,v1 */\n/* 190:\tsltu\ta2,a1,v1 */\n/* 194:\taddu\ta0,a0,v0 */\n/* 198:\tjal\t0 */\n/* 19c:\taddu\ta0,a0,a2 */\n/* 1a0:\tmove\ts2,v0 */\n/* 1a4:\tslt\tv0,s2,s5 */\n/* 1a8:\tbeqz\tv0,374 */\n/* 1ac:\tli\tv0,1 */\n/* 1b0:\tlbu\tv1,3033(s7) */\n/* 1b4:\tbne\tv1,v0,1e0 */\n/* 1b8:\tli\tv0,3 */\n/* 1bc:\tlw\tv0,2948(s7) */\n/* 1c0:\tlui\tt0,0x4 */\n/* 1c4:\tand\tv0,v0,t0 */\n/* 1c8:\tbeqz\tv0,1dc */\n/* 1cc:\taddiu\tv0,s8,-4 */\n/* 1d0:\tsltiu\tv0,v0,2 */\n/* 1d4:\tbnez\tv0,204 */\n/* 1d8:\tnop */\n/* 1dc:\tli\tv0,3 */\n/* 1e0:\tbne\tv1,v0,214 */\n/* 1e4:\tlui\tt1,0x4 */\n/* 1e8:\tlw\tv0,2948(s7) */\n/* 1ec:\tand\tv0,v0,t1 */\n/* 1f0:\tbeqz\tv0,214 */\n/* 1f4:\taddiu\tv0,s8,-1 */\n/* 1f8:\tsltiu\tv0,v0,2 */\n/* 1fc:\tbeqz\tv0,214 */\n/* 200:\tnop */\n/* 204:\tjal\t0 */\n/* 208:\tmove\ta0,s6 */\n/* 20c:\tj\t374 */\n/* 210:\tnop */\n/* 214:\tbeqzl\ts2,21c */\n/* 218:\tli\ts2,1 */\n/* 21c:\tlw\ts4,16(sp) */\n/* 220:\tmult\ts4,s5 */\n/* 224:\tmove\ts1,s2 */\n/* 228:\tsra\ts0,s2,0x1f */\n/* 22c:\tlw\ts3,20(sp) */\n/* 230:\tmfhi\ta0 */\n/* 234:\tmflo\ta1 */\n/* 238:\tmove\ta2,s0 */\n/* 23c:\tnop */\n/* 240:\tjal\t0 */\n/* 244:\tmove\ta3,s1 */\n/* 248:\tnop */\n/* 24c:\tmult\ts3,s5 */\n/* 250:\tmove\ta2,s0 */\n/* 254:\tmove\ta3,s1 */\n/* 258:\tlw\ts2,24(sp) */\n/* 25c:\tmfhi\ta0 */\n/* 260:\tmflo\ta1 */\n/* \t... */\n/* 26c:\tjal\t0 */\n/* 270:\tsubu\ts4,v1,s4 */\n/* 274:\tnop */\n/* 278:\tmult\ts2,s5 */\n/* 27c:\tmove\ta2,s0 */\n/* 280:\tmove\ta3,s1 */\n/* 284:\tsubu\ts3,v1,s3 */\n/* 288:\tsw\ts4,16(sp) */\n/* 28c:\tmfhi\ta0 */\n/* 290:\tmflo\ta1 */\n/* \t... */\n/* 29c:\tjal\t0 */\n/* 2a0:\tsw\ts3,20(sp) */\n/* 2a4:\tsubu\ts2,v1,s2 */\n/* 2a8:\tsw\ts2,24(sp) */\n/* 2ac:\tlw\tv0,1076(s6) */\n/* 2b0:\tsubu\tv0,v0,s4 */\n/* 2b4:\tsw\tv0,1076(s6) */\n/* 2b8:\tlw\tv0,1080(s6) */\n/* 2bc:\tlw\tv1,20(sp) */\n/* 2c0:\tsubu\tv0,v0,v1 */\n/* 2c4:\tsw\tv0,1080(s6) */\n/* 2c8:\tlw\tv0,1084(s6) */\n/* 2cc:\tlw\tv1,24(sp) */\n/* 2d0:\tsubu\tv0,v0,v1 */\n/* 2d4:\tsw\tv0,1084(s6) */\n/* 2d8:\tlbu\tv0,3033(s7) */\n/* 2dc:\tsltiu\tv1,s8,1 */\n/* 2e0:\txori\tv0,v0,0x2 */\n/* 2e4:\tsltiu\tv0,v0,1 */\n/* 2e8:\tand\tv0,v0,v1 */\n/* 2ec:\tbeqz\tv0,374 */\n/* 2f0:\tnop */\n/* 2f4:\tlw\tv0,16(sp) */\n/* 2f8:\tmult\tv0,v0 */\n/* 2fc:\tlw\tv0,24(sp) */\n/* 300:\tmfhi\ta0 */\n/* 304:\tmflo\ta1 */\n/* \t... */\n/* 310:\tmult\tv0,v0 */\n/* 314:\tmfhi\tt0 */\n/* 318:\tmflo\tt1 */\n/* 31c:\tsw\tt0,48(sp) */\n/* 320:\tsw\tt1,52(sp) */\n/* 324:\taddu\ta1,a1,t1 */\n/* 328:\tsltu\tv0,a1,t1 */\n/* 32c:\taddu\ta0,a0,t0 */\n/* 330:\tjal\t0 */\n/* 334:\taddu\ta0,a0,v0 */\n/* 338:\tmove\ts2,v0 */\n/* 33c:\tlui\tv0,0x3 */\n/* 340:\tslt\tv0,v0,s2 */\n/* 344:\tbeqz\tv0,374 */\n/* 348:\tnop */\n/* 34c:\tlw\ta0,1076(s7) */\n/* 350:\tlw\ta1,1084(s7) */\n/* 354:\tlw\ta2,1076(s6) */\n/* 358:\tjal\t0 */\n/* 35c:\tlw\ta3,1084(s6) */\n/* 360:\tmove\ta0,s6 */\n/* 364:\tsll\tv0,v0,0x10 */\n/* 368:\tsra\ta1,v0,0x10 */\n/* 36c:\tjal\t0 */\n/* 370:\tmove\ta2,s2 */\n/* 374:\tlw\tt0,44(sp) */\n/* 378:\tlb\tv0,2996(s7) */\n/* 37c:\taddiu\ts8,s8,1 */\n/* 380:\taddiu\tt0,t0,12 */\n/* 384:\tslt\tv0,s8,v0 */\n/* 388:\tbnez\tv0,78 */\n/* 38c:\tsw\tt0,44(sp) */\n/* 390:\tlw\tra,92(sp) */\n/* 394:\tlw\ts8,88(sp) */\n/* 398:\tlw\ts7,84(sp) */\n/* 39c:\tlw\ts6,80(sp) */\n/* 3a0:\tlw\ts5,76(sp) */\n/* 3a4:\tlw\ts4,72(sp) */\n/* 3a8:\tlw\ts3,68(sp) */\n/* 3ac:\tlw\ts2,64(sp) */\n/* 3b0:\tlw\ts1,60(sp) */\n/* 3b4:\tlw\ts0,56(sp) */\n/* 3b8:\tjr\tra */\n/* 3bc:\taddiu\tsp,sp,96 */\nvoid func_8005AE8C_5BA8C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005AE8C_5BA8C': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":243,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005AE8C_5BA8C': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\n? func_80058B30_59730(Player *); /* extern */\n\nvoid func_8005AE8C_5BA8C(Player *player) {\n s32 sp10;\n s32 sp14;\n s32 sp18;\n void *sp2C;\n s32 sp30;\n u32 sp34;\n s32 temp_a0_2;\n s32 temp_a0_3;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a3;\n s32 temp_hi;\n s32 temp_hi_2;\n s32 temp_s0;\n s32 temp_s3;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_s2;\n s32 var_s8;\n u32 temp_a1_2;\n u32 temp_a1_3;\n u32 temp_a1_4;\n u32 temp_lo;\n u32 temp_lo_2;\n u32 temp_lo_3;\n u8 temp_v1_2;\n void *temp_a0;\n void *temp_s7;\n\n temp_a0 = getCurrentAllocation()->unk10;\n temp_s7 = temp_a0 + 0xBE8;\n if ((player->unkBB8 != temp_a0->unk17A0) && !(player->unkB88 & 0x10) && !(temp_a0->unk1770 & 0x10)) {\n var_s8 = 0;\n if (temp_a0->unk179C > 0) {\n sp2C = temp_s7;\n do {\n memcpy(&sp10, sp2C + 0xAE4, 0xCU);\n temp_a0_2 = sp10 + temp_s7->unk434;\n sp10 = temp_a0_2;\n temp_a1 = sp14 + temp_s7->unk438;\n sp14 = temp_a1;\n temp_a2 = sp18 + temp_s7->unk43C;\n sp18 = temp_a2;\n temp_a0_3 = temp_a0_2 - (player->worldPos.x + player->unkAD4[0]);\n sp10 = temp_a0_3;\n temp_a3 = temp_a1 - (player->worldPos.y + player->unkAD4[1]);\n sp14 = temp_a3;\n temp_a2_2 = temp_a2 - (player->worldPos.z + player->unkAD4[2]);\n sp18 = temp_a2_2;\n temp_s5 = ((var_s8 * 4) + temp_s7)->unkB2C + player->unkAE0;\n temp_v1 = -temp_s5;\n if ((temp_v1 < temp_a0_3) && (temp_a0_3 < temp_s5) && (temp_v1 < temp_a3) && (temp_a3 < temp_s5) && (temp_v1 < temp_a2_2) && (temp_a2_2 < temp_s5)) {\n temp_hi = MULT_HI(temp_a3, temp_a3);\n temp_lo = temp_a3 * temp_a3;\n temp_lo_2 = temp_a2_2 * temp_a2_2;\n sp30 = temp_hi;\n sp34 = temp_lo;\n temp_a1_2 = (temp_a0_3 * temp_a0_3) + temp_lo;\n temp_a1_3 = temp_a1_2 + temp_lo_2;\n var_s2 = isqrt64(/* s64+0x0 */ (MULT_HI(temp_a0_3, temp_a0_3) + temp_hi + (temp_a1_2 < temp_lo) + MULT_HI(temp_a2_2, temp_a2_2) + (temp_a1_3 < temp_lo_2)), /* s64+0x4 */ temp_a1_3);\n if (var_s2 < temp_s5) {\n temp_v1_2 = temp_s7->unkBD9;\n if (temp_v1_2 == 1) {\n if (!(temp_s7->unkB84 & 0x40000) || ((u32) (var_s8 - 4) >= 2U)) {\n goto block_16;\n }\n goto block_19;\n }\nblock_16:\n if ((temp_v1_2 == 3) && (temp_s7->unkB84 & 0x40000) && ((u32) (var_s8 - 1) < 2U)) {\nblock_19:\n func_80058B30_59730(player);\n } else {\n if (var_s2 == 0) {\n var_s2 = 1;\n }\n temp_s0 = var_s2 >> 0x1F;\n temp_s4 = (u32) __divdi3(MULT_HI(sp10, temp_s5), sp10 * temp_s5, temp_s0, var_s2) - sp10;\n temp_s3 = (u32) __divdi3(MULT_HI(sp14, temp_s5), sp14 * temp_s5, temp_s0, var_s2) - sp14;\n sp10 = temp_s4;\n sp14 = temp_s3;\n sp18 = (u32) __divdi3(MULT_HI(sp18, temp_s5), sp18 * temp_s5, temp_s0, var_s2) - sp18;\n player->worldPos.x -= temp_s4;\n player->worldPos.y -= sp14;\n player->worldPos.z -= sp18;\n if ((temp_s7->unkBD9 == 2) & (var_s8 == 0)) {\n temp_hi_2 = MULT_HI(sp18, sp18);\n temp_lo_3 = sp18 * sp18;\n sp30 = temp_hi_2;\n sp34 = temp_lo_3;\n temp_a1_4 = (sp10 * sp10) + temp_lo_3;\n temp_v0 = isqrt64(/* s64+0x0 */ (MULT_HI(sp10, sp10) + temp_hi_2 + (temp_a1_4 < temp_lo_3)), /* s64+0x4 */ temp_a1_4);\n if (temp_v0 > 0x30000) {\n func_80058950_59550(player, func_8006D21C_6DE1C(temp_s7->unk434, temp_s7->unk43C, player->worldPos.x, player->worldPos.z), temp_v0);\n }\n }\n }\n }\n }\n var_s8 += 1;\n sp2C += 0xC;\n } while (var_s8 < temp_s7->unkBB4);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":70,"lines":110,"gotos":2,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005AE8C_5BA8C` — benchmark function snowboardkids2:func_8005AE8C_5BA8C:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_8005AE8C_5BA8C\n addiu\t$sp, $sp, -96\n sw\t$s6, 80($sp)\n move\t$s6, $a0\n sw\t$ra, 92($sp)\n sw\t$s8, 88($sp)\n sw\t$s7, 84($sp)\n sw\t$s5, 76($sp)\n sw\t$s4, 72($sp)\n sw\t$s3, 68($sp)\n sw\t$s2, 64($sp)\n sw\t$s1, 60($sp)\n jal\tgetCurrentAllocation\n sw\t$s0, 56($sp)\n lw\t$a0, 16($v0)\n lbu\t$v1, 3000($s6)\n lbu\t$v0, 6048($a0)\n beq\t$v1, $v0, .L390\n addiu\t$s7, $a0, 3048\n lw\t$v0, 2952($s6)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L390\n nop\n lw\t$v0, 6000($a0)\n andi\t$v0, $v0, 0x10\n bnez\t$v0, .L390\n nop\n lb\t$v0, 6044($a0)\n blez\t$v0, .L390\n move\t$s8, $zero\n sw\t$s7, 44($sp)\n.L78:\n lw\t$t0, 44($sp)\n addiu\t$a0, $sp, 16\n li\t$a2, 12\n jal\tmemcpy\n addiu\t$a1, $t0, 2788\n lw\t$a0, 16($sp)\n lw\t$v0, 1076($s7)\n lw\t$a1, 20($sp)\n addu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s7)\n lw\t$a2, 24($sp)\n addu\t$a1, $a1, $v0\n sw\t$a1, 20($sp)\n lw\t$v0, 1084($s7)\n addu\t$a2, $a2, $v0\n sw\t$a2, 24($sp)\n lw\t$v0, 1076($s6)\n lw\t$v1, 2772($s6)\n addu\t$v0, $v0, $v1\n subu\t$a0, $a0, $v0\n sw\t$a0, 16($sp)\n lw\t$v0, 1080($s6)\n lw\t$v1, 2776($s6)\n addu\t$v0, $v0, $v1\n subu\t$a3, $a1, $v0\n sw\t$a3, 20($sp)\n lw\t$v0, 1084($s6)\n lw\t$v1, 2780($s6)\n addu\t$v0, $v0, $v1\n subu\t$a2, $a2, $v0\n sll\t$v0, $s8, 0x2\n addu\t$v0, $v0, $s7\n sw\t$a2, 24($sp)\n lw\t$v1, 2860($v0)\n lw\t$v0, 2784($s6)\n addu\t$s5, $v1, $v0\n negu\t$v1, $s5\n slt\t$v0, $v1, $a0\n beqz\t$v0, .L374\n slt\t$v0, $a0, $s5\n beqz\t$v0, .L374\n slt\t$v0, $v1, $a3\n beqz\t$v0, .L374\n slt\t$v0, $a3, $s5\n beqz\t$v0, .L374\n slt\t$v0, $v1, $a2\n beqz\t$v0, .L374\n slt\t$v0, $a2, $s5\n beqz\t$v0, .L374\n mult\t$a0, $a0\n mfhi\t$a0\n mflo\t$a1\n mult\t$a3, $a3\n mfhi\t$t0\n mflo\t$t1\n mult\t$a2, $a2\n sw\t$t0, 48($sp)\n sw\t$t1, 52($sp)\n addu\t$a1, $a1, $t1\n sltu\t$a2, $a1, $t1\n addu\t$a0, $a0, $t0\n addu\t$a0, $a0, $a2\n mfhi\t$v0\n mflo\t$v1\n addu\t$a1, $a1, $v1\n sltu\t$a2, $a1, $v1\n addu\t$a0, $a0, $v0\n jal\tisqrt64\n addu\t$a0, $a0, $a2\n move\t$s2, $v0\n slt\t$v0, $s2, $s5\n beqz\t$v0, .L374\n li\t$v0, 1\n lbu\t$v1, 3033($s7)\n bne\t$v1, $v0, .L1e0\n li\t$v0, 3\n lw\t$v0, 2948($s7)\n lui\t$t0, 0x4\n and\t$v0, $v0, $t0\n beqz\t$v0, .L1dc\n addiu\t$v0, $s8, -4\n sltiu\t$v0, $v0, 2\n bnez\t$v0, .L204\n nop\n.L1dc:\n li\t$v0, 3\n.L1e0:\n bne\t$v1, $v0, .L214\n lui\t$t1, 0x4\n lw\t$v0, 2948($s7)\n and\t$v0, $v0, $t1\n beqz\t$v0, .L214\n addiu\t$v0, $s8, -1\n sltiu\t$v0, $v0, 2\n beqz\t$v0, .L214\n nop\n.L204:\n jal\tfunc_80058B30_59730\n move\t$a0, $s6\n j\t.L374\n nop\n.L214:\n beqzl\t$s2, .L21c\n li\t$s2, 1\n.L21c:\n lw\t$s4, 16($sp)\n mult\t$s4, $s5\n move\t$s1, $s2\n sra\t$s0, $s2, 0x1f\n lw\t$s3, 20($sp)\n mfhi\t$a0\n mflo\t$a1\n move\t$a2, $s0\n nop\n jal\t__divdi3\n move\t$a3, $s1\n nop\n mult\t$s3, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n lw\t$s2, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n subu\t$s4, $v1, $s4\n nop\n mult\t$s2, $s5\n move\t$a2, $s0\n move\t$a3, $s1\n subu\t$s3, $v1, $s3\n sw\t$s4, 16($sp)\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$s3, 20($sp)\n subu\t$s2, $v1, $s2\n sw\t$s2, 24($sp)\n lw\t$v0, 1076($s6)\n subu\t$v0, $v0, $s4\n sw\t$v0, 1076($s6)\n lw\t$v0, 1080($s6)\n lw\t$v1, 20($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1080($s6)\n lw\t$v0, 1084($s6)\n lw\t$v1, 24($sp)\n subu\t$v0, $v0, $v1\n sw\t$v0, 1084($s6)\n lbu\t$v0, 3033($s7)\n sltiu\t$v1, $s8, 1\n xori\t$v0, $v0, 0x2\n sltiu\t$v0, $v0, 1\n and\t$v0, $v0, $v1\n beqz\t$v0, .L374\n nop\n lw\t$v0, 16($sp)\n mult\t$v0, $v0\n lw\t$v0, 24($sp)\n mfhi\t$a0\n mflo\t$a1\n mult\t$v0, $v0\n mfhi\t$t0\n mflo\t$t1\n sw\t$t0, 48($sp)\n sw\t$t1, 52($sp)\n addu\t$a1, $a1, $t1\n sltu\t$v0, $a1, $t1\n addu\t$a0, $a0, $t0\n jal\tisqrt64\n addu\t$a0, $a0, $v0\n move\t$s2, $v0\n lui\t$v0, 0x3\n slt\t$v0, $v0, $s2\n beqz\t$v0, .L374\n nop\n lw\t$a0, 1076($s7)\n lw\t$a1, 1084($s7)\n lw\t$a2, 1076($s6)\n jal\tfunc_8006D21C_6DE1C\n lw\t$a3, 1084($s6)\n move\t$a0, $s6\n sll\t$v0, $v0, 0x10\n sra\t$a1, $v0, 0x10\n jal\tfunc_80058950_59550\n move\t$a2, $s2\n.L374:\n lw\t$t0, 44($sp)\n lb\t$v0, 2996($s7)\n addiu\t$s8, $s8, 1\n addiu\t$t0, $t0, 12\n slt\t$v0, $s8, $v0\n bnez\t$v0, .L78\n sw\t$t0, 44($sp)\n.L390:\n lw\t$ra, 92($sp)\n lw\t$s8, 88($sp)\n lw\t$s7, 84($sp)\n lw\t$s6, 80($sp)\n lw\t$s5, 76($sp)\n lw\t$s4, 72($sp)\n lw\t$s3, 68($sp)\n lw\t$s2, 64($sp)\n lw\t$s1, 60($sp)\n lw\t$s0, 56($sp)\n jr\t$ra\n addiu\t$sp, $sp, 96\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-3c0ef0b3e2c0.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8005AE8C_5BA8C(Player *player);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005AE8C_5BA8C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005AE8C_5BA8C` — benchmark function snowboardkids2:func_8005AE8C_5BA8C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005AE8C_5BA8C: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,-96\n 4:\tsw\ts6,80(sp)\n 8:\tmove\ts6,a0\n c:\tsw\tra,92(sp)\n 10:\tsw\ts8,88(sp)\n 14:\tsw\ts7,84(sp)\n 18:\tsw\ts5,76(sp)\n 1c:\tsw\ts4,72(sp)\n 20:\tsw\ts3,68(sp)\n 24:\tsw\ts2,64(sp)\n 28:\tsw\ts1,60(sp)\n 2c:\tjal\t0 \n 30:\tsw\ts0,56(sp)\n 34:\tlw\ta0,16(v0)\n 38:\tlbu\tv1,3000(s6)\n 3c:\tlbu\tv0,6048(a0)\n 40:\tbeq\tv1,v0,390 \n 44:\taddiu\ts7,a0,3048\n 48:\tlw\tv0,2952(s6)\n 4c:\tandi\tv0,v0,0x10\n 50:\tbnez\tv0,390 \n 54:\tnop\n 58:\tlw\tv0,6000(a0)\n 5c:\tandi\tv0,v0,0x10\n 60:\tbnez\tv0,390 \n 64:\tnop\n 68:\tlb\tv0,6044(a0)\n 6c:\tblez\tv0,390 \n 70:\tmove\ts8,zero\n 74:\tsw\ts7,44(sp)\n 78:\tlw\tt0,44(sp)\n 7c:\taddiu\ta0,sp,16\n 80:\tli\ta2,12\n 84:\tjal\t0 \n 88:\taddiu\ta1,t0,2788\n 8c:\tlw\ta0,16(sp)\n 90:\tlw\tv0,1076(s7)\n 94:\tlw\ta1,20(sp)\n 98:\taddu\ta0,a0,v0\n 9c:\tsw\ta0,16(sp)\n a0:\tlw\tv0,1080(s7)\n a4:\tlw\ta2,24(sp)\n a8:\taddu\ta1,a1,v0\n ac:\tsw\ta1,20(sp)\n b0:\tlw\tv0,1084(s7)\n b4:\taddu\ta2,a2,v0\n b8:\tsw\ta2,24(sp)\n bc:\tlw\tv0,1076(s6)\n c0:\tlw\tv1,2772(s6)\n c4:\taddu\tv0,v0,v1\n c8:\tsubu\ta0,a0,v0\n cc:\tsw\ta0,16(sp)\n d0:\tlw\tv0,1080(s6)\n d4:\tlw\tv1,2776(s6)\n d8:\taddu\tv0,v0,v1\n dc:\tsubu\ta3,a1,v0\n e0:\tsw\ta3,20(sp)\n e4:\tlw\tv0,1084(s6)\n e8:\tlw\tv1,2780(s6)\n ec:\taddu\tv0,v0,v1\n f0:\tsubu\ta2,a2,v0\n f4:\tsll\tv0,s8,0x2\n f8:\taddu\tv0,v0,s7\n fc:\tsw\ta2,24(sp)\n 100:\tlw\tv1,2860(v0)\n 104:\tlw\tv0,2784(s6)\n 108:\taddu\ts5,v1,v0\n 10c:\tnegu\tv1,s5\n 110:\tslt\tv0,v1,a0\n 114:\tbeqz\tv0,374 \n 118:\tslt\tv0,a0,s5\n 11c:\tbeqz\tv0,374 \n 120:\tslt\tv0,v1,a3\n 124:\tbeqz\tv0,374 \n 128:\tslt\tv0,a3,s5\n 12c:\tbeqz\tv0,374 \n 130:\tslt\tv0,v1,a2\n 134:\tbeqz\tv0,374 \n 138:\tslt\tv0,a2,s5\n 13c:\tbeqz\tv0,374 \n 140:\tmult\ta0,a0\n 144:\tmfhi\ta0\n 148:\tmflo\ta1\n\t...\n 154:\tmult\ta3,a3\n 158:\tmfhi\tt0\n 15c:\tmflo\tt1\n\t...\n 168:\tmult\ta2,a2\n 16c:\tsw\tt0,48(sp)\n 170:\tsw\tt1,52(sp)\n 174:\taddu\ta1,a1,t1\n 178:\tsltu\ta2,a1,t1\n 17c:\taddu\ta0,a0,t0\n 180:\taddu\ta0,a0,a2\n 184:\tmfhi\tv0\n 188:\tmflo\tv1\n 18c:\taddu\ta1,a1,v1\n 190:\tsltu\ta2,a1,v1\n 194:\taddu\ta0,a0,v0\n 198:\tjal\t0 \n 19c:\taddu\ta0,a0,a2\n 1a0:\tmove\ts2,v0\n 1a4:\tslt\tv0,s2,s5\n 1a8:\tbeqz\tv0,374 \n 1ac:\tli\tv0,1\n 1b0:\tlbu\tv1,3033(s7)\n 1b4:\tbne\tv1,v0,1e0 \n 1b8:\tli\tv0,3\n 1bc:\tlw\tv0,2948(s7)\n 1c0:\tlui\tt0,0x4\n 1c4:\tand\tv0,v0,t0\n 1c8:\tbeqz\tv0,1dc \n 1cc:\taddiu\tv0,s8,-4\n 1d0:\tsltiu\tv0,v0,2\n 1d4:\tbnez\tv0,204 \n 1d8:\tnop\n 1dc:\tli\tv0,3\n 1e0:\tbne\tv1,v0,214 \n 1e4:\tlui\tt1,0x4\n 1e8:\tlw\tv0,2948(s7)\n 1ec:\tand\tv0,v0,t1\n 1f0:\tbeqz\tv0,214 \n 1f4:\taddiu\tv0,s8,-1\n 1f8:\tsltiu\tv0,v0,2\n 1fc:\tbeqz\tv0,214 \n 200:\tnop\n 204:\tjal\t0 \n 208:\tmove\ta0,s6\n 20c:\tj\t374 \n 210:\tnop\n 214:\tbeqzl\ts2,21c \n 218:\tli\ts2,1\n 21c:\tlw\ts4,16(sp)\n 220:\tmult\ts4,s5\n 224:\tmove\ts1,s2\n 228:\tsra\ts0,s2,0x1f\n 22c:\tlw\ts3,20(sp)\n 230:\tmfhi\ta0\n 234:\tmflo\ta1\n 238:\tmove\ta2,s0\n 23c:\tnop\n 240:\tjal\t0 \n 244:\tmove\ta3,s1\n 248:\tnop\n 24c:\tmult\ts3,s5\n 250:\tmove\ta2,s0\n 254:\tmove\ta3,s1\n 258:\tlw\ts2,24(sp)\n 25c:\tmfhi\ta0\n 260:\tmflo\ta1\n\t...\n 26c:\tjal\t0 \n 270:\tsubu\ts4,v1,s4\n 274:\tnop\n 278:\tmult\ts2,s5\n 27c:\tmove\ta2,s0\n 280:\tmove\ta3,s1\n 284:\tsubu\ts3,v1,s3\n 288:\tsw\ts4,16(sp)\n 28c:\tmfhi\ta0\n 290:\tmflo\ta1\n\t...\n 29c:\tjal\t0 \n 2a0:\tsw\ts3,20(sp)\n 2a4:\tsubu\ts2,v1,s2\n 2a8:\tsw\ts2,24(sp)\n 2ac:\tlw\tv0,1076(s6)\n 2b0:\tsubu\tv0,v0,s4\n 2b4:\tsw\tv0,1076(s6)\n 2b8:\tlw\tv0,1080(s6)\n 2bc:\tlw\tv1,20(sp)\n 2c0:\tsubu\tv0,v0,v1\n 2c4:\tsw\tv0,1080(s6)\n 2c8:\tlw\tv0,1084(s6)\n 2cc:\tlw\tv1,24(sp)\n 2d0:\tsubu\tv0,v0,v1\n 2d4:\tsw\tv0,1084(s6)\n 2d8:\tlbu\tv0,3033(s7)\n 2dc:\tsltiu\tv1,s8,1\n 2e0:\txori\tv0,v0,0x2\n 2e4:\tsltiu\tv0,v0,1\n 2e8:\tand\tv0,v0,v1\n 2ec:\tbeqz\tv0,374 \n 2f0:\tnop\n 2f4:\tlw\tv0,16(sp)\n 2f8:\tmult\tv0,v0\n 2fc:\tlw\tv0,24(sp)\n 300:\tmfhi\ta0\n 304:\tmflo\ta1\n\t...\n 310:\tmult\tv0,v0\n 314:\tmfhi\tt0\n 318:\tmflo\tt1\n 31c:\tsw\tt0,48(sp)\n 320:\tsw\tt1,52(sp)\n 324:\taddu\ta1,a1,t1\n 328:\tsltu\tv0,a1,t1\n 32c:\taddu\ta0,a0,t0\n 330:\tjal\t0 \n 334:\taddu\ta0,a0,v0\n 338:\tmove\ts2,v0\n 33c:\tlui\tv0,0x3\n 340:\tslt\tv0,v0,s2\n 344:\tbeqz\tv0,374 \n 348:\tnop\n 34c:\tlw\ta0,1076(s7)\n 350:\tlw\ta1,1084(s7)\n 354:\tlw\ta2,1076(s6)\n 358:\tjal\t0 \n 35c:\tlw\ta3,1084(s6)\n 360:\tmove\ta0,s6\n 364:\tsll\tv0,v0,0x10\n 368:\tsra\ta1,v0,0x10\n 36c:\tjal\t0 \n 370:\tmove\ta2,s2\n 374:\tlw\tt0,44(sp)\n 378:\tlb\tv0,2996(s7)\n 37c:\taddiu\ts8,s8,1\n 380:\taddiu\tt0,t0,12\n 384:\tslt\tv0,s8,v0\n 388:\tbnez\tv0,78 \n 38c:\tsw\tt0,44(sp)\n 390:\tlw\tra,92(sp)\n 394:\tlw\ts8,88(sp)\n 398:\tlw\ts7,84(sp)\n 39c:\tlw\ts6,80(sp)\n 3a0:\tlw\ts5,76(sp)\n 3a4:\tlw\ts4,72(sp)\n 3a8:\tlw\ts3,68(sp)\n 3ac:\tlw\ts2,64(sp)\n 3b0:\tlw\ts1,60(sp)\n 3b4:\tlw\ts0,56(sp)\n 3b8:\tjr\tra\n 3bc:\taddiu\tsp,sp,96\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-84d07a69b637e7e0/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 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\t000003c0 func_8005AE8C_5BA8C\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 isqrt64\n00000000 *UND*\t00000000 func_80058B30_59730\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 func_80058950_59550\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 getCurrentAllocation\n00000084 R_MIPS_26 memcpy\n00000198 R_MIPS_26 isqrt64\n00000204 R_MIPS_26 func_80058B30_59730\n0000020c R_MIPS_26 .text\n00000240 R_MIPS_26 __divdi3\n0000026c R_MIPS_26 __divdi3\n0000029c R_MIPS_26 __divdi3\n00000330 R_MIPS_26 isqrt64\n00000358 R_MIPS_26 func_8006D21C_6DE1C\n0000036c R_MIPS_26 func_80058950_59550\n\n\nContents of section .text:\n 0000 27bdffa0 afb60050 0080b021 afbf005c '......P...!...\\\n 0010 afbe0058 afb70054 afb5004c afb40048 ...X...T...L...H\n 0020 afb30044 afb20040 afb1003c 0c000000 ...D...@...<....\n 0030 afb00038 8c440010 92c30bb8 908217a0 ...8.D..........\n 0040 106200d3 24970be8 8ec20b88 30420010 .b..$.......0B..\n 0050 144000cf 00000000 8c821770 30420010 .@.........p0B..\n 0060 144000cb 00000000 8082179c 184000c8 .@...........@..\n 0070 0000f021 afb7002c 8fa8002c 27a40010 ...!...,...,'...\n 0080 2406000c 0c000000 25050ae4 8fa40010 $.......%.......\n 0090 8ee20434 8fa50014 00822021 afa40010 ...4...... !....\n 00a0 8ee20438 8fa60018 00a22821 afa50014 ...8......(!....\n 00b0 8ee2043c 00c23021 afa60018 8ec20434 ...<..0!.......4\n 00c0 8ec30ad4 00431021 00822023 afa40010 .....C.!.. #....\n 00d0 8ec20438 8ec30ad8 00431021 00a23823 ...8.....C.!..8#\n 00e0 afa70014 8ec2043c 8ec30adc 00431021 .......<.....C.!\n 00f0 00c23023 001e1080 00571021 afa60018 ..0#.....W.!....\n 0100 8c430b2c 8ec20ae0 0062a821 00151823 .C.,.....b.!...#\n 0110 0064102a 10400097 0095102a 10400095 .d.*.@.....*.@..\n 0120 0067102a 10400093 00f5102a 10400091 .g.*.@.....*.@..\n 0130 0066102a 1040008f 00d5102a 1040008d .f.*.@.....*.@..\n 0140 00840018 00002010 00002812 00000000 ...... ...(.....\n 0150 00000000 00e70018 00004010 00004812 ..........@...H.\n 0160 00000000 00000000 00c60018 afa80030 ...............0\n 0170 afa90034 00a92821 00a9302b 00882021 ...4..(!..0+.. !\n 0180 00862021 00001010 00001812 00a32821 .. !..........(!\n 0190 00a3302b 00822021 0c000000 00862021 ..0+.. !...... !\n 01a0 00409021 0255102a 10400072 24020001 .@.!.U.*.@.r$...\n 01b0 92e30bd9 1462000a 24020003 8ee20b84 .....b..$.......\n 01c0 3c080004 00481024 10400004 27c2fffc <....H.$.@..'...\n 01d0 2c420002 1440000b 00000000 24020003 ,B...@......$...\n 01e0 1462000c 3c090004 8ee20b84 00491024 .b..<........I.$\n 01f0 10400008 27c2ffff 2c420002 10400005 .@..'...,B...@..\n 0200 00000000 0c000000 02c02021 080000dd .......... !....\n 0210 00000000 52400001 24120001 8fb40010 ....R@..$.......\n 0220 02950018 02408821 001287c3 8fb30014 .....@.!........\n 0230 00002010 00002812 02003021 00000000 .. ...(...0!....\n 0240 0c000000 02203821 00000000 02750018 ..... 8!.....u..\n 0250 02003021 02203821 8fb20018 00002010 ..0!. 8!...... .\n 0260 00002812 00000000 00000000 0c000000 ..(.............\n 0270 0074a023 00000000 02550018 02003021 .t.#.....U....0!\n 0280 02203821 00739823 afb40010 00002010 . 8!.s.#...... .\n 0290 00002812 00000000 00000000 0c000000 ..(.............\n 02a0 afb30014 00729023 afb20018 8ec20434 .....r.#.......4\n 02b0 00541023 aec20434 8ec20438 8fa30014 .T.#...4...8....\n 02c0 00431023 aec20438 8ec2043c 8fa30018 .C.#...8...<....\n 02d0 00431023 aec2043c 92e20bd9 2fc30001 .C.#...<..../...\n 02e0 38420002 2c420001 00431024 10400021 8B..,B...C.$.@.!\n 02f0 00000000 8fa20010 00420018 8fa20018 .........B......\n 0300 00002010 00002812 00000000 00000000 .. ...(.........\n 0310 00420018 00004010 00004812 afa80030 .B....@...H....0\n 0320 afa90034 00a92821 00a9102b 00882021 ...4..(!...+.. !\n 0330 0c000000 00822021 00409021 3c020003 ...... !.@.!<...\n 0340 0052102a 1040000b 00000000 8ee40434 .R.*.@.........4\n 0350 8ee5043c 8ec60434 0c000000 8ec7043c ...<...4.......<\n 0360 02c02021 00021400 00022c03 0c000000 .. !......,.....\n 0370 02403021 8fa8002c 82e20bb4 27de0001 .@0!...,....'...\n 0380 2508000c 03c2102a 1440ff3b afa8002c %......*.@.;...,\n 0390 8fbf005c 8fbe0058 8fb70054 8fb60050 ...\\...X...T...P\n 03a0 8fb5004c 8fb40048 8fb30044 8fb20040 ...L...H...D...@\n 03b0 8fb1003c 8fb00038 03e00008 27bd0060 ...<...8....'..`\nContents of section .reginfo:\n 0000 e0ff03fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005AE8C_5BA8C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005AE8C_5BA8C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_8005DF10_5EB10:gcc2.7.2kmc","sym":"func_8005DF10_5EB10","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["pointer","array","shift","call"],"loc":125,"refSource":"void func_8005DF10_5EB10(s16 arg0, s16 arg1, s16 arg2, s16 *arg3) {\n s32 spVars[3];\n s16 temp_s0;\n s16 temp_s1;\n s32 temp_a0;\n s32 temp_a1;\n s32 temp_a2;\n s32 temp_a3;\n s32 temp_s0_2;\n s32 temp_s1_2;\n s32 temp_s2;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_t0;\n s32 temp_t1;\n s32 temp_t2;\n s32 temp_v1;\n s32 temp_v1_2;\n s32 temp_v1_3;\n s32 var_a0;\n s32 var_v0;\n s32 var_v1;\n\n temp_s0 = arg1;\n temp_s1 = -arg0;\n temp_s5 = approximateSin(temp_s1);\n temp_s0 = -temp_s0;\n temp_s1_2 = approximateSin(temp_s0);\n temp_s0_2 = approximateCos(temp_s1);\n temp_s4 = approximateCos(temp_s0);\n temp_s2 = approximateSin(arg2);\n temp_a3 = approximateCos(arg2);\n var_v1 = temp_s5 * temp_s1_2;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_s5 * temp_s4;\n temp_a2 = var_v1 >> 0xD;\n spVars[0] = temp_a2;\n spVars[1] = temp_s0_2;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a2 * temp_s0_2;\n temp_a0 = var_v0 >> 0xD;\n spVars[2] = temp_a0;\n temp_a1 = 0x2000 - temp_a3;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_s0_2 * temp_a0;\n temp_t2 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a0 * temp_a2;\n temp_t0 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = (var_v1 >> 0xD) * temp_a1;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = temp_a2 * temp_a2;\n temp_t1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_a0 = temp_a2 * temp_s2;\n temp_a1 = var_v1 >> 0xD;\n if (var_a0 < 0) {\n var_a0 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1 = var_a0 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[0] = temp_a1 + (var_v0 >> 0xD);\n arg3[7] = (s16)(temp_t0 - temp_v1);\n arg3[5] = (s16)(temp_t0 + temp_v1);\n var_v0 = spVars[1] * spVars[1];\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = spVars[1] * temp_s2;\n temp_a1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1_2 = var_v1 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[4] = (s16)(temp_a1 + (var_v0 >> 0xD));\n arg3[6] = (s16)(temp_t1 + temp_v1_2);\n arg3[2] = (s16)(temp_t1 - temp_v1_2);\n var_v0 = spVars[2] * spVars[2];\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1 = spVars[2] * temp_s2;\n temp_a1 = var_v0 >> 0xD;\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_a3 * (0x2000 - temp_a1);\n temp_v1_3 = var_v1 >> 0xD;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n arg3[8] = (s16)(temp_a1 + (var_v0 >> 0xD));\n arg3[3] = (s16)(temp_t2 - temp_v1_3);\n arg3[1] = (s16)(temp_t2 + temp_v1_3);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/5EA60.c#L33-L157","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts0,32(sp)\n 8:\tmove\ts0,a1\n c:\tsw\ts2,40(sp)\n 10:\tmove\ts2,a2\n 14:\tsw\ts3,44(sp)\n 18:\tmove\ts3,a3\n 1c:\tsw\ts1,36(sp)\n 20:\tnegu\ts1,a0\n 24:\tsll\ts1,s1,0x10\n 28:\tsra\ts1,s1,0x10\n 2c:\tmove\ta0,s1\n 30:\tsw\tra,56(sp)\n 34:\tsw\ts5,52(sp)\n 38:\tjal\t0 \n 3c:\tsw\ts4,48(sp)\n 40:\tnegu\ts0,s0\n 44:\tsll\ts0,s0,0x10\n 48:\tsra\ts0,s0,0x10\n 4c:\tmove\ta0,s0\n 50:\tjal\t0 \n 54:\tmove\ts5,v0\n 58:\tmove\ta0,s1\n 5c:\tjal\t0 \n 60:\tmove\ts1,v0\n 64:\tmove\ta0,s0\n 68:\tjal\t0 \n 6c:\tmove\ts0,v0\n 70:\tsll\ts2,s2,0x10\n 74:\tsra\ts2,s2,0x10\n 78:\tmove\ta0,s2\n 7c:\tjal\t0 \n 80:\tmove\ts4,v0\n 84:\tmove\ta0,s2\n 88:\tjal\t0 \n 8c:\tmove\ts2,v0\n 90:\tnop\n 94:\tmult\ts5,s1\n 98:\tmflo\tv1\n\t...\n a4:\tbgez\tv1,b0 \n a8:\tmove\ta3,v0\n ac:\taddiu\tv1,v1,8191\n b0:\tnop\n b4:\tmult\ts5,s4\n b8:\tmflo\tv0\n bc:\tsra\ta2,v1,0xd\n c0:\tsw\ta2,16(sp)\n c4:\tbgez\tv0,d0 \n c8:\tsw\ts0,20(sp)\n cc:\taddiu\tv0,v0,8191\n d0:\tnop\n d4:\tmult\ta2,s0\n d8:\tmflo\tv1\n dc:\tsra\ta0,v0,0xd\n e0:\tsw\ta0,24(sp)\n e4:\tli\tv0,8192\n e8:\tbgez\tv1,f4 \n ec:\tsubu\ta1,v0,a3\n f0:\taddiu\tv1,v1,8191\n f4:\tsra\tv0,v1,0xd\n f8:\tmult\tv0,a1\n fc:\tmflo\tv0\n\t...\n 108:\tbltzl\tv0,110 \n 10c:\taddiu\tv0,v0,8191\n 110:\tnop\n 114:\tmult\ts0,a0\n 118:\tmflo\tv1\n\t...\n 124:\tbgez\tv1,130 \n 128:\tsra\tt2,v0,0xd\n 12c:\taddiu\tv1,v1,8191\n 130:\tsra\tv0,v1,0xd\n 134:\tmult\tv0,a1\n 138:\tmflo\tv0\n\t...\n 144:\tbltzl\tv0,14c \n 148:\taddiu\tv0,v0,8191\n 14c:\tnop\n 150:\tmult\ta0,a2\n 154:\tmflo\tv1\n\t...\n 160:\tbgez\tv1,16c \n 164:\tsra\tt0,v0,0xd\n 168:\taddiu\tv1,v1,8191\n 16c:\tsra\tv0,v1,0xd\n 170:\tmult\tv0,a1\n 174:\tmflo\tv0\n\t...\n 180:\tbltzl\tv0,188 \n 184:\taddiu\tv0,v0,8191\n 188:\tnop\n 18c:\tmult\ta2,a2\n 190:\tmflo\tv1\n\t...\n 19c:\tbgez\tv1,1a8 \n 1a0:\tsra\tt1,v0,0xd\n 1a4:\taddiu\tv1,v1,8191\n 1a8:\tnop\n 1ac:\tmult\ta2,s2\n 1b0:\tmflo\ta0\n\t...\n 1bc:\tbgez\ta0,1c8 \n 1c0:\tsra\ta1,v1,0xd\n 1c4:\taddiu\ta0,a0,8191\n 1c8:\tli\ta2,8192\n 1cc:\tsubu\tv0,a2,a1\n 1d0:\tmult\ta3,v0\n 1d4:\tmflo\tv0\n\t...\n 1e0:\tbgez\tv0,1ec \n 1e4:\tsra\tv1,a0,0xd\n 1e8:\taddiu\tv0,v0,8191\n 1ec:\tsra\tv0,v0,0xd\n 1f0:\taddu\tv0,a1,v0\n 1f4:\tsh\tv0,0(s3)\n 1f8:\tsubu\tv0,t0,v1\n 1fc:\tsh\tv0,14(s3)\n 200:\taddu\tv0,t0,v1\n 204:\tsh\tv0,10(s3)\n 208:\tlw\tv1,20(sp)\n 20c:\tmult\tv1,v1\n 210:\tmflo\tv0\n\t...\n 21c:\tbltzl\tv0,224 \n 220:\taddiu\tv0,v0,8191\n 224:\tnop\n 228:\tmult\tv1,s2\n 22c:\tmflo\tv1\n\t...\n 238:\tbgez\tv1,244 \n 23c:\tsra\ta1,v0,0xd\n 240:\taddiu\tv1,v1,8191\n 244:\tsubu\tv0,a2,a1\n 248:\tmult\ta3,v0\n 24c:\tmflo\tv0\n\t...\n 258:\tbgez\tv0,264 \n 25c:\tsra\tv1,v1,0xd\n 260:\taddiu\tv0,v0,8191\n 264:\tsra\tv0,v0,0xd\n 268:\taddu\tv0,a1,v0\n 26c:\tsh\tv0,8(s3)\n 270:\taddu\tv0,t1,v1\n 274:\tsh\tv0,12(s3)\n 278:\tsubu\tv0,t1,v1\n 27c:\tsh\tv0,4(s3)\n 280:\tlw\tv1,24(sp)\n 284:\tmult\tv1,v1\n 288:\tmflo\tv0\n\t...\n 294:\tbltzl\tv0,29c \n 298:\taddiu\tv0,v0,8191\n 29c:\tnop\n 2a0:\tmult\tv1,s2\n 2a4:\tmflo\tv1\n\t...\n 2b0:\tbgez\tv1,2bc \n 2b4:\tsra\ta1,v0,0xd\n 2b8:\taddiu\tv1,v1,8191\n 2bc:\tsubu\tv0,a2,a1\n 2c0:\tmult\ta3,v0\n 2c4:\tmflo\tv0\n\t...\n 2d0:\tbgez\tv0,2dc \n 2d4:\tsra\tv1,v1,0xd\n 2d8:\taddiu\tv0,v0,8191\n 2dc:\tsra\tv0,v0,0xd\n 2e0:\taddu\tv0,a1,v0\n 2e4:\tsh\tv0,16(s3)\n 2e8:\tsubu\tv0,t2,v1\n 2ec:\tsh\tv0,6(s3)\n 2f0:\taddu\tv0,t2,v1\n 2f4:\tsh\tv0,2(s3)\n 2f8:\tlw\tra,56(sp)\n 2fc:\tlw\ts5,52(sp)\n 300:\tlw\ts4,48(sp)\n 304:\tlw\ts3,44(sp)\n 308:\tlw\ts2,40(sp)\n 30c:\tlw\ts1,36(sp)\n 310:\tlw\ts0,32(sp)\n 314:\tjr\tra\n 318:\taddiu\tsp,sp,64\n 31c:\tnop\n","proto":{"func_8005DF10_5EB10":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-16844b3ba3fca8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000031c func_8005DF10_5EB10\n00000000 *UND*\t00000000 approximateSin\n00000000 *UND*\t00000000 approximateCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000038 R_MIPS_26 approximateSin\n00000050 R_MIPS_26 approximateSin\n0000005c R_MIPS_26 approximateCos\n00000068 R_MIPS_26 approximateCos\n0000007c R_MIPS_26 approximateSin\n00000088 R_MIPS_26 approximateCos\n\n\nContents of section .text:\n 0000 27bdffc0 afb00020 00a08021 afb20028 '...... ...!...(\n 0010 00c09021 afb3002c 00e09821 afb10024 ...!...,...!...$\n 0020 00048823 00118c00 00118c03 02202021 ...#......... !\n 0030 afbf0038 afb50034 0c000000 afb40030 ...8...4.......0\n 0040 00108023 00108400 00108403 02002021 ...#.......... !\n 0050 0c000000 0040a821 02202021 0c000000 .....@.!. !....\n 0060 00408821 02002021 0c000000 00408021 .@.!.. !.....@.!\n 0070 00129400 00129403 02402021 0c000000 .........@ !....\n 0080 0040a021 02402021 0c000000 00409021 .@.!.@ !.....@.!\n 0090 00000000 02b10018 00001812 00000000 ................\n 00a0 00000000 04610002 00403821 24631fff .....a...@8!$c..\n 00b0 00000000 02b40018 00001012 00033343 ..............3C\n 00c0 afa60010 04410002 afb00014 24421fff .....A......$B..\n 00d0 00000000 00d00018 00001812 00022343 ..............#C\n 00e0 afa40018 24022000 04610002 00472823 ....$. ..a...G(#\n 00f0 24631fff 00031343 00450018 00001012 $c.....C.E......\n 0100 00000000 00000000 04420001 24421fff .........B..$B..\n 0110 00000000 02040018 00001812 00000000 ................\n 0120 00000000 04610002 00025343 24631fff .....a....SC$c..\n 0130 00031343 00450018 00001012 00000000 ...C.E..........\n 0140 00000000 04420001 24421fff 00000000 .....B..$B......\n 0150 00860018 00001812 00000000 00000000 ................\n 0160 04610002 00024343 24631fff 00031343 .a....CC$c.....C\n 0170 00450018 00001012 00000000 00000000 .E..............\n 0180 04420001 24421fff 00000000 00c60018 .B..$B..........\n 0190 00001812 00000000 00000000 04610002 .............a..\n 01a0 00024b43 24631fff 00000000 00d20018 ..KC$c..........\n 01b0 00002012 00000000 00000000 04810002 .. .............\n 01c0 00032b43 24841fff 24062000 00c51023 ..+C$...$. ....#\n 01d0 00e20018 00001012 00000000 00000000 ................\n 01e0 04410002 00041b43 24421fff 00021343 .A.....C$B.....C\n 01f0 00a21021 a6620000 01031023 a662000e ...!.b.....#.b..\n 0200 01031021 a662000a 8fa30014 00630018 ...!.b.......c..\n 0210 00001012 00000000 00000000 04420001 .............B..\n 0220 24421fff 00000000 00720018 00001812 $B.......r......\n 0230 00000000 00000000 04610002 00022b43 .........a....+C\n 0240 24631fff 00c51023 00e20018 00001012 $c.....#........\n 0250 00000000 00000000 04410002 00031b43 .........A.....C\n 0260 24421fff 00021343 00a21021 a6620008 $B.....C...!.b..\n 0270 01231021 a662000c 01231023 a6620004 .#.!.b...#.#.b..\n 0280 8fa30018 00630018 00001012 00000000 .....c..........\n 0290 00000000 04420001 24421fff 00000000 .....B..$B......\n 02a0 00720018 00001812 00000000 00000000 .r..............\n 02b0 04610002 00022b43 24631fff 00c51023 .a....+C$c.....#\n 02c0 00e20018 00001012 00000000 00000000 ................\n 02d0 04410002 00031b43 24421fff 00021343 .A.....C$B.....C\n 02e0 00a21021 a6620010 01431023 a6620006 ...!.b...C.#.b..\n 02f0 01431021 a6620002 8fbf0038 8fb50034 .C.!.b.....8...4\n 0300 8fb40030 8fb3002c 8fb20028 8fb10024 ...0...,...(...$\n 0310 8fb00020 03e00008 27bd0040 00000000 ... ....'..@....\nContents of section .reginfo:\n 0000 a03f07fc 00000000 00000000 00000000 .?..............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 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_8005DF10_5EB10' — lift: cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — 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\ts0,32(sp) */\n/* 8:\tmove\ts0,a1 */\n/* c:\tsw\ts2,40(sp) */\n/* 10:\tmove\ts2,a2 */\n/* 14:\tsw\ts3,44(sp) */\n/* 18:\tmove\ts3,a3 */\n/* 1c:\tsw\ts1,36(sp) */\n/* 20:\tnegu\ts1,a0 */\n/* 24:\tsll\ts1,s1,0x10 */\n/* 28:\tsra\ts1,s1,0x10 */\n/* 2c:\tmove\ta0,s1 */\n/* 30:\tsw\tra,56(sp) */\n/* 34:\tsw\ts5,52(sp) */\n/* 38:\tjal\t0 */\n/* 3c:\tsw\ts4,48(sp) */\n/* 40:\tnegu\ts0,s0 */\n/* 44:\tsll\ts0,s0,0x10 */\n/* 48:\tsra\ts0,s0,0x10 */\n/* 4c:\tmove\ta0,s0 */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ts5,v0 */\n/* 58:\tmove\ta0,s1 */\n/* 5c:\tjal\t0 */\n/* 60:\tmove\ts1,v0 */\n/* 64:\tmove\ta0,s0 */\n/* 68:\tjal\t0 */\n/* 6c:\tmove\ts0,v0 */\n/* 70:\tsll\ts2,s2,0x10 */\n/* 74:\tsra\ts2,s2,0x10 */\n/* 78:\tmove\ta0,s2 */\n/* 7c:\tjal\t0 */\n/* 80:\tmove\ts4,v0 */\n/* 84:\tmove\ta0,s2 */\n/* 88:\tjal\t0 */\n/* 8c:\tmove\ts2,v0 */\n/* 90:\tnop */\n/* 94:\tmult\ts5,s1 */\n/* 98:\tmflo\tv1 */\n/* \t... */\n/* a4:\tbgez\tv1,b0 */\n/* a8:\tmove\ta3,v0 */\n/* ac:\taddiu\tv1,v1,8191 */\n/* b0:\tnop */\n/* b4:\tmult\ts5,s4 */\n/* b8:\tmflo\tv0 */\n/* bc:\tsra\ta2,v1,0xd */\n/* c0:\tsw\ta2,16(sp) */\n/* c4:\tbgez\tv0,d0 */\n/* c8:\tsw\ts0,20(sp) */\n/* cc:\taddiu\tv0,v0,8191 */\n/* d0:\tnop */\n/* d4:\tmult\ta2,s0 */\n/* d8:\tmflo\tv1 */\n/* dc:\tsra\ta0,v0,0xd */\n/* e0:\tsw\ta0,24(sp) */\n/* e4:\tli\tv0,8192 */\n/* e8:\tbgez\tv1,f4 */\n/* ec:\tsubu\ta1,v0,a3 */\n/* f0:\taddiu\tv1,v1,8191 */\n/* f4:\tsra\tv0,v1,0xd */\n/* f8:\tmult\tv0,a1 */\n/* fc:\tmflo\tv0 */\n/* \t... */\n/* 108:\tbltzl\tv0,110 */\n/* 10c:\taddiu\tv0,v0,8191 */\n/* 110:\tnop */\n/* 114:\tmult\ts0,a0 */\n/* 118:\tmflo\tv1 */\n/* \t... */\n/* 124:\tbgez\tv1,130 */\n/* 128:\tsra\tt2,v0,0xd */\n/* 12c:\taddiu\tv1,v1,8191 */\n/* 130:\tsra\tv0,v1,0xd */\n/* 134:\tmult\tv0,a1 */\n/* 138:\tmflo\tv0 */\n/* \t... */\n/* 144:\tbltzl\tv0,14c */\n/* 148:\taddiu\tv0,v0,8191 */\n/* 14c:\tnop */\n/* 150:\tmult\ta0,a2 */\n/* 154:\tmflo\tv1 */\n/* \t... */\n/* 160:\tbgez\tv1,16c */\n/* 164:\tsra\tt0,v0,0xd */\n/* 168:\taddiu\tv1,v1,8191 */\n/* 16c:\tsra\tv0,v1,0xd */\n/* 170:\tmult\tv0,a1 */\n/* 174:\tmflo\tv0 */\n/* \t... */\n/* 180:\tbltzl\tv0,188 */\n/* 184:\taddiu\tv0,v0,8191 */\n/* 188:\tnop */\n/* 18c:\tmult\ta2,a2 */\n/* 190:\tmflo\tv1 */\n/* \t... */\n/* 19c:\tbgez\tv1,1a8 */\n/* 1a0:\tsra\tt1,v0,0xd */\n/* 1a4:\taddiu\tv1,v1,8191 */\n/* 1a8:\tnop */\n/* 1ac:\tmult\ta2,s2 */\n/* 1b0:\tmflo\ta0 */\n/* \t... */\n/* 1bc:\tbgez\ta0,1c8 */\n/* 1c0:\tsra\ta1,v1,0xd */\n/* 1c4:\taddiu\ta0,a0,8191 */\n/* 1c8:\tli\ta2,8192 */\n/* 1cc:\tsubu\tv0,a2,a1 */\n/* 1d0:\tmult\ta3,v0 */\n/* 1d4:\tmflo\tv0 */\n/* \t... */\n/* 1e0:\tbgez\tv0,1ec */\n/* 1e4:\tsra\tv1,a0,0xd */\n/* 1e8:\taddiu\tv0,v0,8191 */\n/* 1ec:\tsra\tv0,v0,0xd */\n/* 1f0:\taddu\tv0,a1,v0 */\n/* 1f4:\tsh\tv0,0(s3) */\n/* 1f8:\tsubu\tv0,t0,v1 */\n/* 1fc:\tsh\tv0,14(s3) */\n/* 200:\taddu\tv0,t0,v1 */\n/* 204:\tsh\tv0,10(s3) */\n/* 208:\tlw\tv1,20(sp) */\n/* 20c:\tmult\tv1,v1 */\n/* 210:\tmflo\tv0 */\n/* \t... */\n/* 21c:\tbltzl\tv0,224 */\n/* 220:\taddiu\tv0,v0,8191 */\n/* 224:\tnop */\n/* 228:\tmult\tv1,s2 */\n/* 22c:\tmflo\tv1 */\n/* \t... */\n/* 238:\tbgez\tv1,244 */\n/* 23c:\tsra\ta1,v0,0xd */\n/* 240:\taddiu\tv1,v1,8191 */\n/* 244:\tsubu\tv0,a2,a1 */\n/* 248:\tmult\ta3,v0 */\n/* 24c:\tmflo\tv0 */\n/* \t... */\n/* 258:\tbgez\tv0,264 */\n/* 25c:\tsra\tv1,v1,0xd */\n/* 260:\taddiu\tv0,v0,8191 */\n/* 264:\tsra\tv0,v0,0xd */\n/* 268:\taddu\tv0,a1,v0 */\n/* 26c:\tsh\tv0,8(s3) */\n/* 270:\taddu\tv0,t1,v1 */\n/* 274:\tsh\tv0,12(s3) */\n/* 278:\tsubu\tv0,t1,v1 */\n/* 27c:\tsh\tv0,4(s3) */\n/* 280:\tlw\tv1,24(sp) */\n/* 284:\tmult\tv1,v1 */\n/* 288:\tmflo\tv0 */\n/* \t... */\n/* 294:\tbltzl\tv0,29c */\n/* 298:\taddiu\tv0,v0,8191 */\n/* 29c:\tnop */\n/* 2a0:\tmult\tv1,s2 */\n/* 2a4:\tmflo\tv1 */\n/* \t... */\n/* 2b0:\tbgez\tv1,2bc */\n/* 2b4:\tsra\ta1,v0,0xd */\n/* 2b8:\taddiu\tv1,v1,8191 */\n/* 2bc:\tsubu\tv0,a2,a1 */\n/* 2c0:\tmult\ta3,v0 */\n/* 2c4:\tmflo\tv0 */\n/* \t... */\n/* 2d0:\tbgez\tv0,2dc */\n/* 2d4:\tsra\tv1,v1,0xd */\n/* 2d8:\taddiu\tv0,v0,8191 */\n/* 2dc:\tsra\tv0,v0,0xd */\n/* 2e0:\taddu\tv0,a1,v0 */\n/* 2e4:\tsh\tv0,16(s3) */\n/* 2e8:\tsubu\tv0,t2,v1 */\n/* 2ec:\tsh\tv0,6(s3) */\n/* 2f0:\taddu\tv0,t2,v1 */\n/* 2f4:\tsh\tv0,2(s3) */\n/* 2f8:\tlw\tra,56(sp) */\n/* 2fc:\tlw\ts5,52(sp) */\n/* 300:\tlw\ts4,48(sp) */\n/* 304:\tlw\ts3,44(sp) */\n/* 308:\tlw\ts2,40(sp) */\n/* 30c:\tlw\ts1,36(sp) */\n/* 310:\tlw\ts0,32(sp) */\n/* 314:\tjr\tra */\n/* 318:\taddiu\tsp,sp,64 */\n/* 31c:\tnop */\nvoid func_8005DF10_5EB10(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":193,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005DF10_5EB10': function call 'jal' at 0x38 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 approximateCos(s16); /* extern */\ns32 approximateSin(s16); /* extern */\n\nvoid func_8005DF10_5EB10(s32 arg0, s32 arg1, s16 arg2, void *arg3) {\n s32 sp14;\n s32 sp18;\n s16 temp_s0;\n s16 temp_s1;\n s32 temp_a0;\n s32 temp_a1;\n s32 temp_a1_2;\n s32 temp_a1_3;\n s32 temp_a1_4;\n s32 temp_a2;\n s32 temp_a3;\n s32 temp_s0_2;\n s32 temp_s1_2;\n s32 temp_s2;\n s32 temp_s4;\n s32 temp_s5;\n s32 temp_t0;\n s32 temp_t1;\n s32 temp_t2;\n s32 temp_v1;\n s32 temp_v1_2;\n s32 temp_v1_3;\n s32 var_a0;\n s32 var_v0;\n s32 var_v0_2;\n s32 var_v0_3;\n s32 var_v0_4;\n s32 var_v0_5;\n s32 var_v0_6;\n s32 var_v0_7;\n s32 var_v0_8;\n s32 var_v0_9;\n s32 var_v1;\n s32 var_v1_2;\n s32 var_v1_3;\n s32 var_v1_4;\n s32 var_v1_5;\n s32 var_v1_6;\n s32 var_v1_7;\n\n temp_s1 = arg0 * -1;\n temp_s0 = arg1 * -1;\n temp_s5 = approximateSin(temp_s1);\n temp_s1_2 = approximateSin(temp_s0);\n temp_s0_2 = approximateCos(temp_s1);\n temp_s4 = approximateCos(temp_s0);\n temp_s2 = approximateSin(arg2);\n var_v1 = temp_s5 * temp_s1_2;\n temp_a3 = approximateCos(arg2);\n if (var_v1 < 0) {\n var_v1 += 0x1FFF;\n }\n var_v0 = temp_s5 * temp_s4;\n temp_a2 = var_v1 >> 0xD;\n sp14 = temp_s0_2;\n if (var_v0 < 0) {\n var_v0 += 0x1FFF;\n }\n var_v1_2 = temp_a2 * temp_s0_2;\n temp_a0 = var_v0 >> 0xD;\n sp18 = temp_a0;\n temp_a1 = 0x2000 - temp_a3;\n if (var_v1_2 < 0) {\n var_v1_2 += 0x1FFF;\n }\n var_v0_2 = (var_v1_2 >> 0xD) * temp_a1;\n if (var_v0_2 < 0) {\n var_v0_2 += 0x1FFF;\n }\n var_v1_3 = temp_s0_2 * temp_a0;\n temp_t2 = var_v0_2 >> 0xD;\n if (var_v1_3 < 0) {\n var_v1_3 += 0x1FFF;\n }\n var_v0_3 = (var_v1_3 >> 0xD) * temp_a1;\n if (var_v0_3 < 0) {\n var_v0_3 += 0x1FFF;\n }\n var_v1_4 = temp_a0 * temp_a2;\n temp_t0 = var_v0_3 >> 0xD;\n if (var_v1_4 < 0) {\n var_v1_4 += 0x1FFF;\n }\n var_v0_4 = (var_v1_4 >> 0xD) * temp_a1;\n if (var_v0_4 < 0) {\n var_v0_4 += 0x1FFF;\n }\n var_v1_5 = temp_a2 * temp_a2;\n temp_t1 = var_v0_4 >> 0xD;\n if (var_v1_5 < 0) {\n var_v1_5 += 0x1FFF;\n }\n var_a0 = temp_a2 * temp_s2;\n temp_a1_2 = var_v1_5 >> 0xD;\n if (var_a0 < 0) {\n var_a0 += 0x1FFF;\n }\n var_v0_5 = temp_a3 * (0x2000 - temp_a1_2);\n temp_v1 = var_a0 >> 0xD;\n if (var_v0_5 < 0) {\n var_v0_5 += 0x1FFF;\n }\n arg3->unk0 = (s16) (temp_a1_2 + (var_v0_5 >> 0xD));\n arg3->unkE = (s16) (temp_t0 - temp_v1);\n arg3->unkA = (s16) (temp_t0 + temp_v1);\n var_v0_6 = sp14 * sp14;\n if (var_v0_6 < 0) {\n var_v0_6 += 0x1FFF;\n }\n var_v1_6 = sp14 * temp_s2;\n temp_a1_3 = var_v0_6 >> 0xD;\n if (var_v1_6 < 0) {\n var_v1_6 += 0x1FFF;\n }\n var_v0_7 = temp_a3 * (0x2000 - temp_a1_3);\n temp_v1_2 = var_v1_6 >> 0xD;\n if (var_v0_7 < 0) {\n var_v0_7 += 0x1FFF;\n }\n arg3->unk8 = (s16) (temp_a1_3 + (var_v0_7 >> 0xD));\n arg3->unkC = (s16) (temp_t1 + temp_v1_2);\n arg3->unk4 = (s16) (temp_t1 - temp_v1_2);\n var_v0_8 = sp18 * sp18;\n if (var_v0_8 < 0) {\n var_v0_8 += 0x1FFF;\n }\n var_v1_7 = sp18 * temp_s2;\n temp_a1_4 = var_v0_8 >> 0xD;\n if (var_v1_7 < 0) {\n var_v1_7 += 0x1FFF;\n }\n var_v0_9 = temp_a3 * (0x2000 - temp_a1_4);\n temp_v1_3 = var_v1_7 >> 0xD;\n if (var_v0_9 < 0) {\n var_v0_9 += 0x1FFF;\n }\n arg3->unk10 = (s16) (temp_a1_4 + (var_v0_9 >> 0xD));\n arg3->unk6 = (s16) (temp_t2 - temp_v1_3);\n arg3->unk2 = (s16) (temp_t2 + temp_v1_3);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":142,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1993: request for member `unk0' in something not a structure or union","/c.i:1994: request for member `unkE' in something not a structure or union","/c.i:1995: request for member `unkA' in something not a structure or union","/c.i:2010: request for member `unk8' in something not a structure or union","/c.i:2011: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005DF10_5EB10` — benchmark function snowboardkids2:func_8005DF10_5EB10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005DF10_5EB10\n addiu\t$sp, $sp, -64\n sw\t$s0, 32($sp)\n move\t$s0, $a1\n sw\t$s2, 40($sp)\n move\t$s2, $a2\n sw\t$s3, 44($sp)\n move\t$s3, $a3\n sw\t$s1, 36($sp)\n negu\t$s1, $a0\n sll\t$s1, $s1, 0x10\n sra\t$s1, $s1, 0x10\n move\t$a0, $s1\n sw\t$ra, 56($sp)\n sw\t$s5, 52($sp)\n jal\tapproximateSin\n sw\t$s4, 48($sp)\n negu\t$s0, $s0\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n move\t$a0, $s0\n jal\tapproximateSin\n move\t$s5, $v0\n move\t$a0, $s1\n jal\tapproximateCos\n move\t$s1, $v0\n move\t$a0, $s0\n jal\tapproximateCos\n move\t$s0, $v0\n sll\t$s2, $s2, 0x10\n sra\t$s2, $s2, 0x10\n move\t$a0, $s2\n jal\tapproximateSin\n move\t$s4, $v0\n move\t$a0, $s2\n jal\tapproximateCos\n move\t$s2, $v0\n nop\n mult\t$s5, $s1\n mflo\t$v1\n bgez\t$v1, .Lb0\n move\t$a3, $v0\n addiu\t$v1, $v1, 8191\n.Lb0:\n nop\n mult\t$s5, $s4\n mflo\t$v0\n sra\t$a2, $v1, 0xd\n sw\t$a2, 16($sp)\n bgez\t$v0, .Ld0\n sw\t$s0, 20($sp)\n addiu\t$v0, $v0, 8191\n.Ld0:\n nop\n mult\t$a2, $s0\n mflo\t$v1\n sra\t$a0, $v0, 0xd\n sw\t$a0, 24($sp)\n li\t$v0, 8192\n bgez\t$v1, .Lf4\n subu\t$a1, $v0, $a3\n addiu\t$v1, $v1, 8191\n.Lf4:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L110\n addiu\t$v0, $v0, 8191\n.L110:\n nop\n mult\t$s0, $a0\n mflo\t$v1\n bgez\t$v1, .L130\n sra\t$t2, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L130:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L14c\n addiu\t$v0, $v0, 8191\n.L14c:\n nop\n mult\t$a0, $a2\n mflo\t$v1\n bgez\t$v1, .L16c\n sra\t$t0, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L16c:\n sra\t$v0, $v1, 0xd\n mult\t$v0, $a1\n mflo\t$v0\n bltzl\t$v0, .L188\n addiu\t$v0, $v0, 8191\n.L188:\n nop\n mult\t$a2, $a2\n mflo\t$v1\n bgez\t$v1, .L1a8\n sra\t$t1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L1a8:\n nop\n mult\t$a2, $s2\n mflo\t$a0\n bgez\t$a0, .L1c8\n sra\t$a1, $v1, 0xd\n addiu\t$a0, $a0, 8191\n.L1c8:\n li\t$a2, 8192\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L1ec\n sra\t$v1, $a0, 0xd\n addiu\t$v0, $v0, 8191\n.L1ec:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 0($s3)\n subu\t$v0, $t0, $v1\n sh\t$v0, 14($s3)\n addu\t$v0, $t0, $v1\n sh\t$v0, 10($s3)\n lw\t$v1, 20($sp)\n mult\t$v1, $v1\n mflo\t$v0\n bltzl\t$v0, .L224\n addiu\t$v0, $v0, 8191\n.L224:\n nop\n mult\t$v1, $s2\n mflo\t$v1\n bgez\t$v1, .L244\n sra\t$a1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L244:\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L264\n sra\t$v1, $v1, 0xd\n addiu\t$v0, $v0, 8191\n.L264:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 8($s3)\n addu\t$v0, $t1, $v1\n sh\t$v0, 12($s3)\n subu\t$v0, $t1, $v1\n sh\t$v0, 4($s3)\n lw\t$v1, 24($sp)\n mult\t$v1, $v1\n mflo\t$v0\n bltzl\t$v0, .L29c\n addiu\t$v0, $v0, 8191\n.L29c:\n nop\n mult\t$v1, $s2\n mflo\t$v1\n bgez\t$v1, .L2bc\n sra\t$a1, $v0, 0xd\n addiu\t$v1, $v1, 8191\n.L2bc:\n subu\t$v0, $a2, $a1\n mult\t$a3, $v0\n mflo\t$v0\n bgez\t$v0, .L2dc\n sra\t$v1, $v1, 0xd\n addiu\t$v0, $v0, 8191\n.L2dc:\n sra\t$v0, $v0, 0xd\n addu\t$v0, $a1, $v0\n sh\t$v0, 16($s3)\n subu\t$v0, $t2, $v1\n sh\t$v0, 6($s3)\n addu\t$v0, $t2, $v1\n sh\t$v0, 2($s3)\n lw\t$ra, 56($sp)\n lw\t$s5, 52($sp)\n lw\t$s4, 48($sp)\n lw\t$s3, 44($sp)\n lw\t$s2, 40($sp)\n lw\t$s1, 36($sp)\n lw\t$s0, 32($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_8005DF10_5EB10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005DF10_5EB10` — benchmark function snowboardkids2:func_8005DF10_5EB10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8005DF10_5EB10: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\ts0,32(sp)\n 8:\tmove\ts0,a1\n c:\tsw\ts2,40(sp)\n 10:\tmove\ts2,a2\n 14:\tsw\ts3,44(sp)\n 18:\tmove\ts3,a3\n 1c:\tsw\ts1,36(sp)\n 20:\tnegu\ts1,a0\n 24:\tsll\ts1,s1,0x10\n 28:\tsra\ts1,s1,0x10\n 2c:\tmove\ta0,s1\n 30:\tsw\tra,56(sp)\n 34:\tsw\ts5,52(sp)\n 38:\tjal\t0 \n 3c:\tsw\ts4,48(sp)\n 40:\tnegu\ts0,s0\n 44:\tsll\ts0,s0,0x10\n 48:\tsra\ts0,s0,0x10\n 4c:\tmove\ta0,s0\n 50:\tjal\t0 \n 54:\tmove\ts5,v0\n 58:\tmove\ta0,s1\n 5c:\tjal\t0 \n 60:\tmove\ts1,v0\n 64:\tmove\ta0,s0\n 68:\tjal\t0 \n 6c:\tmove\ts0,v0\n 70:\tsll\ts2,s2,0x10\n 74:\tsra\ts2,s2,0x10\n 78:\tmove\ta0,s2\n 7c:\tjal\t0 \n 80:\tmove\ts4,v0\n 84:\tmove\ta0,s2\n 88:\tjal\t0 \n 8c:\tmove\ts2,v0\n 90:\tnop\n 94:\tmult\ts5,s1\n 98:\tmflo\tv1\n\t...\n a4:\tbgez\tv1,b0 \n a8:\tmove\ta3,v0\n ac:\taddiu\tv1,v1,8191\n b0:\tnop\n b4:\tmult\ts5,s4\n b8:\tmflo\tv0\n bc:\tsra\ta2,v1,0xd\n c0:\tsw\ta2,16(sp)\n c4:\tbgez\tv0,d0 \n c8:\tsw\ts0,20(sp)\n cc:\taddiu\tv0,v0,8191\n d0:\tnop\n d4:\tmult\ta2,s0\n d8:\tmflo\tv1\n dc:\tsra\ta0,v0,0xd\n e0:\tsw\ta0,24(sp)\n e4:\tli\tv0,8192\n e8:\tbgez\tv1,f4 \n ec:\tsubu\ta1,v0,a3\n f0:\taddiu\tv1,v1,8191\n f4:\tsra\tv0,v1,0xd\n f8:\tmult\tv0,a1\n fc:\tmflo\tv0\n\t...\n 108:\tbltzl\tv0,110 \n 10c:\taddiu\tv0,v0,8191\n 110:\tnop\n 114:\tmult\ts0,a0\n 118:\tmflo\tv1\n\t...\n 124:\tbgez\tv1,130 \n 128:\tsra\tt2,v0,0xd\n 12c:\taddiu\tv1,v1,8191\n 130:\tsra\tv0,v1,0xd\n 134:\tmult\tv0,a1\n 138:\tmflo\tv0\n\t...\n 144:\tbltzl\tv0,14c \n 148:\taddiu\tv0,v0,8191\n 14c:\tnop\n 150:\tmult\ta0,a2\n 154:\tmflo\tv1\n\t...\n 160:\tbgez\tv1,16c \n 164:\tsra\tt0,v0,0xd\n 168:\taddiu\tv1,v1,8191\n 16c:\tsra\tv0,v1,0xd\n 170:\tmult\tv0,a1\n 174:\tmflo\tv0\n\t...\n 180:\tbltzl\tv0,188 \n 184:\taddiu\tv0,v0,8191\n 188:\tnop\n 18c:\tmult\ta2,a2\n 190:\tmflo\tv1\n\t...\n 19c:\tbgez\tv1,1a8 \n 1a0:\tsra\tt1,v0,0xd\n 1a4:\taddiu\tv1,v1,8191\n 1a8:\tnop\n 1ac:\tmult\ta2,s2\n 1b0:\tmflo\ta0\n\t...\n 1bc:\tbgez\ta0,1c8 \n 1c0:\tsra\ta1,v1,0xd\n 1c4:\taddiu\ta0,a0,8191\n 1c8:\tli\ta2,8192\n 1cc:\tsubu\tv0,a2,a1\n 1d0:\tmult\ta3,v0\n 1d4:\tmflo\tv0\n\t...\n 1e0:\tbgez\tv0,1ec \n 1e4:\tsra\tv1,a0,0xd\n 1e8:\taddiu\tv0,v0,8191\n 1ec:\tsra\tv0,v0,0xd\n 1f0:\taddu\tv0,a1,v0\n 1f4:\tsh\tv0,0(s3)\n 1f8:\tsubu\tv0,t0,v1\n 1fc:\tsh\tv0,14(s3)\n 200:\taddu\tv0,t0,v1\n 204:\tsh\tv0,10(s3)\n 208:\tlw\tv1,20(sp)\n 20c:\tmult\tv1,v1\n 210:\tmflo\tv0\n\t...\n 21c:\tbltzl\tv0,224 \n 220:\taddiu\tv0,v0,8191\n 224:\tnop\n 228:\tmult\tv1,s2\n 22c:\tmflo\tv1\n\t...\n 238:\tbgez\tv1,244 \n 23c:\tsra\ta1,v0,0xd\n 240:\taddiu\tv1,v1,8191\n 244:\tsubu\tv0,a2,a1\n 248:\tmult\ta3,v0\n 24c:\tmflo\tv0\n\t...\n 258:\tbgez\tv0,264 \n 25c:\tsra\tv1,v1,0xd\n 260:\taddiu\tv0,v0,8191\n 264:\tsra\tv0,v0,0xd\n 268:\taddu\tv0,a1,v0\n 26c:\tsh\tv0,8(s3)\n 270:\taddu\tv0,t1,v1\n 274:\tsh\tv0,12(s3)\n 278:\tsubu\tv0,t1,v1\n 27c:\tsh\tv0,4(s3)\n 280:\tlw\tv1,24(sp)\n 284:\tmult\tv1,v1\n 288:\tmflo\tv0\n\t...\n 294:\tbltzl\tv0,29c \n 298:\taddiu\tv0,v0,8191\n 29c:\tnop\n 2a0:\tmult\tv1,s2\n 2a4:\tmflo\tv1\n\t...\n 2b0:\tbgez\tv1,2bc \n 2b4:\tsra\ta1,v0,0xd\n 2b8:\taddiu\tv1,v1,8191\n 2bc:\tsubu\tv0,a2,a1\n 2c0:\tmult\ta3,v0\n 2c4:\tmflo\tv0\n\t...\n 2d0:\tbgez\tv0,2dc \n 2d4:\tsra\tv1,v1,0xd\n 2d8:\taddiu\tv0,v0,8191\n 2dc:\tsra\tv0,v0,0xd\n 2e0:\taddu\tv0,a1,v0\n 2e4:\tsh\tv0,16(s3)\n 2e8:\tsubu\tv0,t2,v1\n 2ec:\tsh\tv0,6(s3)\n 2f0:\taddu\tv0,t2,v1\n 2f4:\tsh\tv0,2(s3)\n 2f8:\tlw\tra,56(sp)\n 2fc:\tlw\ts5,52(sp)\n 300:\tlw\ts4,48(sp)\n 304:\tlw\ts3,44(sp)\n 308:\tlw\ts2,40(sp)\n 30c:\tlw\ts1,36(sp)\n 310:\tlw\ts0,32(sp)\n 314:\tjr\tra\n 318:\taddiu\tsp,sp,64\n 31c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-16844b3ba3fca8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000031c func_8005DF10_5EB10\n00000000 *UND*\t00000000 approximateSin\n00000000 *UND*\t00000000 approximateCos\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000038 R_MIPS_26 approximateSin\n00000050 R_MIPS_26 approximateSin\n0000005c R_MIPS_26 approximateCos\n00000068 R_MIPS_26 approximateCos\n0000007c R_MIPS_26 approximateSin\n00000088 R_MIPS_26 approximateCos\n\n\nContents of section .text:\n 0000 27bdffc0 afb00020 00a08021 afb20028 '...... ...!...(\n 0010 00c09021 afb3002c 00e09821 afb10024 ...!...,...!...$\n 0020 00048823 00118c00 00118c03 02202021 ...#......... !\n 0030 afbf0038 afb50034 0c000000 afb40030 ...8...4.......0\n 0040 00108023 00108400 00108403 02002021 ...#.......... !\n 0050 0c000000 0040a821 02202021 0c000000 .....@.!. !....\n 0060 00408821 02002021 0c000000 00408021 .@.!.. !.....@.!\n 0070 00129400 00129403 02402021 0c000000 .........@ !....\n 0080 0040a021 02402021 0c000000 00409021 .@.!.@ !.....@.!\n 0090 00000000 02b10018 00001812 00000000 ................\n 00a0 00000000 04610002 00403821 24631fff .....a...@8!$c..\n 00b0 00000000 02b40018 00001012 00033343 ..............3C\n 00c0 afa60010 04410002 afb00014 24421fff .....A......$B..\n 00d0 00000000 00d00018 00001812 00022343 ..............#C\n 00e0 afa40018 24022000 04610002 00472823 ....$. ..a...G(#\n 00f0 24631fff 00031343 00450018 00001012 $c.....C.E......\n 0100 00000000 00000000 04420001 24421fff .........B..$B..\n 0110 00000000 02040018 00001812 00000000 ................\n 0120 00000000 04610002 00025343 24631fff .....a....SC$c..\n 0130 00031343 00450018 00001012 00000000 ...C.E..........\n 0140 00000000 04420001 24421fff 00000000 .....B..$B......\n 0150 00860018 00001812 00000000 00000000 ................\n 0160 04610002 00024343 24631fff 00031343 .a....CC$c.....C\n 0170 00450018 00001012 00000000 00000000 .E..............\n 0180 04420001 24421fff 00000000 00c60018 .B..$B..........\n 0190 00001812 00000000 00000000 04610002 .............a..\n 01a0 00024b43 24631fff 00000000 00d20018 ..KC$c..........\n 01b0 00002012 00000000 00000000 04810002 .. .............\n 01c0 00032b43 24841fff 24062000 00c51023 ..+C$...$. ....#\n 01d0 00e20018 00001012 00000000 00000000 ................\n 01e0 04410002 00041b43 24421fff 00021343 .A.....C$B.....C\n 01f0 00a21021 a6620000 01031023 a662000e ...!.b.....#.b..\n 0200 01031021 a662000a 8fa30014 00630018 ...!.b.......c..\n 0210 00001012 00000000 00000000 04420001 .............B..\n 0220 24421fff 00000000 00720018 00001812 $B.......r......\n 0230 00000000 00000000 04610002 00022b43 .........a....+C\n 0240 24631fff 00c51023 00e20018 00001012 $c.....#........\n 0250 00000000 00000000 04410002 00031b43 .........A.....C\n 0260 24421fff 00021343 00a21021 a6620008 $B.....C...!.b..\n 0270 01231021 a662000c 01231023 a6620004 .#.!.b...#.#.b..\n 0280 8fa30018 00630018 00001012 00000000 .....c..........\n 0290 00000000 04420001 24421fff 00000000 .....B..$B......\n 02a0 00720018 00001812 00000000 00000000 .r..............\n 02b0 04610002 00022b43 24631fff 00c51023 .a....+C$c.....#\n 02c0 00e20018 00001012 00000000 00000000 ................\n 02d0 04410002 00031b43 24421fff 00021343 .A.....C$B.....C\n 02e0 00a21021 a6620010 01431023 a6620006 ...!.b...C.#.b..\n 02f0 01431021 a6620002 8fbf0038 8fb50034 .C.!.b.....8...4\n 0300 8fb40030 8fb3002c 8fb20028 8fb10024 ...0...,...(...$\n 0310 8fb00020 03e00008 27bd0040 00000000 ... ....'..@....\nContents of section .reginfo:\n 0000 a03f07fc 00000000 00000000 00000000 .?..............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 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_8005DF10_5EB10\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_8005DF10_5EB10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B0DC0_1DCF60\n lw\t$v0, 4($a0)\n addu\t$v0, $v0, $a0\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B0DC0_1DCF60 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc","sym":"func_800B2C18_A2AC8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","goto","bitwise","call"],"loc":98,"refSource":"s32 func_800B2C18_A2AC8(Player *arg0) {\n GameState *state;\n s32 flags;\n u8 stateUnk7A;\n s16 var_a0;\n s16 var_v1;\n s32 temp_v0;\n\n state = getCurrentAllocation();\n flags = arg0->unkB84;\n\n if (flags & 1) {\n return 0;\n }\n\n if (flags & 0x1000) {\n func_800B46BC_A456C(arg0);\n return 1;\n }\n\n if (flags & 0x80000) {\n goto skip_to_end;\n }\n\n stateUnk7A = state->unk7A;\n if (stateUnk7A != 0 && stateUnk7A != 8) {\n if (!(stateUnk7A == 9 || stateUnk7A == 10)) {\n arg0->unkBAC = 0;\n }\n }\n\n if (arg0->unkBAC != 0) {\n func_80059A48_5A648(arg0, arg0->unkBAC);\n if (arg0->unkBC7 == 0) {\n func_8004D890_4E490(arg0->unkBB8, arg0->unkBAC);\n\n var_v1 = arg0->unkBAC;\n if (var_v1 < 0x96) {\n var_a0 = 0x11C;\n } else {\n var_a0 = 0x11D;\n }\n\n if (var_v1 >= 0x12C) {\n var_a0 = 0x11E;\n }\n if (var_v1 >= 0x190) {\n var_a0 = 0x11F;\n }\n if (var_v1 >= 0x1F4) {\n var_a0 = 0x120;\n }\n if (var_v1 >= 0xBB8) {\n var_a0 = 0x121;\n }\n\n func_80058530_59130(var_a0, 6);\n }\n }\n\n if (state->unk7A == 6) {\n if (arg0->unkBAA != 0) {\n func_8004FCF0_508F0(arg0->unkBAA);\n func_80059A88_5A688(arg0, arg0->unkBAA);\n\n var_v1 = arg0->unkBAA;\n if (var_v1 < 0xF) {\n var_a0 = 0x11C;\n } else {\n var_a0 = 0x11D;\n }\n\n if (var_v1 >= 0x1E) {\n var_a0 = 0x11E;\n }\n if (var_v1 >= 0x37) {\n var_a0 = 0x11F;\n }\n if (var_v1 >= 0x5F) {\n var_a0 = 0x120;\n }\n if (var_v1 >= 0x3E7) {\n var_a0 = 0x121;\n }\n\n func_80058530_59130(var_a0, 6);\n }\n }\n\nskip_to_end:\n if (arg0->unkBAE != 0) {\n func_80059BD4_5A7D4(arg0);\n func_8005D804_5E404(arg0, 1, 0xF);\n }\n\n func_800B00D4_9FF84(arg0, 3);\n return 1;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L799-L896","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:\tlw\tv1,2948(s0)\n 1c:\tmove\ts1,v0\n 20:\tandi\tv0,v1,0x1\n 24:\tbnez\tv0,1b0 \n 28:\tmove\tv0,zero\n 2c:\tandi\tv0,v1,0x1000\n 30:\tbeqz\tv0,48 \n 34:\tlui\tv0,0x8\n 38:\tjal\t0 \n 3c:\tmove\ta0,s0\n 40:\tj\t1b0 \n 44:\tli\tv0,1\n 48:\tand\tv0,v1,v0\n 4c:\tbnez\tv0,17c \n 50:\tnop\n 54:\tlbu\ta0,122(s1)\n 58:\tandi\tv0,a0,0xff\n 5c:\tsltu\tv1,zero,v0\n 60:\txori\tv0,v0,0x8\n 64:\tsltu\tv0,zero,v0\n 68:\tand\tv1,v1,v0\n 6c:\tbeqz\tv1,80 \n 70:\taddiu\tv0,a0,-9\n 74:\tsltiu\tv0,v0,2\n 78:\tbeqzl\tv0,80 \n 7c:\tsh\tzero,2988(s0)\n 80:\tlh\ta1,2988(s0)\n 84:\tbeqz\ta1,fc \n 88:\tnop\n 8c:\tjal\t0 \n 90:\tmove\ta0,s0\n 94:\tlbu\tv0,3015(s0)\n 98:\tbnez\tv0,fc \n 9c:\tnop\n a0:\tlbu\ta0,3000(s0)\n a4:\tjal\t0 \n a8:\tlh\ta1,2988(s0)\n ac:\tlh\tv1,2988(s0)\n b0:\tslti\tv0,v1,150\n b4:\txori\tv0,v0,0x1\n b8:\tnegu\tv0,v0\n bc:\tandi\tv0,v0,0x11d\n c0:\tori\ta0,v0,0x11c\n c4:\tslti\tv0,v1,300\n c8:\tbeqzl\tv0,d0 \n cc:\tli\ta0,286\n d0:\tslti\tv0,v1,400\n d4:\tbeqzl\tv0,dc \n d8:\tli\ta0,287\n dc:\tslti\tv0,v1,500\n e0:\tbeqzl\tv0,e8 \n e4:\tli\ta0,288\n e8:\tslti\tv0,v1,3000\n ec:\tbeqzl\tv0,f4 \n f0:\tli\ta0,289\n f4:\tjal\t0 \n f8:\tli\ta1,6\n fc:\tlbu\tv1,122(s1)\n 100:\tli\tv0,6\n 104:\tbne\tv1,v0,17c \n 108:\tnop\n 10c:\tlh\ta0,2986(s0)\n 110:\tbeqz\ta0,17c \n 114:\tnop\n 118:\tjal\t0 \n 11c:\tnop\n 120:\tlh\ta1,2986(s0)\n 124:\tjal\t0 \n 128:\tmove\ta0,s0\n 12c:\tlh\tv1,2986(s0)\n 130:\tslti\tv0,v1,15\n 134:\txori\tv0,v0,0x1\n 138:\tnegu\tv0,v0\n 13c:\tandi\tv0,v0,0x11d\n 140:\tori\ta0,v0,0x11c\n 144:\tslti\tv0,v1,30\n 148:\tbeqzl\tv0,150 \n 14c:\tli\ta0,286\n 150:\tslti\tv0,v1,55\n 154:\tbeqzl\tv0,15c \n 158:\tli\ta0,287\n 15c:\tslti\tv0,v1,95\n 160:\tbeqzl\tv0,168 \n 164:\tli\ta0,288\n 168:\tslti\tv0,v1,999\n 16c:\tbeqzl\tv0,174 \n 170:\tli\ta0,289\n 174:\tjal\t0 \n 178:\tli\ta1,6\n 17c:\tlh\tv0,2990(s0)\n 180:\tbeqz\tv0,1a4 \n 184:\tmove\ta0,s0\n 188:\tjal\t0 \n 18c:\tmove\ta0,s0\n 190:\tmove\ta0,s0\n 194:\tli\ta1,1\n 198:\tjal\t0 \n 19c:\tli\ta2,15\n 1a0:\tmove\ta0,s0\n 1a4:\tjal\t0 \n 1a8:\tli\ta1,3\n 1ac:\tli\tv0,1\n 1b0:\tlw\tra,24(sp)\n 1b4:\tlw\ts1,20(sp)\n 1b8:\tlw\ts0,16(sp)\n 1bc:\tjr\tra\n 1c0:\taddiu\tsp,sp,32\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-5a3edb649490b9c4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 func_800B2C18_A2AC8\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_800B46BC_A456C\n00000000 *UND*\t00000000 func_80059A48_5A648\n00000000 *UND*\t00000000 func_8004D890_4E490\n00000000 *UND*\t00000000 func_80058530_59130\n00000000 *UND*\t00000000 func_8004FCF0_508F0\n00000000 *UND*\t00000000 func_80059A88_5A688\n00000000 *UND*\t00000000 func_80059BD4_5A7D4\n00000000 *UND*\t00000000 func_8005D804_5E404\n00000000 *UND*\t00000000 func_800B00D4_9FF84\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_800B46BC_A456C\n00000040 R_MIPS_26 .text\n0000008c R_MIPS_26 func_80059A48_5A648\n000000a4 R_MIPS_26 func_8004D890_4E490\n000000f4 R_MIPS_26 func_80058530_59130\n00000118 R_MIPS_26 func_8004FCF0_508F0\n00000124 R_MIPS_26 func_80059A88_5A688\n00000174 R_MIPS_26 func_80058530_59130\n00000188 R_MIPS_26 func_80059BD4_5A7D4\n00000198 R_MIPS_26 func_8005D804_5E404\n000001a4 R_MIPS_26 func_800B00D4_9FF84\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 8e030b84 00408821 .............@.!\n 0020 30620001 14400062 00001021 30621000 0b...@.b...!0b..\n 0030 10400005 3c020008 0c000000 02002021 .@..<......... !\n 0040 0800006c 24020001 00621024 1440004b ...l$....b.$.@.K\n 0050 00000000 9224007a 308200ff 0002182b .....$.z0......+\n 0060 38420008 0002102b 00621824 10600004 8B.....+.b.$.`..\n 0070 2482fff7 2c420002 50400001 a6000bac $...,B..P@......\n 0080 86050bac 10a0001d 00000000 0c000000 ................\n 0090 02002021 92020bc7 14400018 00000000 .. !.....@......\n 00a0 92040bb8 0c000000 86050bac 86030bac ................\n 00b0 28620096 38420001 00021023 3042011d (b..8B.....#0B..\n 00c0 3444011c 2862012c 50400001 2404011e 4D..(b.,P@..$...\n 00d0 28620190 50400001 2404011f 286201f4 (b..P@..$...(b..\n 00e0 50400001 24040120 28620bb8 50400001 P@..$.. (b..P@..\n 00f0 24040121 0c000000 24050006 9223007a $..!....$....#.z\n 0100 24020006 1462001d 00000000 86040baa $....b..........\n 0110 1080001a 00000000 0c000000 00000000 ................\n 0120 86050baa 0c000000 02002021 86030baa .......... !....\n 0130 2862000f 38420001 00021023 3042011d (b..8B.....#0B..\n 0140 3444011c 2862001e 50400001 2404011e 4D..(b..P@..$...\n 0150 28620037 50400001 2404011f 2862005f (b.7P@..$...(b._\n 0160 50400001 24040120 286203e7 50400001 P@..$.. (b..P@..\n 0170 24040121 0c000000 24050006 86020bae $..!....$.......\n 0180 10400008 02002021 0c000000 02002021 .@.... !...... !\n 0190 02002021 24050001 0c000000 2406000f .. !$.......$...\n 01a0 02002021 0c000000 24050003 24020001 .. !....$...$...\n 01b0 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 01c0 27bd0020 00000000 00000000 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_800B2C18_A2AC8' — lift: cannot lift 'func_800B2C18_A2AC8': 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:\tlw\tv1,2948(s0) */\n/* 1c:\tmove\ts1,v0 */\n/* 20:\tandi\tv0,v1,0x1 */\n/* 24:\tbnez\tv0,1b0 */\n/* 28:\tmove\tv0,zero */\n/* 2c:\tandi\tv0,v1,0x1000 */\n/* 30:\tbeqz\tv0,48 */\n/* 34:\tlui\tv0,0x8 */\n/* 38:\tjal\t0 */\n/* 3c:\tmove\ta0,s0 */\n/* 40:\tj\t1b0 */\n/* 44:\tli\tv0,1 */\n/* 48:\tand\tv0,v1,v0 */\n/* 4c:\tbnez\tv0,17c */\n/* 50:\tnop */\n/* 54:\tlbu\ta0,122(s1) */\n/* 58:\tandi\tv0,a0,0xff */\n/* 5c:\tsltu\tv1,zero,v0 */\n/* 60:\txori\tv0,v0,0x8 */\n/* 64:\tsltu\tv0,zero,v0 */\n/* 68:\tand\tv1,v1,v0 */\n/* 6c:\tbeqz\tv1,80 */\n/* 70:\taddiu\tv0,a0,-9 */\n/* 74:\tsltiu\tv0,v0,2 */\n/* 78:\tbeqzl\tv0,80 */\n/* 7c:\tsh\tzero,2988(s0) */\n/* 80:\tlh\ta1,2988(s0) */\n/* 84:\tbeqz\ta1,fc */\n/* 88:\tnop */\n/* 8c:\tjal\t0 */\n/* 90:\tmove\ta0,s0 */\n/* 94:\tlbu\tv0,3015(s0) */\n/* 98:\tbnez\tv0,fc */\n/* 9c:\tnop */\n/* a0:\tlbu\ta0,3000(s0) */\n/* a4:\tjal\t0 */\n/* a8:\tlh\ta1,2988(s0) */\n/* ac:\tlh\tv1,2988(s0) */\n/* b0:\tslti\tv0,v1,150 */\n/* b4:\txori\tv0,v0,0x1 */\n/* b8:\tnegu\tv0,v0 */\n/* bc:\tandi\tv0,v0,0x11d */\n/* c0:\tori\ta0,v0,0x11c */\n/* c4:\tslti\tv0,v1,300 */\n/* c8:\tbeqzl\tv0,d0 */\n/* cc:\tli\ta0,286 */\n/* d0:\tslti\tv0,v1,400 */\n/* d4:\tbeqzl\tv0,dc */\n/* d8:\tli\ta0,287 */\n/* dc:\tslti\tv0,v1,500 */\n/* e0:\tbeqzl\tv0,e8 */\n/* e4:\tli\ta0,288 */\n/* e8:\tslti\tv0,v1,3000 */\n/* ec:\tbeqzl\tv0,f4 */\n/* f0:\tli\ta0,289 */\n/* f4:\tjal\t0 */\n/* f8:\tli\ta1,6 */\n/* fc:\tlbu\tv1,122(s1) */\n/* 100:\tli\tv0,6 */\n/* 104:\tbne\tv1,v0,17c */\n/* 108:\tnop */\n/* 10c:\tlh\ta0,2986(s0) */\n/* 110:\tbeqz\ta0,17c */\n/* 114:\tnop */\n/* 118:\tjal\t0 */\n/* 11c:\tnop */\n/* 120:\tlh\ta1,2986(s0) */\n/* 124:\tjal\t0 */\n/* 128:\tmove\ta0,s0 */\n/* 12c:\tlh\tv1,2986(s0) */\n/* 130:\tslti\tv0,v1,15 */\n/* 134:\txori\tv0,v0,0x1 */\n/* 138:\tnegu\tv0,v0 */\n/* 13c:\tandi\tv0,v0,0x11d */\n/* 140:\tori\ta0,v0,0x11c */\n/* 144:\tslti\tv0,v1,30 */\n/* 148:\tbeqzl\tv0,150 */\n/* 14c:\tli\ta0,286 */\n/* 150:\tslti\tv0,v1,55 */\n/* 154:\tbeqzl\tv0,15c */\n/* 158:\tli\ta0,287 */\n/* 15c:\tslti\tv0,v1,95 */\n/* 160:\tbeqzl\tv0,168 */\n/* 164:\tli\ta0,288 */\n/* 168:\tslti\tv0,v1,999 */\n/* 16c:\tbeqzl\tv0,174 */\n/* 170:\tli\ta0,289 */\n/* 174:\tjal\t0 */\n/* 178:\tli\ta1,6 */\n/* 17c:\tlh\tv0,2990(s0) */\n/* 180:\tbeqz\tv0,1a4 */\n/* 184:\tmove\ta0,s0 */\n/* 188:\tjal\t0 */\n/* 18c:\tmove\ta0,s0 */\n/* 190:\tmove\ta0,s0 */\n/* 194:\tli\ta1,1 */\n/* 198:\tjal\t0 */\n/* 19c:\tli\ta2,15 */\n/* 1a0:\tmove\ta0,s0 */\n/* 1a4:\tjal\t0 */\n/* 1a8:\tli\ta1,3 */\n/* 1ac:\tli\tv0,1 */\n/* 1b0:\tlw\tra,24(sp) */\n/* 1b4:\tlw\ts1,20(sp) */\n/* 1b8:\tlw\ts0,16(sp) */\n/* 1bc:\tjr\tra */\n/* 1c0:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_800B2C18_A2AC8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B2C18_A2AC8': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B2C18_A2AC8': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_80059A88_5A688(Player *, s16); /* extern */\n? func_800B46BC_A456C(Player *); /* extern */\n\ns32 func_800B2C18_A2AC8(Player *arg0) {\n s16 temp_a0_2;\n s16 temp_a1;\n s16 temp_v1_2;\n s16 temp_v1_3;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a0;\n s32 var_a0_2;\n s32 var_v0;\n u8 temp_a0;\n void *temp_s1;\n\n temp_v1 = arg0->unkB84;\n temp_s1 = getCurrentAllocation();\n var_v0 = 0;\n if (!(temp_v1 & 1)) {\n if (temp_v1 & 0x1000) {\n func_800B46BC_A456C(arg0);\n return 1;\n }\n if (!(temp_v1 & 0x80000)) {\n temp_a0 = temp_s1->unk7A;\n temp_v0 = temp_a0 & 0xFF;\n if (((temp_v0 != 0) & (temp_v0 != 8)) && ((u32) (temp_a0 - 9) >= 2U)) {\n arg0->unkBAC = 0;\n }\n temp_a1 = arg0->unkBAC;\n if (temp_a1 != 0) {\n func_80059A48_5A648(arg0, (s32) temp_a1);\n if (arg0->unkBC7 == 0) {\n func_8004D890_4E490((s32) arg0->unkBB8, (s32) arg0->unkBAC);\n temp_v1_2 = arg0->unkBAC;\n var_a0 = (-(temp_v1_2 >= 0x96) & 0x11D) | 0x11C;\n if (temp_v1_2 >= 0x12C) {\n var_a0 = 0x11E;\n }\n if (temp_v1_2 >= 0x190) {\n var_a0 = 0x11F;\n }\n if (temp_v1_2 >= 0x1F4) {\n var_a0 = 0x120;\n }\n if (temp_v1_2 >= 0xBB8) {\n var_a0 = 0x121;\n }\n func_80058530_59130(var_a0, 6);\n }\n }\n if (temp_s1->unk7A == 6) {\n temp_a0_2 = arg0->unkBAA;\n if (temp_a0_2 != 0) {\n func_8004FCF0_508F0((s32) temp_a0_2);\n func_80059A88_5A688(arg0, arg0->unkBAA);\n temp_v1_3 = arg0->unkBAA;\n var_a0_2 = (-(temp_v1_3 >= 0xF) & 0x11D) | 0x11C;\n if (temp_v1_3 >= 0x1E) {\n var_a0_2 = 0x11E;\n }\n if (temp_v1_3 >= 0x37) {\n var_a0_2 = 0x11F;\n }\n if (temp_v1_3 >= 0x5F) {\n var_a0_2 = 0x120;\n }\n if (temp_v1_3 >= 0x3E7) {\n var_a0_2 = 0x121;\n }\n func_80058530_59130(var_a0_2, 6);\n }\n }\n }\n if (arg0->unkBAE != 0) {\n func_80059BD4_5A7D4(arg0);\n func_8005D804_5E404(arg0, 1U, 0xFU);\n }\n func_800B00D4_9FF84(arg0, 3);\n var_v0 = 1;\n /* Duplicate return node #32. Try simplifying control flow for better match */\n return var_v0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":94,"lines":84,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B2C18_A2AC8` — benchmark function snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B2C18_A2AC8\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 lw\t$v1, 2948($s0)\n move\t$s1, $v0\n andi\t$v0, $v1, 0x1\n bnez\t$v0, .L1b0\n move\t$v0, $zero\n andi\t$v0, $v1, 0x1000\n beqz\t$v0, .L48\n lui\t$v0, 0x8\n jal\tfunc_800B46BC_A456C\n move\t$a0, $s0\n j\t.L1b0\n li\t$v0, 1\n.L48:\n and\t$v0, $v1, $v0\n bnez\t$v0, .L17c\n nop\n lbu\t$a0, 122($s1)\n andi\t$v0, $a0, 0xff\n sltu\t$v1, $zero, $v0\n xori\t$v0, $v0, 0x8\n sltu\t$v0, $zero, $v0\n and\t$v1, $v1, $v0\n beqz\t$v1, .L80\n addiu\t$v0, $a0, -9\n sltiu\t$v0, $v0, 2\n beqzl\t$v0, .L80\n sh\t$zero, 2988($s0)\n.L80:\n lh\t$a1, 2988($s0)\n beqz\t$a1, .Lfc\n nop\n jal\tfunc_80059A48_5A648\n move\t$a0, $s0\n lbu\t$v0, 3015($s0)\n bnez\t$v0, .Lfc\n nop\n lbu\t$a0, 3000($s0)\n jal\tfunc_8004D890_4E490\n lh\t$a1, 2988($s0)\n lh\t$v1, 2988($s0)\n slti\t$v0, $v1, 150\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n andi\t$v0, $v0, 0x11d\n ori\t$a0, $v0, 0x11c\n slti\t$v0, $v1, 300\n beqzl\t$v0, .Ld0\n li\t$a0, 286\n.Ld0:\n slti\t$v0, $v1, 400\n beqzl\t$v0, .Ldc\n li\t$a0, 287\n.Ldc:\n slti\t$v0, $v1, 500\n beqzl\t$v0, .Le8\n li\t$a0, 288\n.Le8:\n slti\t$v0, $v1, 3000\n beqzl\t$v0, .Lf4\n li\t$a0, 289\n.Lf4:\n jal\tfunc_80058530_59130\n li\t$a1, 6\n.Lfc:\n lbu\t$v1, 122($s1)\n li\t$v0, 6\n bne\t$v1, $v0, .L17c\n nop\n lh\t$a0, 2986($s0)\n beqz\t$a0, .L17c\n nop\n jal\tfunc_8004FCF0_508F0\n nop\n lh\t$a1, 2986($s0)\n jal\tfunc_80059A88_5A688\n move\t$a0, $s0\n lh\t$v1, 2986($s0)\n slti\t$v0, $v1, 15\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n andi\t$v0, $v0, 0x11d\n ori\t$a0, $v0, 0x11c\n slti\t$v0, $v1, 30\n beqzl\t$v0, .L150\n li\t$a0, 286\n.L150:\n slti\t$v0, $v1, 55\n beqzl\t$v0, .L15c\n li\t$a0, 287\n.L15c:\n slti\t$v0, $v1, 95\n beqzl\t$v0, .L168\n li\t$a0, 288\n.L168:\n slti\t$v0, $v1, 999\n beqzl\t$v0, .L174\n li\t$a0, 289\n.L174:\n jal\tfunc_80058530_59130\n li\t$a1, 6\n.L17c:\n lh\t$v0, 2990($s0)\n beqz\t$v0, .L1a4\n move\t$a0, $s0\n jal\tfunc_80059BD4_5A7D4\n move\t$a0, $s0\n move\t$a0, $s0\n li\t$a1, 1\n jal\tfunc_8005D804_5E404\n li\t$a2, 15\n move\t$a0, $s0\n.L1a4:\n jal\tfunc_800B00D4_9FF84\n li\t$a1, 3\n li\t$v0, 1\n.L1b0:\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\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_800B2C18_A2AC8(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B2C18_A2AC8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B2C18_A2AC8` — benchmark function snowboardkids2:func_800B2C18_A2AC8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B2C18_A2AC8: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:\tlw\tv1,2948(s0)\n 1c:\tmove\ts1,v0\n 20:\tandi\tv0,v1,0x1\n 24:\tbnez\tv0,1b0 \n 28:\tmove\tv0,zero\n 2c:\tandi\tv0,v1,0x1000\n 30:\tbeqz\tv0,48 \n 34:\tlui\tv0,0x8\n 38:\tjal\t0 \n 3c:\tmove\ta0,s0\n 40:\tj\t1b0 \n 44:\tli\tv0,1\n 48:\tand\tv0,v1,v0\n 4c:\tbnez\tv0,17c \n 50:\tnop\n 54:\tlbu\ta0,122(s1)\n 58:\tandi\tv0,a0,0xff\n 5c:\tsltu\tv1,zero,v0\n 60:\txori\tv0,v0,0x8\n 64:\tsltu\tv0,zero,v0\n 68:\tand\tv1,v1,v0\n 6c:\tbeqz\tv1,80 \n 70:\taddiu\tv0,a0,-9\n 74:\tsltiu\tv0,v0,2\n 78:\tbeqzl\tv0,80 \n 7c:\tsh\tzero,2988(s0)\n 80:\tlh\ta1,2988(s0)\n 84:\tbeqz\ta1,fc \n 88:\tnop\n 8c:\tjal\t0 \n 90:\tmove\ta0,s0\n 94:\tlbu\tv0,3015(s0)\n 98:\tbnez\tv0,fc \n 9c:\tnop\n a0:\tlbu\ta0,3000(s0)\n a4:\tjal\t0 \n a8:\tlh\ta1,2988(s0)\n ac:\tlh\tv1,2988(s0)\n b0:\tslti\tv0,v1,150\n b4:\txori\tv0,v0,0x1\n b8:\tnegu\tv0,v0\n bc:\tandi\tv0,v0,0x11d\n c0:\tori\ta0,v0,0x11c\n c4:\tslti\tv0,v1,300\n c8:\tbeqzl\tv0,d0 \n cc:\tli\ta0,286\n d0:\tslti\tv0,v1,400\n d4:\tbeqzl\tv0,dc \n d8:\tli\ta0,287\n dc:\tslti\tv0,v1,500\n e0:\tbeqzl\tv0,e8 \n e4:\tli\ta0,288\n e8:\tslti\tv0,v1,3000\n ec:\tbeqzl\tv0,f4 \n f0:\tli\ta0,289\n f4:\tjal\t0 \n f8:\tli\ta1,6\n fc:\tlbu\tv1,122(s1)\n 100:\tli\tv0,6\n 104:\tbne\tv1,v0,17c \n 108:\tnop\n 10c:\tlh\ta0,2986(s0)\n 110:\tbeqz\ta0,17c \n 114:\tnop\n 118:\tjal\t0 \n 11c:\tnop\n 120:\tlh\ta1,2986(s0)\n 124:\tjal\t0 \n 128:\tmove\ta0,s0\n 12c:\tlh\tv1,2986(s0)\n 130:\tslti\tv0,v1,15\n 134:\txori\tv0,v0,0x1\n 138:\tnegu\tv0,v0\n 13c:\tandi\tv0,v0,0x11d\n 140:\tori\ta0,v0,0x11c\n 144:\tslti\tv0,v1,30\n 148:\tbeqzl\tv0,150 \n 14c:\tli\ta0,286\n 150:\tslti\tv0,v1,55\n 154:\tbeqzl\tv0,15c \n 158:\tli\ta0,287\n 15c:\tslti\tv0,v1,95\n 160:\tbeqzl\tv0,168 \n 164:\tli\ta0,288\n 168:\tslti\tv0,v1,999\n 16c:\tbeqzl\tv0,174 \n 170:\tli\ta0,289\n 174:\tjal\t0 \n 178:\tli\ta1,6\n 17c:\tlh\tv0,2990(s0)\n 180:\tbeqz\tv0,1a4 \n 184:\tmove\ta0,s0\n 188:\tjal\t0 \n 18c:\tmove\ta0,s0\n 190:\tmove\ta0,s0\n 194:\tli\ta1,1\n 198:\tjal\t0 \n 19c:\tli\ta2,15\n 1a0:\tmove\ta0,s0\n 1a4:\tjal\t0 \n 1a8:\tli\ta1,3\n 1ac:\tli\tv0,1\n 1b0:\tlw\tra,24(sp)\n 1b4:\tlw\ts1,20(sp)\n 1b8:\tlw\ts0,16(sp)\n 1bc:\tjr\tra\n 1c0:\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-5a3edb649490b9c4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001c4 func_800B2C18_A2AC8\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_800B46BC_A456C\n00000000 *UND*\t00000000 func_80059A48_5A648\n00000000 *UND*\t00000000 func_8004D890_4E490\n00000000 *UND*\t00000000 func_80058530_59130\n00000000 *UND*\t00000000 func_8004FCF0_508F0\n00000000 *UND*\t00000000 func_80059A88_5A688\n00000000 *UND*\t00000000 func_80059BD4_5A7D4\n00000000 *UND*\t00000000 func_8005D804_5E404\n00000000 *UND*\t00000000 func_800B00D4_9FF84\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_800B46BC_A456C\n00000040 R_MIPS_26 .text\n0000008c R_MIPS_26 func_80059A48_5A648\n000000a4 R_MIPS_26 func_8004D890_4E490\n000000f4 R_MIPS_26 func_80058530_59130\n00000118 R_MIPS_26 func_8004FCF0_508F0\n00000124 R_MIPS_26 func_80059A88_5A688\n00000174 R_MIPS_26 func_80058530_59130\n00000188 R_MIPS_26 func_80059BD4_5A7D4\n00000198 R_MIPS_26 func_8005D804_5E404\n000001a4 R_MIPS_26 func_800B00D4_9FF84\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 8e030b84 00408821 .............@.!\n 0020 30620001 14400062 00001021 30621000 0b...@.b...!0b..\n 0030 10400005 3c020008 0c000000 02002021 .@..<......... !\n 0040 0800006c 24020001 00621024 1440004b ...l$....b.$.@.K\n 0050 00000000 9224007a 308200ff 0002182b .....$.z0......+\n 0060 38420008 0002102b 00621824 10600004 8B.....+.b.$.`..\n 0070 2482fff7 2c420002 50400001 a6000bac $...,B..P@......\n 0080 86050bac 10a0001d 00000000 0c000000 ................\n 0090 02002021 92020bc7 14400018 00000000 .. !.....@......\n 00a0 92040bb8 0c000000 86050bac 86030bac ................\n 00b0 28620096 38420001 00021023 3042011d (b..8B.....#0B..\n 00c0 3444011c 2862012c 50400001 2404011e 4D..(b.,P@..$...\n 00d0 28620190 50400001 2404011f 286201f4 (b..P@..$...(b..\n 00e0 50400001 24040120 28620bb8 50400001 P@..$.. (b..P@..\n 00f0 24040121 0c000000 24050006 9223007a $..!....$....#.z\n 0100 24020006 1462001d 00000000 86040baa $....b..........\n 0110 1080001a 00000000 0c000000 00000000 ................\n 0120 86050baa 0c000000 02002021 86030baa .......... !....\n 0130 2862000f 38420001 00021023 3042011d (b..8B.....#0B..\n 0140 3444011c 2862001e 50400001 2404011e 4D..(b..P@..$...\n 0150 28620037 50400001 2404011f 2862005f (b.7P@..$...(b._\n 0160 50400001 24040120 286203e7 50400001 P@..$.. (b..P@..\n 0170 24040121 0c000000 24050006 86020bae $..!....$.......\n 0180 10400008 02002021 0c000000 02002021 .@.... !...... !\n 0190 02002021 24050001 0c000000 2406000f .. !$.......$...\n 01a0 02002021 0c000000 24050003 24020001 .. !....$...$...\n 01b0 8fbf0018 8fb10014 8fb00010 03e00008 ................\n 01c0 27bd0020 00000000 00000000 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_800B2C18_A2AC8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_800B3784_A3634:gcc2.7.2kmc","sym":"func_800B3784_A3634","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","switch","bitwise","call","comparison-tree"],"loc":79,"refSource":"void func_800B3784_A3634(Player *arg0) {\n s32 result;\n u8 temp;\n\n switch (arg0->unkBD5) {\n default:\n break;\n\n case 0:\n arg0->unkBD5++;\n arg0->unkBD6 = 4;\n case 1:\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD6 = result;\n arg0->unkBD7 = 0;\n arg0->unkBD5 = arg0->unkBD5 + 1;\n arg0->unkB84 |= 0x8000;\n }\n func_8005D308_5DF08(arg0, arg0->unkBD6);\n break;\n\n case 2:\n result = func_8005D308_5DF08(arg0, arg0->unkBD6);\n if (result != 0) {\n if (arg0->unkBD6 == 0x17) {\n func_800B2950_A2800(arg0, 0);\n }\n\n if (arg0->unkBD6 == 0x19) {\n func_800B2950_A2800(arg0, 1);\n }\n\n if (arg0->unkBD6 == 0x15) {\n func_800B2950_A2800(arg0, 2);\n }\n\n if (arg0->unkBD6 == 0x13) {\n func_800B2950_A2800(arg0, 3);\n }\n\n arg0->unkBD5++;\n arg0->unkBD6++;\n }\n\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD7 = result;\n }\n\n break;\n\n case 3:\n result = func_8005D308_5DF08(arg0, arg0->unkBD6);\n if (result != 0) {\n if (arg0->unkBD7 != 0) {\n arg0->unkBD5 = 2;\n arg0->unkBD6 = arg0->unkBD7;\n arg0->unkBD7 = 0;\n break;\n } else {\n arg0->unkB84 &= 0xFFFF7FFF;\n arg0->unkBD5 = 1;\n }\n }\n\n result = func_800B36F0_A35A0(arg0);\n if (result != 0) {\n arg0->unkBD7 = result;\n }\n break;\n }\n\n if (arg0->unkB84 & 0xC000) {\n arg0->unkB84 |= 0x1000;\n } else {\n arg0->unkB84 &= ~0x1000;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L1272-L1350","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:\tlbu\ta0,3029(s0)\n 14:\tli\tv0,1\n 18:\tandi\tv1,a0,0xff\n 1c:\tbeq\tv1,v0,60 \n 20:\tslti\tv0,v1,2\n 24:\tbeqzl\tv0,3c \n 28:\tli\tv0,2\n 2c:\tbeqz\tv1,54 \n 30:\taddiu\tv0,a0,1\n 34:\tj\t1a0 \n 38:\tnop\n 3c:\tbeq\tv1,v0,a8 \n 40:\tli\tv0,3\n 44:\tbeq\tv1,v0,13c \n 48:\tnop\n 4c:\tj\t1a0 \n 50:\tnop\n 54:\tsb\tv0,3029(s0)\n 58:\tli\tv0,4\n 5c:\tsb\tv0,3030(s0)\n 60:\tjal\t0 \n 64:\tmove\ta0,s0\n 68:\tmove\ta0,v0\n 6c:\tbeqz\ta0,94 \n 70:\tnop\n 74:\tlbu\tv0,3029(s0)\n 78:\tlw\tv1,2948(s0)\n 7c:\tsb\ta0,3030(s0)\n 80:\tsb\tzero,3031(s0)\n 84:\taddiu\tv0,v0,1\n 88:\tori\tv1,v1,0x8000\n 8c:\tsb\tv0,3029(s0)\n 90:\tsw\tv1,2948(s0)\n 94:\tlbu\ta1,3030(s0)\n 98:\tjal\t0 \n 9c:\tmove\ta0,s0\n a0:\tj\t1a0 \n a4:\tnop\n a8:\tlbu\ta1,3030(s0)\n ac:\tjal\t0 \n b0:\tmove\ta0,s0\n b4:\tbeqz\tv0,18c \n b8:\tli\tv0,23\n bc:\tlbu\tv1,3030(s0)\n c0:\tbne\tv1,v0,dc \n c4:\tli\tv0,25\n c8:\tmove\ta0,s0\n cc:\tjal\t0 \n d0:\tmove\ta1,zero\n d4:\tlbu\tv1,3030(s0)\n d8:\tli\tv0,25\n dc:\tbne\tv1,v0,ec \n e0:\tmove\ta0,s0\n e4:\tjal\t0 \n e8:\tli\ta1,1\n ec:\tlbu\tv1,3030(s0)\n f0:\tli\tv0,21\n f4:\tbne\tv1,v0,110 \n f8:\tli\tv0,19\n fc:\tmove\ta0,s0\n 100:\tjal\t0 \n 104:\tli\ta1,2\n 108:\tlbu\tv1,3030(s0)\n 10c:\tli\tv0,19\n 110:\tbne\tv1,v0,120 \n 114:\tmove\ta0,s0\n 118:\tjal\t0 \n 11c:\tli\ta1,3\n 120:\tlbu\tv0,3029(s0)\n 124:\tlbu\tv1,3030(s0)\n 128:\taddiu\tv0,v0,1\n 12c:\taddiu\tv1,v1,1\n 130:\tsb\tv0,3029(s0)\n 134:\tj\t18c \n 138:\tsb\tv1,3030(s0)\n 13c:\tlbu\ta1,3030(s0)\n 140:\tjal\t0 \n 144:\tmove\ta0,s0\n 148:\tbeqz\tv0,18c \n 14c:\tnop\n 150:\tlbu\tv0,3031(s0)\n 154:\tbeqz\tv0,170 \n 158:\tli\tv0,2\n 15c:\tlbu\tv1,3031(s0)\n 160:\tsb\tv0,3029(s0)\n 164:\tsb\tzero,3031(s0)\n 168:\tj\t1a0 \n 16c:\tsb\tv1,3030(s0)\n 170:\tlui\ta0,0xffff\n 174:\tlw\tv1,2948(s0)\n 178:\tori\ta0,a0,0x7fff\n 17c:\tli\tv0,1\n 180:\tsb\tv0,3029(s0)\n 184:\tand\tv1,v1,a0\n 188:\tsw\tv1,2948(s0)\n 18c:\tjal\t0 \n 190:\tmove\ta0,s0\n 194:\tmove\ta0,v0\n 198:\tbnezl\ta0,1a0 \n 19c:\tsb\ta0,3031(s0)\n 1a0:\tlw\tv1,2948(s0)\n 1a4:\tandi\tv0,v1,0xc000\n 1a8:\tbnez\tv0,1b8 \n 1ac:\tori\tv0,v1,0x1000\n 1b0:\tli\tv0,-4097\n 1b4:\tand\tv0,v1,v0\n 1b8:\tsw\tv0,2948(s0)\n 1bc:\tlw\tra,20(sp)\n 1c0:\tlw\ts0,16(sp)\n 1c4:\tjr\tra\n 1c8:\taddiu\tsp,sp,24\n 1cc:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","proto":{"func_800B3784_A3634":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-147a74c9aecbaebf/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001cc func_800B3784_A3634\n00000000 *UND*\t00000000 func_800B36F0_A35A0\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_800B2950_A2800\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000034 R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000060 R_MIPS_26 func_800B36F0_A35A0\n00000098 R_MIPS_26 func_8005D308_5DF08\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_26 func_8005D308_5DF08\n000000cc R_MIPS_26 func_800B2950_A2800\n000000e4 R_MIPS_26 func_800B2950_A2800\n00000100 R_MIPS_26 func_800B2950_A2800\n00000118 R_MIPS_26 func_800B2950_A2800\n00000134 R_MIPS_26 .text\n00000140 R_MIPS_26 func_8005D308_5DF08\n00000168 R_MIPS_26 .text\n0000018c R_MIPS_26 func_800B36F0_A35A0\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 92040bd5 24020001 308300ff 10620010 ....$...0....b..\n 0020 28620002 50400005 24020002 10600009 (b..P@..$....`..\n 0030 24820001 08000068 00000000 1062001a $......h.....b..\n 0040 24020003 1062003d 00000000 08000068 $....b.=.......h\n 0050 00000000 a2020bd5 24020004 a2020bd6 ........$.......\n 0060 0c000000 02002021 00402021 10800009 ...... !.@ !....\n 0070 00000000 92020bd5 8e030b84 a2040bd6 ................\n 0080 a2000bd7 24420001 34638000 a2020bd5 ....$B..4c......\n 0090 ae030b84 92050bd6 0c000000 02002021 .............. !\n 00a0 08000068 00000000 92050bd6 0c000000 ...h............\n 00b0 02002021 10400035 24020017 92030bd6 .. !.@.5$.......\n 00c0 14620006 24020019 02002021 0c000000 .b..$..... !....\n 00d0 00002821 92030bd6 24020019 14620003 ..(!....$....b..\n 00e0 02002021 0c000000 24050001 92030bd6 .. !....$.......\n 00f0 24020015 14620006 24020013 02002021 $....b..$..... !\n 0100 0c000000 24050002 92030bd6 24020013 ....$.......$...\n 0110 14620003 02002021 0c000000 24050003 .b.... !....$...\n 0120 92020bd5 92030bd6 24420001 24630001 ........$B..$c..\n 0130 a2020bd5 08000063 a2030bd6 92050bd6 .......c........\n 0140 0c000000 02002021 10400010 00000000 ...... !.@......\n 0150 92020bd7 10400006 24020002 92030bd7 .....@..$.......\n 0160 a2020bd5 a2000bd7 08000068 a2030bd6 ...........h....\n 0170 3c04ffff 8e030b84 34847fff 24020001 <.......4...$...\n 0180 a2020bd5 00641824 ae030b84 0c000000 .....d.$........\n 0190 02002021 00402021 54800001 a2040bd7 .. !.@ !T.......\n 01a0 8e030b84 3062c000 14400003 34621000 ....0b...@..4b..\n 01b0 2402efff 00621024 ae020b84 8fbf0014 $....b.$........\n 01c0 8fb00010 03e00008 27bd0018 00000000 ........'.......\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_800B3784_A3634' — lift: cannot lift 'func_800B3784_A3634': 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:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tlbu\ta0,3029(s0) */\n/* 14:\tli\tv0,1 */\n/* 18:\tandi\tv1,a0,0xff */\n/* 1c:\tbeq\tv1,v0,60 */\n/* 20:\tslti\tv0,v1,2 */\n/* 24:\tbeqzl\tv0,3c */\n/* 28:\tli\tv0,2 */\n/* 2c:\tbeqz\tv1,54 */\n/* 30:\taddiu\tv0,a0,1 */\n/* 34:\tj\t1a0 */\n/* 38:\tnop */\n/* 3c:\tbeq\tv1,v0,a8 */\n/* 40:\tli\tv0,3 */\n/* 44:\tbeq\tv1,v0,13c */\n/* 48:\tnop */\n/* 4c:\tj\t1a0 */\n/* 50:\tnop */\n/* 54:\tsb\tv0,3029(s0) */\n/* 58:\tli\tv0,4 */\n/* 5c:\tsb\tv0,3030(s0) */\n/* 60:\tjal\t0 */\n/* 64:\tmove\ta0,s0 */\n/* 68:\tmove\ta0,v0 */\n/* 6c:\tbeqz\ta0,94 */\n/* 70:\tnop */\n/* 74:\tlbu\tv0,3029(s0) */\n/* 78:\tlw\tv1,2948(s0) */\n/* 7c:\tsb\ta0,3030(s0) */\n/* 80:\tsb\tzero,3031(s0) */\n/* 84:\taddiu\tv0,v0,1 */\n/* 88:\tori\tv1,v1,0x8000 */\n/* 8c:\tsb\tv0,3029(s0) */\n/* 90:\tsw\tv1,2948(s0) */\n/* 94:\tlbu\ta1,3030(s0) */\n/* 98:\tjal\t0 */\n/* 9c:\tmove\ta0,s0 */\n/* a0:\tj\t1a0 */\n/* a4:\tnop */\n/* a8:\tlbu\ta1,3030(s0) */\n/* ac:\tjal\t0 */\n/* b0:\tmove\ta0,s0 */\n/* b4:\tbeqz\tv0,18c */\n/* b8:\tli\tv0,23 */\n/* bc:\tlbu\tv1,3030(s0) */\n/* c0:\tbne\tv1,v0,dc */\n/* c4:\tli\tv0,25 */\n/* c8:\tmove\ta0,s0 */\n/* cc:\tjal\t0 */\n/* d0:\tmove\ta1,zero */\n/* d4:\tlbu\tv1,3030(s0) */\n/* d8:\tli\tv0,25 */\n/* dc:\tbne\tv1,v0,ec */\n/* e0:\tmove\ta0,s0 */\n/* e4:\tjal\t0 */\n/* e8:\tli\ta1,1 */\n/* ec:\tlbu\tv1,3030(s0) */\n/* f0:\tli\tv0,21 */\n/* f4:\tbne\tv1,v0,110 */\n/* f8:\tli\tv0,19 */\n/* fc:\tmove\ta0,s0 */\n/* 100:\tjal\t0 */\n/* 104:\tli\ta1,2 */\n/* 108:\tlbu\tv1,3030(s0) */\n/* 10c:\tli\tv0,19 */\n/* 110:\tbne\tv1,v0,120 */\n/* 114:\tmove\ta0,s0 */\n/* 118:\tjal\t0 */\n/* 11c:\tli\ta1,3 */\n/* 120:\tlbu\tv0,3029(s0) */\n/* 124:\tlbu\tv1,3030(s0) */\n/* 128:\taddiu\tv0,v0,1 */\n/* 12c:\taddiu\tv1,v1,1 */\n/* 130:\tsb\tv0,3029(s0) */\n/* 134:\tj\t18c */\n/* 138:\tsb\tv1,3030(s0) */\n/* 13c:\tlbu\ta1,3030(s0) */\n/* 140:\tjal\t0 */\n/* 144:\tmove\ta0,s0 */\n/* 148:\tbeqz\tv0,18c */\n/* 14c:\tnop */\n/* 150:\tlbu\tv0,3031(s0) */\n/* 154:\tbeqz\tv0,170 */\n/* 158:\tli\tv0,2 */\n/* 15c:\tlbu\tv1,3031(s0) */\n/* 160:\tsb\tv0,3029(s0) */\n/* 164:\tsb\tzero,3031(s0) */\n/* 168:\tj\t1a0 */\n/* 16c:\tsb\tv1,3030(s0) */\n/* 170:\tlui\ta0,0xffff */\n/* 174:\tlw\tv1,2948(s0) */\n/* 178:\tori\ta0,a0,0x7fff */\n/* 17c:\tli\tv0,1 */\n/* 180:\tsb\tv0,3029(s0) */\n/* 184:\tand\tv1,v1,a0 */\n/* 188:\tsw\tv1,2948(s0) */\n/* 18c:\tjal\t0 */\n/* 190:\tmove\ta0,s0 */\n/* 194:\tmove\ta0,v0 */\n/* 198:\tbnezl\ta0,1a0 */\n/* 19c:\tsb\ta0,3031(s0) */\n/* 1a0:\tlw\tv1,2948(s0) */\n/* 1a4:\tandi\tv0,v1,0xc000 */\n/* 1a8:\tbnez\tv0,1b8 */\n/* 1ac:\tori\tv0,v1,0x1000 */\n/* 1b0:\tli\tv0,-4097 */\n/* 1b4:\tand\tv0,v1,v0 */\n/* 1b8:\tsw\tv0,2948(s0) */\n/* 1bc:\tlw\tra,20(sp) */\n/* 1c0:\tlw\ts0,16(sp) */\n/* 1c4:\tjr\tra */\n/* 1c8:\taddiu\tsp,sp,24 */\n/* 1cc:\tnop */\nvoid func_800B3784_A3634(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B3784_A3634': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":124,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B3784_A3634': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_800B2950_A2800(Player *, ?); /* extern */\nu8 func_800B36F0_A35A0(Player *); /* extern */\n\nvoid func_800B3784_A3634(Player *arg0) {\n s32 temp_v1;\n s32 temp_v1_3;\n s32 var_v0;\n u8 temp_a0;\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v1_2;\n\n temp_a0 = arg0->unkBD5;\n temp_v1 = temp_a0 & 0xFF;\n switch (temp_v1) { /* irregular */\n case 0:\n arg0->unkBD5 = temp_a0 + 1;\n arg0->unkBD6 = 4;\n /* fallthrough */\n case 1:\n temp_v0 = func_800B36F0_A35A0(arg0);\n if (temp_v0 != 0) {\n arg0->unkBD6 = temp_v0;\n arg0->unkBD7 = 0;\n arg0->unkBD5 += 1;\n arg0->unkB84 |= 0x8000;\n }\n func_8005D308_5DF08(arg0, (s32) arg0->unkBD6);\n break;\n case 2:\n if (func_8005D308_5DF08(arg0, (s32) arg0->unkBD6) != 0) {\n if (arg0->unkBD6 == 0x17) {\n func_800B2950_A2800(arg0, 0);\n }\n if (arg0->unkBD6 == 0x19) {\n func_800B2950_A2800(arg0, 1);\n }\n if (arg0->unkBD6 == 0x15) {\n func_800B2950_A2800(arg0, 2);\n }\n if (arg0->unkBD6 == 0x13) {\n func_800B2950_A2800(arg0, 3);\n }\n arg0->unkBD5 += 1;\n arg0->unkBD6 += 1;\n }\nblock_27:\n temp_v0_2 = func_800B36F0_A35A0(arg0);\n if (temp_v0_2 != 0) {\n arg0->unkBD7 = temp_v0_2;\n }\n break;\n case 3:\n if (func_8005D308_5DF08(arg0, (s32) arg0->unkBD6) != 0) {\n if (arg0->unkBD7 != 0) {\n temp_v1_2 = arg0->unkBD7;\n arg0->unkBD5 = 2;\n arg0->unkBD7 = 0;\n arg0->unkBD6 = temp_v1_2;\n } else {\n arg0->unkBD5 = 1;\n arg0->unkB84 &= 0xFFFF7FFF;\n goto block_27;\n }\n } else {\n goto block_27;\n }\n break;\n }\n temp_v1_3 = arg0->unkB84;\n var_v0 = temp_v1_3 | 0x1000;\n if (!(temp_v1_3 & 0xC000)) {\n var_v0 = temp_v1_3 & ~0x1000;\n }\n arg0->unkB84 = var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":78,"lines":74,"gotos":2,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B3784_A3634` — benchmark function snowboardkids2:func_800B3784_A3634:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B3784_A3634\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lbu\t$a0, 3029($s0)\n li\t$v0, 1\n andi\t$v1, $a0, 0xff\n beq\t$v1, $v0, .L60\n slti\t$v0, $v1, 2\n beqzl\t$v0, .L3c\n li\t$v0, 2\n beqz\t$v1, .L54\n addiu\t$v0, $a0, 1\n j\t.L1a0\n nop\n.L3c:\n beq\t$v1, $v0, .La8\n li\t$v0, 3\n beq\t$v1, $v0, .L13c\n nop\n j\t.L1a0\n nop\n.L54:\n sb\t$v0, 3029($s0)\n li\t$v0, 4\n sb\t$v0, 3030($s0)\n.L60:\n jal\tfunc_800B36F0_A35A0\n move\t$a0, $s0\n move\t$a0, $v0\n beqz\t$a0, .L94\n nop\n lbu\t$v0, 3029($s0)\n lw\t$v1, 2948($s0)\n sb\t$a0, 3030($s0)\n sb\t$zero, 3031($s0)\n addiu\t$v0, $v0, 1\n ori\t$v1, $v1, 0x8000\n sb\t$v0, 3029($s0)\n sw\t$v1, 2948($s0)\n.L94:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n j\t.L1a0\n nop\n.La8:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n beqz\t$v0, .L18c\n li\t$v0, 23\n lbu\t$v1, 3030($s0)\n bne\t$v1, $v0, .Ldc\n li\t$v0, 25\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n move\t$a1, $zero\n lbu\t$v1, 3030($s0)\n li\t$v0, 25\n.Ldc:\n bne\t$v1, $v0, .Lec\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 1\n.Lec:\n lbu\t$v1, 3030($s0)\n li\t$v0, 21\n bne\t$v1, $v0, .L110\n li\t$v0, 19\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 2\n lbu\t$v1, 3030($s0)\n li\t$v0, 19\n.L110:\n bne\t$v1, $v0, .L120\n move\t$a0, $s0\n jal\tfunc_800B2950_A2800\n li\t$a1, 3\n.L120:\n lbu\t$v0, 3029($s0)\n lbu\t$v1, 3030($s0)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, 1\n sb\t$v0, 3029($s0)\n j\t.L18c\n sb\t$v1, 3030($s0)\n.L13c:\n lbu\t$a1, 3030($s0)\n jal\tfunc_8005D308_5DF08\n move\t$a0, $s0\n beqz\t$v0, .L18c\n nop\n lbu\t$v0, 3031($s0)\n beqz\t$v0, .L170\n li\t$v0, 2\n lbu\t$v1, 3031($s0)\n sb\t$v0, 3029($s0)\n sb\t$zero, 3031($s0)\n j\t.L1a0\n sb\t$v1, 3030($s0)\n.L170:\n lui\t$a0, 0xffff\n lw\t$v1, 2948($s0)\n ori\t$a0, $a0, 0x7fff\n li\t$v0, 1\n sb\t$v0, 3029($s0)\n and\t$v1, $v1, $a0\n sw\t$v1, 2948($s0)\n.L18c:\n jal\tfunc_800B36F0_A35A0\n move\t$a0, $s0\n move\t$a0, $v0\n bnezl\t$a0, .L1a0\n sb\t$a0, 3031($s0)\n.L1a0:\n lw\t$v1, 2948($s0)\n andi\t$v0, $v1, 0xc000\n bnez\t$v0, .L1b8\n ori\t$v0, $v1, 0x1000\n li\t$v0, -4097\n and\t$v0, $v1, $v0\n.L1b8:\n sw\t$v0, 2948($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B3784_A3634(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B3784_A3634 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B3784_A3634` — benchmark function snowboardkids2:func_800B3784_A3634:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B3784_A3634: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:\tlbu\ta0,3029(s0)\n 14:\tli\tv0,1\n 18:\tandi\tv1,a0,0xff\n 1c:\tbeq\tv1,v0,60 \n 20:\tslti\tv0,v1,2\n 24:\tbeqzl\tv0,3c \n 28:\tli\tv0,2\n 2c:\tbeqz\tv1,54 \n 30:\taddiu\tv0,a0,1\n 34:\tj\t1a0 \n 38:\tnop\n 3c:\tbeq\tv1,v0,a8 \n 40:\tli\tv0,3\n 44:\tbeq\tv1,v0,13c \n 48:\tnop\n 4c:\tj\t1a0 \n 50:\tnop\n 54:\tsb\tv0,3029(s0)\n 58:\tli\tv0,4\n 5c:\tsb\tv0,3030(s0)\n 60:\tjal\t0 \n 64:\tmove\ta0,s0\n 68:\tmove\ta0,v0\n 6c:\tbeqz\ta0,94 \n 70:\tnop\n 74:\tlbu\tv0,3029(s0)\n 78:\tlw\tv1,2948(s0)\n 7c:\tsb\ta0,3030(s0)\n 80:\tsb\tzero,3031(s0)\n 84:\taddiu\tv0,v0,1\n 88:\tori\tv1,v1,0x8000\n 8c:\tsb\tv0,3029(s0)\n 90:\tsw\tv1,2948(s0)\n 94:\tlbu\ta1,3030(s0)\n 98:\tjal\t0 \n 9c:\tmove\ta0,s0\n a0:\tj\t1a0 \n a4:\tnop\n a8:\tlbu\ta1,3030(s0)\n ac:\tjal\t0 \n b0:\tmove\ta0,s0\n b4:\tbeqz\tv0,18c \n b8:\tli\tv0,23\n bc:\tlbu\tv1,3030(s0)\n c0:\tbne\tv1,v0,dc \n c4:\tli\tv0,25\n c8:\tmove\ta0,s0\n cc:\tjal\t0 \n d0:\tmove\ta1,zero\n d4:\tlbu\tv1,3030(s0)\n d8:\tli\tv0,25\n dc:\tbne\tv1,v0,ec \n e0:\tmove\ta0,s0\n e4:\tjal\t0 \n e8:\tli\ta1,1\n ec:\tlbu\tv1,3030(s0)\n f0:\tli\tv0,21\n f4:\tbne\tv1,v0,110 \n f8:\tli\tv0,19\n fc:\tmove\ta0,s0\n 100:\tjal\t0 \n 104:\tli\ta1,2\n 108:\tlbu\tv1,3030(s0)\n 10c:\tli\tv0,19\n 110:\tbne\tv1,v0,120 \n 114:\tmove\ta0,s0\n 118:\tjal\t0 \n 11c:\tli\ta1,3\n 120:\tlbu\tv0,3029(s0)\n 124:\tlbu\tv1,3030(s0)\n 128:\taddiu\tv0,v0,1\n 12c:\taddiu\tv1,v1,1\n 130:\tsb\tv0,3029(s0)\n 134:\tj\t18c \n 138:\tsb\tv1,3030(s0)\n 13c:\tlbu\ta1,3030(s0)\n 140:\tjal\t0 \n 144:\tmove\ta0,s0\n 148:\tbeqz\tv0,18c \n 14c:\tnop\n 150:\tlbu\tv0,3031(s0)\n 154:\tbeqz\tv0,170 \n 158:\tli\tv0,2\n 15c:\tlbu\tv1,3031(s0)\n 160:\tsb\tv0,3029(s0)\n 164:\tsb\tzero,3031(s0)\n 168:\tj\t1a0 \n 16c:\tsb\tv1,3030(s0)\n 170:\tlui\ta0,0xffff\n 174:\tlw\tv1,2948(s0)\n 178:\tori\ta0,a0,0x7fff\n 17c:\tli\tv0,1\n 180:\tsb\tv0,3029(s0)\n 184:\tand\tv1,v1,a0\n 188:\tsw\tv1,2948(s0)\n 18c:\tjal\t0 \n 190:\tmove\ta0,s0\n 194:\tmove\ta0,v0\n 198:\tbnezl\ta0,1a0 \n 19c:\tsb\ta0,3031(s0)\n 1a0:\tlw\tv1,2948(s0)\n 1a4:\tandi\tv0,v1,0xc000\n 1a8:\tbnez\tv0,1b8 \n 1ac:\tori\tv0,v1,0x1000\n 1b0:\tli\tv0,-4097\n 1b4:\tand\tv0,v1,v0\n 1b8:\tsw\tv0,2948(s0)\n 1bc:\tlw\tra,20(sp)\n 1c0:\tlw\ts0,16(sp)\n 1c4:\tjr\tra\n 1c8:\taddiu\tsp,sp,24\n 1cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-147a74c9aecbaebf/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000001cc func_800B3784_A3634\n00000000 *UND*\t00000000 func_800B36F0_A35A0\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_800B2950_A2800\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000034 R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000060 R_MIPS_26 func_800B36F0_A35A0\n00000098 R_MIPS_26 func_8005D308_5DF08\n000000a0 R_MIPS_26 .text\n000000ac R_MIPS_26 func_8005D308_5DF08\n000000cc R_MIPS_26 func_800B2950_A2800\n000000e4 R_MIPS_26 func_800B2950_A2800\n00000100 R_MIPS_26 func_800B2950_A2800\n00000118 R_MIPS_26 func_800B2950_A2800\n00000134 R_MIPS_26 .text\n00000140 R_MIPS_26 func_8005D308_5DF08\n00000168 R_MIPS_26 .text\n0000018c R_MIPS_26 func_800B36F0_A35A0\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 92040bd5 24020001 308300ff 10620010 ....$...0....b..\n 0020 28620002 50400005 24020002 10600009 (b..P@..$....`..\n 0030 24820001 08000068 00000000 1062001a $......h.....b..\n 0040 24020003 1062003d 00000000 08000068 $....b.=.......h\n 0050 00000000 a2020bd5 24020004 a2020bd6 ........$.......\n 0060 0c000000 02002021 00402021 10800009 ...... !.@ !....\n 0070 00000000 92020bd5 8e030b84 a2040bd6 ................\n 0080 a2000bd7 24420001 34638000 a2020bd5 ....$B..4c......\n 0090 ae030b84 92050bd6 0c000000 02002021 .............. !\n 00a0 08000068 00000000 92050bd6 0c000000 ...h............\n 00b0 02002021 10400035 24020017 92030bd6 .. !.@.5$.......\n 00c0 14620006 24020019 02002021 0c000000 .b..$..... !....\n 00d0 00002821 92030bd6 24020019 14620003 ..(!....$....b..\n 00e0 02002021 0c000000 24050001 92030bd6 .. !....$.......\n 00f0 24020015 14620006 24020013 02002021 $....b..$..... !\n 0100 0c000000 24050002 92030bd6 24020013 ....$.......$...\n 0110 14620003 02002021 0c000000 24050003 .b.... !....$...\n 0120 92020bd5 92030bd6 24420001 24630001 ........$B..$c..\n 0130 a2020bd5 08000063 a2030bd6 92050bd6 .......c........\n 0140 0c000000 02002021 10400010 00000000 ...... !.@......\n 0150 92020bd7 10400006 24020002 92030bd7 .....@..$.......\n 0160 a2020bd5 a2000bd7 08000068 a2030bd6 ...........h....\n 0170 3c04ffff 8e030b84 34847fff 24020001 <.......4...$...\n 0180 a2020bd5 00641824 ae030b84 0c000000 .....d.$........\n 0190 02002021 00402021 54800001 a2040bd7 .. !.@ !T.......\n 01a0 8e030b84 3062c000 14400003 34621000 ....0b...@..4b..\n 01b0 2402efff 00621024 ae020b84 8fbf0014 $....b.$........\n 01c0 8fb00010 03e00008 27bd0018 00000000 ........'.......\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800B3784_A3634\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every 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_800B3784_A3634 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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_800B3F2C_A3DDC:gcc2.7.2kmc","sym":"func_800B3F2C_A3DDC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","switch","bitwise","call","jump-table"],"loc":80,"refSource":"s32 func_800B3F2C_A3DDC(Player *arg0) {\n u32 temp_v0;\n s32 temp_v1;\n s32 temp_v0_2;\n u8 state;\n s32 temp;\n\n temp_v0 = arg0->unkB84;\n temp_v1 = arg0->unk450;\n\n arg0->unk44C = 0;\n arg0->unk454 = 0;\n\n temp_v0 |= 0x60;\n temp_v1 += -0x6000;\n\n arg0->unkB84 = temp_v0;\n arg0->unk450 = temp_v1;\n\n func_800B40D4_A3F84(arg0);\n func_800B02AC_A015C(arg0);\n\n temp = arg0->unkAE0;\n if (!(0xDFFFF < temp)) {\n arg0->unkAE0 = temp + 0x8000;\n }\n\n state = arg0->unkBC0;\n\n switch (state) {\n case 0:\n if (func_8005D308_5DF08(arg0, 0x1E)) {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 1:\n if (func_8005D308_5DF08(arg0, 0x20)) {\n temp_v1 = 0x14;\n temp_v0_2 = arg0->unkBC0;\n arg0->unkB8C = temp_v1;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 2:\n temp_v0_2 = arg0->unkB8C;\n if (temp_v0_2 != 0) {\n temp_v0_2--;\n arg0->unkB8C = temp_v0_2;\n } else {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 3:\n if (func_8005D308_5DF08(arg0, 0x1F)) {\n temp_v0_2 = arg0->unkBC0;\n temp_v0_2++;\n arg0->unkBC0 = temp_v0_2;\n }\n break;\n\n case 4:\n if (func_8005D308_5DF08(arg0, 0x20)) {\n arg0->unkBC0 = 2;\n arg0->unkB8C = 0x14;\n }\n break;\n }\n\n func_8005D804_5E404(arg0, 4, 0);\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/9FF70.c#L1480-L1559","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\tv0,2948(s0)\n 14:\tlw\tv1,1104(s0)\n 18:\tsw\tzero,1100(s0)\n 1c:\tsw\tzero,1108(s0)\n 20:\tori\tv0,v0,0x60\n 24:\taddiu\tv1,v1,-24576\n 28:\tsw\tv0,2948(s0)\n 2c:\tjal\t0 \n 30:\tsw\tv1,1104(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlw\tv1,2784(s0)\n 40:\tlui\tv0,0xd\n 44:\tori\tv0,v0,0xffff\n 48:\tslt\tv0,v0,v1\n 4c:\tbnez\tv0,5c \n 50:\tli\tv0,0x8000\n 54:\taddu\tv0,v1,v0\n 58:\tsw\tv0,2784(s0)\n 5c:\tlbu\tv1,3008(s0)\n 60:\tsltiu\tv0,v1,5\n 64:\tbeqz\tv0,108 \n 68:\tsll\tv0,v1,0x2\n 6c:\tlui\tat,0x0\n 70:\taddu\tat,at,v0\n 74:\tlw\tv0,0(at)\n 78:\tjr\tv0\n 7c:\tnop\n 80:\tmove\ta0,s0\n 84:\tj\tc8 \n 88:\tli\ta1,30\n 8c:\tmove\ta0,s0\n 90:\tjal\t0 \n 94:\tli\ta1,32\n 98:\tbeqz\tv0,108 \n 9c:\tli\tv1,20\n a0:\tlbu\tv0,3008(s0)\n a4:\tj\tdc \n a8:\tsw\tv1,2956(s0)\n ac:\tlw\tv0,2956(s0)\n b0:\tbeqz\tv0,d8 \n b4:\taddiu\tv0,v0,-1\n b8:\tj\t108 \n bc:\tsw\tv0,2956(s0)\n c0:\tmove\ta0,s0\n c4:\tli\ta1,31\n c8:\tjal\t0 \n cc:\tnop\n d0:\tbeqz\tv0,10c \n d4:\tmove\ta0,s0\n d8:\tlbu\tv0,3008(s0)\n dc:\taddiu\tv0,v0,1\n e0:\tj\t108 \n e4:\tsb\tv0,3008(s0)\n e8:\tmove\ta0,s0\n ec:\tjal\t0 \n f0:\tli\ta1,32\n f4:\tbeqz\tv0,108 \n f8:\tli\tv0,2\n fc:\tsb\tv0,3008(s0)\n 100:\tli\tv0,20\n 104:\tsw\tv0,2956(s0)\n 108:\tmove\ta0,s0\n 10c:\tli\ta1,4\n 110:\tjal\t0 \n 114:\tmove\ta2,zero\n 118:\tmove\tv0,zero\n 11c:\tlw\tra,20(sp)\n 120:\tlw\ts0,16(sp)\n 124:\tjr\tra\n 128:\taddiu\tsp,sp,24\n 12c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-a07318e5a62e.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-5f3a093c3f6ff0bb/u.i\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\t0000012c func_800B3F2C_A3DDC\n00000000 *UND*\t00000000 func_800B40D4_A3F84\n00000000 *UND*\t00000000 func_800B02AC_A015C\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_8005D804_5E404\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B40D4_A3F84\n00000034 R_MIPS_26 func_800B02AC_A015C\n0000006c R_MIPS_HI16 .rodata\n00000074 R_MIPS_LO16 .rodata\n00000084 R_MIPS_26 .text\n00000090 R_MIPS_26 func_8005D308_5DF08\n000000a4 R_MIPS_26 .text\n000000b8 R_MIPS_26 .text\n000000c8 R_MIPS_26 func_8005D308_5DF08\n000000e0 R_MIPS_26 .text\n000000ec R_MIPS_26 func_8005D308_5DF08\n00000110 R_MIPS_26 func_8005D804_5E404\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\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e020b84 8e030450 ae00044c ae000454 .......P...L...T\n 0020 34420060 2463a000 ae020b84 0c000000 4B.`$c..........\n 0030 ae030450 0c000000 02002021 8e030ae0 ...P...... !....\n 0040 3c02000d 3442ffff 0043102a 14400003 <...4B...C.*.@..\n 0050 34028000 00621021 ae020ae0 92030bc0 4....b.!........\n 0060 2c620005 10400028 00031080 3c010000 ,b...@.(....<...\n 0070 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0080 02002021 08000032 2405001e 02002021 .. !...2$..... !\n 0090 0c000000 24050020 1040001b 24030014 ....$.. .@..$...\n 00a0 92020bc0 08000037 ae030b8c 8e020b8c .......7........\n 00b0 10400009 2442ffff 08000042 ae020b8c .@..$B.....B....\n 00c0 02002021 2405001f 0c000000 00000000 .. !$...........\n 00d0 1040000e 02002021 92020bc0 24420001 .@.... !....$B..\n 00e0 08000042 a2020bc0 02002021 0c000000 ...B...... !....\n 00f0 24050020 10400004 24020002 a2020bc0 $.. .@..$.......\n 0100 24020014 ae020b8c 02002021 24050004 $......... !$...\n 0110 0c000000 00003021 00001021 8fbf0014 ......0!...!....\n 0120 8fb00010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a001007e 00000000 00000000 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 00000080 0000008c 000000ac 000000c0 ................\n 0010 000000e8 00000000 ........ \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_800B3F2C_A3DDC' — lift: cannot lift 'func_800B3F2C_A3DDC': 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\tv0,2948(s0) */\n/* 14:\tlw\tv1,1104(s0) */\n/* 18:\tsw\tzero,1100(s0) */\n/* 1c:\tsw\tzero,1108(s0) */\n/* 20:\tori\tv0,v0,0x60 */\n/* 24:\taddiu\tv1,v1,-24576 */\n/* 28:\tsw\tv0,2948(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\tsw\tv1,1104(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlw\tv1,2784(s0) */\n/* 40:\tlui\tv0,0xd */\n/* 44:\tori\tv0,v0,0xffff */\n/* 48:\tslt\tv0,v0,v1 */\n/* 4c:\tbnez\tv0,5c */\n/* 50:\tli\tv0,0x8000 */\n/* 54:\taddu\tv0,v1,v0 */\n/* 58:\tsw\tv0,2784(s0) */\n/* 5c:\tlbu\tv1,3008(s0) */\n/* 60:\tsltiu\tv0,v1,5 */\n/* 64:\tbeqz\tv0,108 */\n/* 68:\tsll\tv0,v1,0x2 */\n/* 6c:\tlui\tat,0x0 */\n/* 70:\taddu\tat,at,v0 */\n/* 74:\tlw\tv0,0(at) */\n/* 78:\tjr\tv0 */\n/* 7c:\tnop */\n/* 80:\tmove\ta0,s0 */\n/* 84:\tj\tc8 */\n/* 88:\tli\ta1,30 */\n/* 8c:\tmove\ta0,s0 */\n/* 90:\tjal\t0 */\n/* 94:\tli\ta1,32 */\n/* 98:\tbeqz\tv0,108 */\n/* 9c:\tli\tv1,20 */\n/* a0:\tlbu\tv0,3008(s0) */\n/* a4:\tj\tdc */\n/* a8:\tsw\tv1,2956(s0) */\n/* ac:\tlw\tv0,2956(s0) */\n/* b0:\tbeqz\tv0,d8 */\n/* b4:\taddiu\tv0,v0,-1 */\n/* b8:\tj\t108 */\n/* bc:\tsw\tv0,2956(s0) */\n/* c0:\tmove\ta0,s0 */\n/* c4:\tli\ta1,31 */\n/* c8:\tjal\t0 */\n/* cc:\tnop */\n/* d0:\tbeqz\tv0,10c */\n/* d4:\tmove\ta0,s0 */\n/* d8:\tlbu\tv0,3008(s0) */\n/* dc:\taddiu\tv0,v0,1 */\n/* e0:\tj\t108 */\n/* e4:\tsb\tv0,3008(s0) */\n/* e8:\tmove\ta0,s0 */\n/* ec:\tjal\t0 */\n/* f0:\tli\ta1,32 */\n/* f4:\tbeqz\tv0,108 */\n/* f8:\tli\tv0,2 */\n/* fc:\tsb\tv0,3008(s0) */\n/* 100:\tli\tv0,20 */\n/* 104:\tsw\tv0,2956(s0) */\n/* 108:\tmove\ta0,s0 */\n/* 10c:\tli\ta1,4 */\n/* 110:\tjal\t0 */\n/* 114:\tmove\ta2,zero */\n/* 118:\tmove\tv0,zero */\n/* 11c:\tlw\tra,20(sp) */\n/* 120:\tlw\ts0,16(sp) */\n/* 124:\tjr\tra */\n/* 128:\taddiu\tsp,sp,24 */\n/* 12c:\tnop */\nvoid func_800B3F2C_A3DDC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B3F2C_A3DDC': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":84,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B3F2C_A3DDC': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? func_800B40D4_A3F84(); /* extern */\n\ns32 func_800B3F2C_A3DDC(Player *arg0) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a1;\n u8 temp_v1_2;\n\n arg0->unk44C = 0;\n arg0->unk454 = 0;\n arg0->unkB84 |= 0x60;\n arg0->unk450 -= 0x6000;\n func_800B40D4_A3F84();\n func_800B02AC_A015C(arg0);\n temp_v1 = arg0->unkAE0;\n if (temp_v1 <= 0xDFFFF) {\n arg0->unkAE0 = temp_v1 + 0x8000;\n }\n temp_v1_2 = arg0->unkBC0;\n switch (temp_v1_2) {\n case 0:\n var_a1 = 0x1E;\nblock_10:\n if (func_8005D308_5DF08(arg0, var_a1) != 0) {\nblock_11:\nblock_12:\n arg0->unkBC0 += 1;\n default:\n }\n break;\n case 1:\n if (func_8005D308_5DF08(arg0, 0x20) != 0) {\n arg0->unkB8C = 0x14;\n goto block_12;\n }\n break;\n case 2:\n temp_v0 = arg0->unkB8C;\n if (temp_v0 != 0) {\n arg0->unkB8C = temp_v0 - 1;\n } else {\n goto block_11;\n }\n break;\n case 3:\n var_a1 = 0x1F;\n goto block_10;\n case 4:\n if (func_8005D308_5DF08(arg0, 0x20) != 0) {\n arg0->unkBC0 = 2;\n arg0->unkB8C = 0x14;\n }\n break;\n }\n func_8005D804_5E404(arg0, 4U, 0U);\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":55,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B3F2C_A3DDC` — benchmark function snowboardkids2:func_800B3F2C_A3DDC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's 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_800B3F2C_A3DDC\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$v0, 2948($s0)\n lw\t$v1, 1104($s0)\n sw\t$zero, 1100($s0)\n sw\t$zero, 1108($s0)\n ori\t$v0, $v0, 0x60\n addiu\t$v1, $v1, -24576\n sw\t$v0, 2948($s0)\n jal\tfunc_800B40D4_A3F84\n sw\t$v1, 1104($s0)\n jal\tfunc_800B02AC_A015C\n move\t$a0, $s0\n lw\t$v1, 2784($s0)\n lui\t$v0, 0xd\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .L5c\n li\t$v0, 0x8000\n addu\t$v0, $v1, $v0\n sw\t$v0, 2784($s0)\n.L5c:\n lbu\t$v1, 3008($s0)\n sltiu\t$v0, $v1, 5\n beqz\t$v0, .L108\n sll\t$v0, $v1, 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.L80:\n move\t$a0, $s0\n j\t.Lc8\n li\t$a1, 30\n.L8c:\n move\t$a0, $s0\n jal\tfunc_8005D308_5DF08\n li\t$a1, 32\n beqz\t$v0, .L108\n li\t$v1, 20\n lbu\t$v0, 3008($s0)\n j\t.Ldc\n sw\t$v1, 2956($s0)\n.Lac:\n lw\t$v0, 2956($s0)\n beqz\t$v0, .Ld8\n addiu\t$v0, $v0, -1\n j\t.L108\n sw\t$v0, 2956($s0)\n.Lc0:\n move\t$a0, $s0\n li\t$a1, 31\n.Lc8:\n jal\tfunc_8005D308_5DF08\n nop\n beqz\t$v0, .L10c\n move\t$a0, $s0\n.Ld8:\n lbu\t$v0, 3008($s0)\n.Ldc:\n addiu\t$v0, $v0, 1\n j\t.L108\n sb\t$v0, 3008($s0)\n.Le8:\n move\t$a0, $s0\n jal\tfunc_8005D308_5DF08\n li\t$a1, 32\n beqz\t$v0, .L108\n li\t$v0, 2\n sb\t$v0, 3008($s0)\n li\t$v0, 20\n sw\t$v0, 2956($s0)\n.L108:\n move\t$a0, $s0\n.L10c:\n li\t$a1, 4\n jal\tfunc_8005D804_5E404\n move\t$a2, $zero\n move\t$v0, $zero\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L80\n.word .L8c\n.word .Lac\n.word .Lc0\n.word .Le8\n.word 0x0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\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-a07318e5a62e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_800B3F2C_A3DDC(Player *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B3F2C_A3DDC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B3F2C_A3DDC` — benchmark function snowboardkids2:func_800B3F2C_A3DDC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B3F2C_A3DDC: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\tv0,2948(s0)\n 14:\tlw\tv1,1104(s0)\n 18:\tsw\tzero,1100(s0)\n 1c:\tsw\tzero,1108(s0)\n 20:\tori\tv0,v0,0x60\n 24:\taddiu\tv1,v1,-24576\n 28:\tsw\tv0,2948(s0)\n 2c:\tjal\t0 \n 30:\tsw\tv1,1104(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlw\tv1,2784(s0)\n 40:\tlui\tv0,0xd\n 44:\tori\tv0,v0,0xffff\n 48:\tslt\tv0,v0,v1\n 4c:\tbnez\tv0,5c \n 50:\tli\tv0,0x8000\n 54:\taddu\tv0,v1,v0\n 58:\tsw\tv0,2784(s0)\n 5c:\tlbu\tv1,3008(s0)\n 60:\tsltiu\tv0,v1,5\n 64:\tbeqz\tv0,108 \n 68:\tsll\tv0,v1,0x2\n 6c:\tlui\tat,0x0\n 70:\taddu\tat,at,v0\n 74:\tlw\tv0,0(at)\n 78:\tjr\tv0\n 7c:\tnop\n 80:\tmove\ta0,s0\n 84:\tj\tc8 \n 88:\tli\ta1,30\n 8c:\tmove\ta0,s0\n 90:\tjal\t0 \n 94:\tli\ta1,32\n 98:\tbeqz\tv0,108 \n 9c:\tli\tv1,20\n a0:\tlbu\tv0,3008(s0)\n a4:\tj\tdc \n a8:\tsw\tv1,2956(s0)\n ac:\tlw\tv0,2956(s0)\n b0:\tbeqz\tv0,d8 \n b4:\taddiu\tv0,v0,-1\n b8:\tj\t108 \n bc:\tsw\tv0,2956(s0)\n c0:\tmove\ta0,s0\n c4:\tli\ta1,31\n c8:\tjal\t0 \n cc:\tnop\n d0:\tbeqz\tv0,10c \n d4:\tmove\ta0,s0\n d8:\tlbu\tv0,3008(s0)\n dc:\taddiu\tv0,v0,1\n e0:\tj\t108 \n e4:\tsb\tv0,3008(s0)\n e8:\tmove\ta0,s0\n ec:\tjal\t0 \n f0:\tli\ta1,32\n f4:\tbeqz\tv0,108 \n f8:\tli\tv0,2\n fc:\tsb\tv0,3008(s0)\n 100:\tli\tv0,20\n 104:\tsw\tv0,2956(s0)\n 108:\tmove\ta0,s0\n 10c:\tli\ta1,4\n 110:\tjal\t0 \n 114:\tmove\ta2,zero\n 118:\tmove\tv0,zero\n 11c:\tlw\tra,20(sp)\n 120:\tlw\ts0,16(sp)\n 124:\tjr\tra\n 128:\taddiu\tsp,sp,24\n 12c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\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-5f3a093c3f6ff0bb/u.i\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\t0000012c func_800B3F2C_A3DDC\n00000000 *UND*\t00000000 func_800B40D4_A3F84\n00000000 *UND*\t00000000 func_800B02AC_A015C\n00000000 *UND*\t00000000 func_8005D308_5DF08\n00000000 *UND*\t00000000 func_8005D804_5E404\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B40D4_A3F84\n00000034 R_MIPS_26 func_800B02AC_A015C\n0000006c R_MIPS_HI16 .rodata\n00000074 R_MIPS_LO16 .rodata\n00000084 R_MIPS_26 .text\n00000090 R_MIPS_26 func_8005D308_5DF08\n000000a4 R_MIPS_26 .text\n000000b8 R_MIPS_26 .text\n000000c8 R_MIPS_26 func_8005D308_5DF08\n000000e0 R_MIPS_26 .text\n000000ec R_MIPS_26 func_8005D308_5DF08\n00000110 R_MIPS_26 func_8005D804_5E404\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\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e020b84 8e030450 ae00044c ae000454 .......P...L...T\n 0020 34420060 2463a000 ae020b84 0c000000 4B.`$c..........\n 0030 ae030450 0c000000 02002021 8e030ae0 ...P...... !....\n 0040 3c02000d 3442ffff 0043102a 14400003 <...4B...C.*.@..\n 0050 34028000 00621021 ae020ae0 92030bc0 4....b.!........\n 0060 2c620005 10400028 00031080 3c010000 ,b...@.(....<...\n 0070 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0080 02002021 08000032 2405001e 02002021 .. !...2$..... !\n 0090 0c000000 24050020 1040001b 24030014 ....$.. .@..$...\n 00a0 92020bc0 08000037 ae030b8c 8e020b8c .......7........\n 00b0 10400009 2442ffff 08000042 ae020b8c .@..$B.....B....\n 00c0 02002021 2405001f 0c000000 00000000 .. !$...........\n 00d0 1040000e 02002021 92020bc0 24420001 .@.... !....$B..\n 00e0 08000042 a2020bc0 02002021 0c000000 ...B...... !....\n 00f0 24050020 10400004 24020002 a2020bc0 $.. .@..$.......\n 0100 24020014 ae020b8c 02002021 24050004 $......... !$...\n 0110 0c000000 00003021 00001021 8fbf0014 ......0!...!....\n 0120 8fb00010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a001007e 00000000 00000000 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 00000080 0000008c 000000ac 000000c0 ................\n 0010 000000e8 00000000 ........ \nContents of section .comment:\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_800B3F2C_A3DDC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B4B30_1E1BE0\n addiu\t$sp, $sp, -40\n sw\t$s1, 28($sp)\n move\t$s1, $a1\n sw\t$s2, 32($sp)\n move\t$s2, $a2\n sll\t$a3, $a3, 0x10\n sw\t$s0, 24($sp)\n sra\t$s0, $a3, 0x10\n bgtz\t$s0, .L60\n sw\t$ra, 36($sp)\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80058360_58F60\n move\t$a3, $zero\n j\t.L94\n nop\n.L60:\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sw\t$s0, 16($sp)\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80057DF0_589F0\n move\t$a3, $zero\n.L94:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B4B30_1E1BE0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc","sym":"func_800B5B7C_1E2C2C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":33,"refSource":"void func_800B5B7C_1E2C2C(func_800B5E64_1E2F14_arg0 *arg0, u16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[32]; u16 field_32; u16 field_34; u16 field_36; u16 field_38; u16 field_40; u16 field_42; u16 field_44; u16 field_46; u16 field_48; u16 field_50; s32 field_52; s32 field_56; s32 field_60; s32 field_64; s32 field_68; s32 field_72; s32 field_76; s32 field_80; s32 field_84; u16 field_88; u16 field_90; u16 field_92; u16 field_94; u16 field_96; u16 field_98; s32 field_100; s32 field_104; u16 field_108; u16 field_110; u8 field_112; u8 field_113; };\nvoid 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B5B7C_1E2C2C\n sh\t$zero, 32($a0)\n sh\t$zero, 34($a0)\n sh\t$zero, 36($a0)\n sh\t$zero, 38($a0)\n sh\t$zero, 40($a0)\n sh\t$zero, 42($a0)\n sh\t$zero, 44($a0)\n sh\t$zero, 46($a0)\n sh\t$zero, 48($a0)\n sh\t$zero, 50($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 60($a0)\n sw\t$zero, 64($a0)\n sw\t$zero, 68($a0)\n sw\t$zero, 72($a0)\n sw\t$zero, 76($a0)\n sw\t$zero, 80($a0)\n sw\t$zero, 84($a0)\n sh\t$zero, 88($a0)\n sh\t$zero, 90($a0)\n sh\t$zero, 92($a0)\n sh\t$zero, 94($a0)\n sh\t$zero, 96($a0)\n sh\t$zero, 98($a0)\n sw\t$zero, 100($a0)\n sw\t$zero, 104($a0)\n sh\t$zero, 108($a0)\n sh\t$a1, 110($a0)\n sb\t$zero, 112($a0)\n jr\t$ra\n sb\t$zero, 113($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B5B7C_1E2C2C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc","sym":"func_800B68F4_1E39A4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":8,"refSource":"void func_800B68F4_1E39A4(unk_func_800B68F4_1E39A4 *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B68F4_1E39A4\n sw\t$a1, 96($a0)\n sw\t$a1, 84($a0)\n sw\t$a2, 100($a0)\n sw\t$a2, 88($a0)\n sw\t$a3, 104($a0)\n jr\t$ra\n sw\t$a3, 92($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B68F4_1E39A4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc","sym":"func_800B7620_1E46D0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","union","ternary","shift","bitwise","call","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7620_1E46D0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lw\t$a0, 36($s0)\n sw\t$a1, 148($s0)\n lw\t$a1, 44($s0)\n li\t$v0, 6\n sb\t$v0, 0($s0)\n sh\t$a3, 146($s0)\n sh\t$a2, 132($s0)\n jal\tatan2Fixed\n sh\t$a2, 134($s0)\n sll\t$a0, $v0, 0x10\n sra\t$a0, $a0, 0x10\n addiu\t$a0, $a0, 4096\n andi\t$a0, $a0, 0x1fff\n jal\tapproximateCos\n sw\t$a0, 156($s0)\n sll\t$v1, $v0, 0x2\n bnez\t$v1, .Lb8\n sra\t$v1, $v1, 0x8\n lh\t$a0, 158($s0)\n jal\tapproximateSin\n nop\n lw\t$v1, 36($s0)\n sll\t$v0, $v0, 0x2\n sra\t$v0, $v0, 0x8\n sll\t$v1, $v1, 0x8\n div\t$zero, $v1, $v0\n bnez\t$v0, .L84\n nop\n break\t0x7\n.L84:\n li\t$at, -1\n bne\t$v0, $at, .L9c\n lui\t$at, 0x8000\n bne\t$v1, $at, .L9c\n nop\n break\t0x6\n.L9c:\n mflo\t$v1\n bltzl\t$v1, .Lb0\n negu\t$v1, $v1\n.Lb0:\n j\t.L100\n sw\t$v1, 152($s0)\n.Lb8:\n lw\t$v0, 44($s0)\n sll\t$v0, $v0, 0x8\n div\t$zero, $v0, $v1\n bnez\t$v1, .Ld0\n nop\n break\t0x7\n.Ld0:\n li\t$at, -1\n bne\t$v1, $at, .Le8\n lui\t$at, 0x8000\n bne\t$v0, $at, .Le8\n nop\n break\t0x6\n.Le8:\n mflo\t$v0\n bltzl\t$v0, .Lfc\n negu\t$v0, $v0\n.Lfc:\n sw\t$v0, 152($s0)\n.L100:\n lw\t$v0, 148($s0)\n blez\t$v0, .L118\n nop\n lw\t$v0, 156($s0)\n j\t.L128\n addiu\t$v0, $v0, 2048\n.L118:\n bgez\t$v0, .L130\n nop\n lw\t$v0, 156($s0)\n addiu\t$v0, $v0, -2048\n.L128:\n andi\t$v0, $v0, 0x1fff\n sh\t$v0, 122($s0)\n.L130:\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7620_1E46D0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc","sym":"func_800B7760_1E4810","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7760_1E4810\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n blezl\t$a2, .L54\n sw\t$a1, 84($a0)\n lw\t$v0, 84($a0)\n subu\t$v0, $a1, $v0\n div\t$zero, $v0, $a2\n bnez\t$a2, .L28\n nop\n break\t0x7\n.L28:\n li\t$at, -1\n bne\t$a2, $at, .L40\n lui\t$at, 0x8000\n bne\t$v0, $at, .L40\n nop\n break\t0x6\n.L40:\n mflo\t$v0\n sw\t$a1, 96($a0)\n nop\n j\t.L5c\n sw\t$v0, 108($a0)\n.L54:\n sw\t$a1, 96($a0)\n sw\t$zero, 108($a0)\n.L5c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7760_1E4810 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc","sym":"func_800B93F0_1E64A0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B93F0_1E64A0\n beqzl\t$a0, .L8\n li\t$a0, 1\n.L8:\n lui\t$v0, 0x400\n div\t$zero, $v0, $a0\n bnez\t$a0, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a0, $at, .L34\n lui\t$at, 0x8000\n bne\t$v0, $at, .L34\n nop\n break\t0x6\n.L34:\n mflo\t$a0\n slti\t$v0, $a0, 16384\n nop\n beqzl\t$v0, .L48\n li\t$a0, 16384\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B93F0_1E64A0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc","sym":"func_800B9C20_1E6CD0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call"],"loc":5,"refSource":"void func_800B9C20_1E6CD0(cutsceneSys2Wait_exec_asset *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B9C20_1E6CD0' — lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tlw\ta0,160(s0) */\n/* 18:\tlw\ta0,8(s0) */\n/* 1c:\tjal\t0 */\n/* 20:\tsw\tv0,160(s0) */\n/* 24:\tlw\ta0,12(s0) */\n/* 28:\tjal\t0 */\n/* 2c:\tsw\tv0,8(s0) */\n/* 30:\tsw\tv0,12(s0) */\n/* 34:\tlw\tra,20(sp) */\n/* 38:\tlw\ts0,16(sp) */\n/* 3c:\tjr\tra */\n/* 40:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800B9C20_1E6CD0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 freeNodeMemory(s32); /* extern */\n\nvoid func_800B9C20_1E6CD0(void *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3410: request for member `unkA0' in something not a structure or union","/c.i:3411: request for member `unk8' in something not a structure or union","/c.i:3412: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B9C20_1E6CD0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n jal\tfreeNodeMemory\n lw\t$a0, 160($s0)\n lw\t$a0, 8($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 160($s0)\n lw\t$a0, 12($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 8($s0)\n sw\t$v0, 12($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B9C20_1E6CD0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:GenericTriggerInit:gcc2.7.2kmc","sym":"GenericTriggerInit","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","global","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GenericTriggerInit\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n lbu\t$v1, 0($a0)\n li\t$v0, -104\n sb\t$zero, 1($a0)\n sh\t$zero, 4($a0)\n sh\t$v0, 6($a0)\n sh\t$zero, 8($a0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_8008D714_8E314)\n addiu\t$v1, $v1, %lo(D_8008D714_8E314)\n addu\t$v0, $v0, $v1\n sw\t$v0, 12($a0)\n lui\t$a0, %hi(GenericTriggerCheck)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(GenericTriggerCheck)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GenericTriggerInit(EventTrigger *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GenericTriggerInit # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc","sym":"getTableEntryByU16Index","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","field","pointer","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel getTableEntryByU16Index\n lw\t$v1, 4($a0)\n addiu\t$a3, $a0, 8\n andi\t$a1, $a1, 0xffff\n sll\t$a1, $a1, 0x4\n sll\t$v1, $v1, 0x4\n addu\t$v1, $a3, $v1\n addu\t$a3, $a3, $a1\n lw\t$v0, 0($a3)\n addu\t$a0, $a0, $v0\n sw\t$a0, 0($a2)\n lhu\t$v0, 4($a3)\n sll\t$v0, $v0, 0x5\n addu\t$v1, $v1, $v0\n sw\t$v1, 4($a2)\n lhu\t$v0, 6($a3)\n sh\t$v0, 8($a2)\n lhu\t$v0, 8($a3)\n jr\t$ra\n sh\t$v0, 10($a2)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function getTableEntryByU16Index # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc","sym":"initSteppedMatrixController","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","memory","global","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel initSteppedMatrixController\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n addiu\t$a0, $s0, 4\n lui\t$a1, %hi(identityMatrix)\n addiu\t$a1, $a1, %lo(identityMatrix)\n sw\t$ra, 20($sp)\n jal\tmemcpy\n li\t$a2, 32\n lui\t$a0, %hi(cleanupSteppedMatrixController)\n addiu\t$a0, $a0, %lo(cleanupSteppedMatrixController)\n sh\t$zero, 36($s0)\n jal\tsetCleanupCallback\n sh\t$zero, 40($s0)\n lui\t$a0, %hi(updateSteppedMatrixController)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(updateSteppedMatrixController)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid initSteppedMatrixController(SteppedMatrixState *state);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function initSteppedMatrixController # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc","sym":"loadAssetGroupResources","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","loop","call","strength-reduce"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadAssetGroupResources\n addiu\t$sp, $sp, -48\n sw\t$s3, 36($sp)\n move\t$s3, $a0\n sw\t$ra, 40($sp)\n sw\t$s2, 32($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v1, 196($s3)\n sll\t$v0, $v1, 0x1\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(assetGroupTable)\n addiu\t$v1, $v1, %lo(assetGroupTable)\n addu\t$s2, $v0, $v1\n lw\t$s0, 0($s2)\n lui\t$a0, %hi(freeAssetGroupResources)\n addiu\t$a0, $a0, %lo(freeAssetGroupResources)\n jal\tsetCleanupCallback\n move\t$s1, $zero\n sw\t$zero, 16($s3)\n sw\t$zero, 12($s3)\n lbu\t$a0, 8($s2)\n jal\tallocateNodeMemory\n sll\t$a0, $a0, 0x2\n sw\t$v0, 4($s3)\n lbu\t$v0, 8($s2)\n blez\t$v0, .La8\n nop\n.L70:\n lw\t$a0, 0($s0)\n lw\t$a1, 4($s0)\n lw\t$a2, 8($s0)\n jal\tloadCompressedData\n addiu\t$s0, $s0, 12\n lw\t$v1, 4($s3)\n sll\t$a0, $s1, 0x2\n addu\t$a0, $a0, $v1\n sw\t$v0, 0($a0)\n lbu\t$v0, 8($s2)\n addiu\t$s1, $s1, 1\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L70\n nop\n.La8:\n lui\t$a0, %hi(func_80003184_3D84)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80003184_3D84)\n lw\t$ra, 40($sp)\n lw\t$s3, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 48\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid loadAssetGroupResources(AssetGroupTaskData *taskData);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadAssetGroupResources # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:agbcc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 absdiff(u32 a0, u32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r2 = arg0 - arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","array","loop"],"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":"signed","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, s32 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 v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = (u32)(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 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":107,"maxScore":115,"compileErrors":null,"breakdown":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23},"quality":{"score":100,"lines":31,"gotos":0,"casts":1,"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":107,"maxScore":115,"ratio":0.9304347826086956,"kinds":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n return (s32)((a0 + a1 >> 31) + (a0 + a1)) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r3;\n\n temp_r3 = arg0 + arg1;\n return (s32) ((temp_r3 >> 0x1FU) + temp_r3) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i= 0; v0 = v0 + 1) {\n v1 = v1 + 1;\n }\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":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r3;\n\n var_r2 = arg0;\n var_r3 = 0;\nloop_2:\n if ((var_r3 < arg1) && ((s32) *var_r2 >= 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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["break","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["multi-arg","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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) 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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":"match","source":"s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 >= 256) {\n return 255;\n } else {\n return a0;\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 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["continue","memory","loop"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if ((u32)*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(u32 *arg0, s32 arg1) {\n s32 var_ctr;\n s32 var_r5;\n u32 *var_r3;\n u32 temp_r4;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r4 = *var_r3;\n if ((temp_r4 >> 0x1FU) == 0) {\n var_r5 += temp_r4;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countdown(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if ((u32)a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = (u32)a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n","score":24,"maxScore":27,"compileErrors":null,"breakdown":{"insert":12,"delete":1,"replace":4,"opMismatch":4,"argMismatch":3},"quality":{"score":100,"lines":41,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_ctr_2;\n s32 var_r3;\n s32 var_r4;\n u32 temp_r0;\n u32 var_ctr;\n\n var_r3 = arg0;\n var_r4 = 0;\n if (var_r3 > 0) {\n temp_r0 = (u32) var_r3 >> 3U;\n var_ctr = temp_r0;\n if (temp_r0 != 0) {\n do {\n var_r4 += 8;\n var_ctr -= 1;\n } while (var_ctr != 0);\n var_r3 &= 7;\n if (var_r3 != 0) {\n goto block_4;\n }\n } else {\nblock_4:\n var_ctr_2 = var_r3;\n do {\n var_r4 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r4;\n}\n","score":6,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0},"quality":{"score":88,"lines":31,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":16,"ratio":0.375,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["method"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = (s32)a0 >> 1;\n } else {\n v0 = (s32)(a0 + 1) >> 1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(s32 arg0) {\n return arg0 / 2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-pow2","signed"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n return (s32)((a0 >> 31) + a0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1FU) + arg0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","signed","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","arithmetic","loop","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["do-while","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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/defsite","outcome":"match","source":"s32 fcmp(void) {\n s32 v0;\n v0 = 0;\n if (__gtsf2() > 0) v0 = 1;\n return v0;\n}\n","score":0,"maxScore":10,"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":"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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":"signed","outcome":"nonmatch","source":"s32 fib(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 t0;\n s32 t1;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = 1;\n v2 = 0;\n v3 = (u32)(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 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":122,"maxScore":127,"compileErrors":null,"breakdown":{"insert":94,"delete":4,"replace":3,"opMismatch":5,"argMismatch":16},"quality":{"score":100,"lines":37,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mod-reg","loop","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch","branchless"],"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 & a2 >= a0;\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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":"unsigned","outcome":"nonmatch","source":"s32 inrange(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (a0 < a1) {\n v0 = a0 >= a1;\n } else {\n v0 = a2 >= a0;\n }\n return v0;\n}\n","score":9,"maxScore":10,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":4,"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":"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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/defsite","outcome":"match","source":"s32 iszero(u32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 == 0) v0 = 1;\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":6,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a a0) {\n return 1;\n } else {\n v0 = 0;\n return v0;\n }\n } else {\n return 1;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":13,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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/flip-branch","outcome":"nonmatch","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n s32 v1;\n if (a0 < a2) {\n return 1;\n } else {\n if (a2 != a0 || a1 >= a3) {\n v1 = 0;\n return v1;\n } else {\n return 1;\n }\n }\n}\n","score":10,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":6,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","compare","branchless"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","signed","shift","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["int64","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["branch","memory","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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/defsite","outcome":"match","source":"s32 lor(u32 a0, u32 a1) {\n s32 v0;\n v0 = 0;\n if (a0 != 0 || a1 != 0) v0 = 1;\n return v0;\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}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","branch"],"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 && a1 == 0) {\n return 0;\n } else {\n return 1;\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"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 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":4,"maxScore":9,"ratio":0.4444444444444444,"kinds":{"insert":2,"delete":1,"replace":0,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","branch","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","load","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","load","loop"],"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 v0 = 0;\n for (v1 = (u32)(a2 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n 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":79,"maxScore":88,"compileErrors":null,"breakdown":{"insert":45,"delete":4,"replace":3,"opMismatch":4,"argMismatch":23},"quality":{"score":80,"lines":37,"gotos":0,"casts":19,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r8;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *temp_r7;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r0_2;\n\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r6 = arg2 - 8;\n if (arg2 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg1[var_r8];\n temp_r7 = &arg0[var_r8];\n temp_r0 = temp_r6_2->unk0;\n var_r8 += 8;\n temp_r7->unk0 = temp_r0;\n temp_r7->unk1 = (u8) temp_r6_2->unk1;\n temp_r7->unk2 = (u8) temp_r6_2->unk2;\n temp_r7->unk3 = (u8) temp_r6_2->unk3;\n temp_r7->unk4 = (u8) temp_r6_2->unk4;\n temp_r7->unk5 = (u8) temp_r6_2->unk5;\n temp_r7->unk6 = (u8) temp_r6_2->unk6;\n temp_r7->unk7 = (u8) temp_r6_2->unk7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = &arg1[var_r8];\n var_r3 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r0_2 = *var_r4;\n var_r4 += 1;\n *var_r3 = temp_r0_2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":9,"quality":{"score":88,"lines":48,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":{"decompiler":"asmlift","score":79,"maxScore":88,"ratio":0.8977272727272727,"kinds":{"insert":45,"delete":4,"replace":3,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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":"asmlift","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 v0 = 0;\n for (v1 = (u32)(a1 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n 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":71,"maxScore":78,"compileErrors":null,"breakdown":{"insert":47,"delete":4,"replace":3,"opMismatch":4,"argMismatch":13},"quality":{"score":84,"lines":34,"gotos":0,"casts":10,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r7;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *var_r3;\n\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r6 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg0[var_r7];\n var_r7 += 8;\n temp_r6_2->unk0 = arg2;\n temp_r6_2->unk1 = arg2;\n temp_r6_2->unk2 = arg2;\n temp_r6_2->unk3 = arg2;\n temp_r6_2->unk4 = arg2;\n temp_r6_2->unk5 = arg2;\n temp_r6_2->unk6 = arg2;\n temp_r6_2->unk7 = arg2;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = &arg0[var_r7];\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n *var_r3 = arg2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":8,"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":{"decompiler":"asmlift","score":71,"maxScore":78,"ratio":0.9102564102564102,"kinds":{"insert":47,"delete":4,"replace":3,"opMismatch":4,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["mask","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","signed","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 || (a0 & 15) == 0) {\n v0 = a0 & 15;\n } else {\n v0 = (a0 & 15) + -16;\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":9,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-pow2","signed"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = (u32)(a0 + -8 + 7) >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n 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":139,"maxScore":148,"compileErrors":null,"breakdown":{"insert":86,"delete":7,"replace":5,"opMismatch":5,"argMismatch":36},"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_r0;\n s32 temp_r12;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r5;\n s32 temp_r6;\n s32 temp_r7;\n s32 temp_r8;\n s32 var_ctr_2;\n s32 var_r10;\n s32 var_r11;\n s32 var_r12;\n s32 var_r30;\n s32 var_r31;\n s32 var_r4;\n u32 var_ctr;\n\n var_r12 = 0;\n var_r11 = 0;\n var_r31 = 0;\nloop_8:\n if (var_r31 < arg0) {\n var_r30 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_r10 = 0;\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r7 = var_r30 + 3;\n temp_r6 = var_r30 + 4;\n temp_r5 = var_r30 + 5;\n temp_r4_2 = var_r30 + 6;\n temp_r0 = var_r30 + 7;\n temp_r12 = var_r12 + var_r10 + (var_r31 * (var_r30 + 1));\n temp_r8 = var_r31 * (var_r30 + 2);\n var_r10 += var_r11;\n var_r30 += 8;\n var_r12 = temp_r12 + temp_r8 + (var_r31 * temp_r7) + (var_r31 * temp_r6) + (var_r31 * temp_r5) + (var_r31 * temp_r4_2) + (var_r31 * temp_r0);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = var_r30 * var_r31;\n var_ctr_2 = arg0 - var_r30;\n if (var_r30 < arg0) {\n do {\n var_r12 += var_r4;\n var_r4 += var_r31;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n var_r11 += 8;\n var_r31 += 1;\n goto loop_8;\n }\n return var_r12;\n}\n","score":63,"maxScore":74,"compileErrors":null,"breakdown":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34},"quality":{"score":88,"lines":60,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":74,"ratio":0.8513513513513513,"kinds":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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/defsite","outcome":"match","source":"s32 notb(u32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 == 0) v0 = 1;\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":6,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","loop"],"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":"signed","outcome":"nonmatch","source":"s32 powi(s32 a0, s32 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 v0 = 1;\n v1 = 0;\n for (v2 = (u32)(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 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":81,"maxScore":87,"compileErrors":null,"breakdown":{"insert":57,"delete":4,"replace":3,"opMismatch":5,"argMismatch":12},"quality":{"score":100,"lines":23,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","store","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["rotate","shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["signed","shift"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n return arg0 >> 0x1F;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":8,"ratio":0.75,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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/defsite","outcome":"match","source":"s32 signum(s32 a0) {\n s32 v0;\n v0 = 0;\n if (a0 > 0) v0 = 1;\n return v0 - ((u32)a0 >> 31);\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":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 > 0) {\n var_r1 = 1;\n }\n return var_r1 - ((u32) arg0 >> 0x1F);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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","candidateLabel":"unsigned","outcome":"match","source":"s32 strcmp1(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a0;\n for (v1 = a1; *v0 != 0 && *v0 == *v1; v1 = v1 + 1) {\n v0 = v0 + 1;\n }\n return *v0 - *v1;\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":"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":null,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","pointer","compare","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","compare","loop"],"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","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 strcmp1(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a0;\n for (v1 = a1; (s8)*v0 != 0 && (s8)*v0 == (s8)*v1; v1 = v1 + 1) {\n v0 = v0 + 1;\n }\n return (s8)*v0 - (s8)*v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":94,"lines":9,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"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":"asmlift","score":8,"maxScore":16,"ratio":0.5,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":6}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","pointer","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["struct","memory","array","loop"],"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":"signed","outcome":"nonmatch","source":"s32 structarr(s32 * a0, s32 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 v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = (u32)(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 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":107,"maxScore":115,"compileErrors":null,"breakdown":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23},"quality":{"score":100,"lines":31,"gotos":0,"casts":1,"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":107,"maxScore":115,"ratio":0.9304347826086956,"kinds":{"insert":71,"delete":3,"replace":6,"opMismatch":4,"argMismatch":23}},"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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":"signed","outcome":"nonmatch","source":"s32 sumto(s32 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 v0 = 0;\n v1 = 0;\n for (v2 = (u32)(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 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":97,"maxScore":105,"compileErrors":null,"breakdown":{"insert":67,"delete":4,"replace":3,"opMismatch":5,"argMismatch":18},"quality":{"score":100,"lines":26,"gotos":0,"casts":1,"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["fallthrough","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["dense","switch","jump-table"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["arithmetic","switch","bitwise","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["sparse","switch","comparison-tree"],"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) {\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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["sparse","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["memory","switch","comparison-tree"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["shift","bitwise"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:ubyte:agbcc","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[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\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tubyte\n\t.type\t ubyte,function\n\t.thumb_func\nubyte:\n\tstr\tr1, [r0]\n\tadd\tr0, r0, r2\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t ubyte,.Lfe1-ubyte\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ubyte # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:gcc2.7.2kmc","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\taddu\ta0,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8850789e15b071c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00862021 03e00008 90820000 ...... !........\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":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":4,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":4,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":5,"ratio":0.8,"kinds":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n sw\t$a1, 0($a0)\n addu\t$a0, $a0, $a2\n jr\t$ra\n lbu\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 ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\taddu\ta0,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(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-8850789e15b071c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00862021 03e00008 90820000 ...... !........\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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:ido7.1","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\taddu\tt6,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(t6)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00867021 03e00008 91c20000 ......p!........\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 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 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 65662d38 38353037 38396531 35623037 ef-8850789e15b07\n 0130 3163382f 7265662e 63007562 79746500 1c8/ref.c.ubyte.\n 0140 75627974 65000000 00000000 00000001 ubyte...........\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 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n sw\t$a1, 0($a0)\n addu\t$t6, $a0, $a2\n jr\t$ra\n lbu\t$v0, 0($t6)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\taddu\tt6,a0,a2\n 8:\tjr\tra\n c:\tlbu\tv0,0(t6)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > 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 ubyte\n\n\nContents of section .text:\n 0000 ac850000 00867021 03e00008 91c20000 ......p!........\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 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 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 65662d38 38353037 38396531 35623037 ef-8850789e15b07\n 0130 3163382f 7265662e 63007562 79746500 1c8/ref.c.ubyte.\n 0140 75627974 65000000 00000000 00000001 ubyte...........\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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ubyte:mwcc_242_81","sym":"ubyte","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","variable-index","mixed-width"],"loc":2,"refSource":"union B{u32 w;u8 b[4];};\nu32 ubyte(union B*u,u32 v,int i){ u->w=v; return u->b[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tlbzx 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 ubyte\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ubyte\n\n\nContents of section .text:\n 0000 90830000 7c6328ae 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":"nonmatch","source":"s32 ubyte(s32 * a0, u32 a1, u32 a2) {\n *a0 = a1;\n return *(u8 *)(a0 + a2);\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":96,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 ubyte(s32 *arg0, s32 arg1, s32 arg2) {\n *arg0 = arg1;\n return *(arg0 + arg2);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ubyte` — benchmark function synthetic:ubyte:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ubyte\n stw r4,0(r3)\n lbzx 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 ubyte # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ubyte` — benchmark function synthetic:ubyte:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ubyte:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlbzx 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 ubyte\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ubyte\n\n\nContents of section .text:\n 0000 90830000 7c6328ae 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 ubyte # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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","div-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","unsigned","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","magic-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","div-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","div-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","hw-div"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:uhalf:agbcc","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[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\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — 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\tuhalf */\n/* \t.type\t uhalf,function */\n/* \t.thumb_func */\n/* uhalf: */\n/* \tstr\tr1, [r0] */\n/* \tldrh\tr1, [r0] */\n/* \tldrh\tr0, [r0, #0x2] */\n/* \tadd\tr1, r1, r0 */\n/* \tadd\tr0, r1, #0 */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t uhalf,.Lfe1-uhalf */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk0' in something not a structure or union","/cand.c.pp.c:4: warning: dereferencing `void *' pointer","/cand.c.pp.c:4: request for member `unk0' in something not a structure or union","/cand.c.pp.c:4: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tuhalf\n\t.type\t uhalf,function\n\t.thumb_func\nuhalf:\n\tstr\tr1, [r0]\n\tldrh\tr1, [r0]\n\tldrh\tr0, [r0, #0x2]\n\tadd\tr1, r1, r0\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t uhalf,.Lfe1-uhalf\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name uhalf # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:gcc2.7.2kmc","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tlhu\tv1,0(a0)\n 8:\tlhu\tv0,2(a0)\n c:\tjr\tra\n 10:\taddu\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-33a95dfb4711bdfb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 94830000 94820002 03e00008 ................\n 0010 00621021 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 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,0(a0) */\n/* 4:\tlhu\tv1,0(a0) */\n/* 8:\tlhu\tv0,2(a0) */\n/* c:\tjr\tra */\n/* 10:\taddu\tv0,v1,v0 */\n/* \t... */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk0' in something not a structure or union","/cand.c:4: request for member `unk0' in something not a structure or union","/cand.c:4: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n sw\t$a1, 0($a0)\n lhu\t$v1, 0($a0)\n lhu\t$v0, 2($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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhu\tv1,0(a0)\n 8:\tlhu\tv0,2(a0)\n c:\tjr\tra\n 10:\taddu\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-33a95dfb4711bdfb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 94830000 94820002 03e00008 ................\n 0010 00621021 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# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:ido7.1","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tlhu\tt7,0(a0)\n 8:\tlhu\tt6,2(a0)\n c:\tjr\tra\n 10:\taddu\tv0,t6,t7\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 uhalf\n\n\nContents of section .text:\n 0000 ac850000 948f0000 948e0002 03e00008 ................\n 0010 01cf1021 00000000 00000000 00000000 ...!............\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 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 00000003 ................\n 0090 00000003 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 65662d33 33613935 64666234 37313162 ef-33a95dfb4711b\n 0130 6466622f 7265662e 63007568 616c6600 dfb/ref.c.uhalf.\n 0140 7568616c 66000000 00000000 00000001 uhalf...........\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":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,0(a0) */\n/* 4:\tlhu\tt7,0(a0) */\n/* 8:\tlhu\tt6,2(a0) */\n/* c:\tjr\tra */\n/* 10:\taddu\tv0,t6,t7 */\n/* \t... */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return arg0->unk2 + (u16) arg0->unk0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 4: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n sw\t$a1, 0($a0)\n lhu\t$t7, 0($a0)\n lhu\t$t6, 2($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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhu\tt7,0(a0)\n 8:\tlhu\tt6,2(a0)\n c:\tjr\tra\n 10:\taddu\tv0,t6,t7\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark 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 uhalf\n\n\nContents of section .text:\n 0000 ac850000 948f0000 948e0002 03e00008 ................\n 0010 01cf1021 00000000 00000000 00000000 ...!............\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 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 00000003 ................\n 0090 00000003 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 65662d33 33613935 64666234 37313162 ef-33a95dfb4711b\n 0130 6466622f 7265662e 63007568 616c6600 dfb/ref.c.uhalf.\n 0140 7568616c 66000000 00000000 00000001 uhalf...........\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 uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:uhalf:mwcc_242_81","sym":"uhalf","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","mixed-width"],"loc":2,"refSource":"union W{u32 w;u16 h[2];};\nu32 uhalf(union W*u,u32 v){ u->w=v; return u->h[0]+u->h[1]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tlhz r4,0(r3)\n 8:\tlhz r0,2(r3)\n c:\tadd r3,r4,r0\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 uhalf\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 uhalf\n\n\nContents of section .text:\n 0000 90830000 a0830000 a0030002 7c640214 ............|d..\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":"declined","source":"/* asmlift could not decompile 'uhalf' — raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstw r4,0(r3) */\n/* 4:\tlhz r4,0(r3) */\n/* 8:\tlhz r0,2(r3) */\n/* c:\tadd r3,r4,r0 */\n/* 10:\tblr */\nvoid uhalf(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":13,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 0 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 uhalf(void *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n return (u16) arg0->unk0 + arg0->unk2;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `uhalf` — benchmark function synthetic:uhalf:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel uhalf\n stw r4,0(r3)\n lhz r4,0(r3)\n lhz r0,2(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 uhalf # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `uhalf` — benchmark function synthetic:uhalf:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:uhalf:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tlhz r4,0(r3)\n 8:\tlhz r0,2(r3)\n c:\tadd r3,r4,r0\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 uhalf\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 uhalf\n\n\nContents of section .text:\n 0000 90830000 a0830000 a0030002 7c640214 ............|d..\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 uhalf # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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","mod-const","unsigned","soft-div","call"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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","mod-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","unsigned","hw-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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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","mod-const","unsigned","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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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:upun:agbcc","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\n","ctx":"u32 upun(float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 upun(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":"declined","source":"u32 upun(f32 arg0) {\n return (bitwise u32) arg0;\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 bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\nASM_INPUT\n\n# The exact 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 upun(float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tupun\n\t.type\t upun,function\n\t.thumb_func\nupun:\n\tbx\tlr\n.Lfe1:\n\t.size\t upun,.Lfe1-upun\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name upun # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:gcc2.7.2kmc","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmfc1\tv0,$f12\n 4:\tjr\tra\n 8:\tnop\n c:\tnop\n","ctx":"u32 upun(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9f1339ba3a5a98ca/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 upun\n\n\nContents of section .text:\n 0000 44026000 03e00008 00000000 00000000 D.`.............\nContents of section .reginfo:\n 0000 80000004 00000000 00001000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 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":"s32 upun(void) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'mfc1'\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'mfc1'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 arg0) {\n return (bitwise u32) arg0;\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 bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n mfc1\t$v0, $f12\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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmfc1\tv0,$f12\n 4:\tjr\tra\n 8:\tnop\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-9f1339ba3a5a98ca/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 upun\n\n\nContents of section .text:\n 0000 44026000 03e00008 00000000 00000000 D.`.............\nContents of section .reginfo:\n 0000 80000004 00000000 00001000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:ido7.1","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tswc1\t$f12,4(sp)\n 8:\tlw\tv0,4(sp)\n c:\tjr\tra\n 10:\taddiu\tsp,sp,8\n\t...\n","ctx":"u32 upun(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 upun\n\n\nContents of section .text:\n 0000 27bdfff8 e7ac0004 8fa20004 03e00008 '...............\n 0010 27bd0008 00000000 00000000 00000000 '...............\nContents of section .options:\n 0000 01200000 00000000 a0000004 00000000 . ..............\n 0010 00001000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000004 00000000 00001000 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 00000008 001d001f 00000003 ................\n 0090 00000003 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 66313333 39626133 61356139 ef-9f1339ba3a5a9\n 0130 3863612f 7265662e 63007570 756e0000 8ca/ref.c.upun..\n 0140 7570756e 00000000 00000000 00000001 upun............\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 'upun' — lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque */\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:\tswc1\t$f12,4(sp) */\n/* 8:\tlw\tv0,4(sp) */\n/* c:\tjr\tra */\n/* 10:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid upun(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":14,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'swc1' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 arg0) {\n f32 sp4;\n\n sp4 = arg0;\n return (bitwise u32) sp4;\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":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n addiu\t$sp, $sp, -8\n swc1\t$f12, 4($sp)\n lw\t$v0, 4($sp)\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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > 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:\tswc1\t$f12,4(sp)\n 8:\tlw\tv0,4(sp)\n c:\tjr\tra\n 10:\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 d .text\t00000020 .text\n00000000 g F .text\t00000014 upun\n\n\nContents of section .text:\n 0000 27bdfff8 e7ac0004 8fa20004 03e00008 '...............\n 0010 27bd0008 00000000 00000000 00000000 '...............\nContents of section .options:\n 0000 01200000 00000000 a0000004 00000000 . ..............\n 0010 00001000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000004 00000000 00001000 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 00000008 001d001f 00000003 ................\n 0090 00000003 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 66313333 39626133 61356139 ef-9f1339ba3a5a9\n 0130 3863612f 7265662e 63007570 756e0000 8ca/ref.c.upun..\n 0140 7570756e 00000000 00000000 00000001 upun............\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 upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:upun:mwcc_242_81","sym":"upun","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","float"],"loc":2,"refSource":"union F{float f;u32 u;};\nu32 upun(float x){ union F t; t.f=x; return t.u; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tstfs f1,8(r1)\n 8:\tlwz r3,8(r1)\n c:\taddi r1,r1,16\n 10:\tblr\n","ctx":"u32 upun(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\t00000014 upun\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 upun\n\n\nContents of section .text:\n 0000 9421fff0 d0210008 80610008 38210010 .!...!...a..8!..\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":"declined","source":"/* asmlift could not decompile 'upun' — lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque */\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:\tstfs f1,8(r1) */\n/* 8:\tlwz r3,8(r1) */\n/* c:\taddi r1,r1,16 */\n/* 10:\tblr */\nvoid upun(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":13,"gotos":0,"casts":1,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'upun @0x4': unmodelled store-class instruction 'stfs' — a memory write cannot be skipped or degraded to a register opaque"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 upun(f32 farg0) {\n f32 sp8;\n\n sp8 = farg0;\n return (bitwise u32) sp8;\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":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `upun` — benchmark function synthetic:upun:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel upun\n stwu r1,-16(r1)\n stfs f1,8(r1)\n lwz r3,8(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'\nu32 upun(float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function upun # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `upun` — benchmark function synthetic:upun:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:upun:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tstfs f1,8(r1)\n 8:\tlwz r3,8(r1)\n c:\taddi r1,r1,16\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 upun\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 upun\n\n\nContents of section .text:\n 0000 9421fff0 d0210008 80610008 38210010 .!...!...a..8!..\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 upun # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:agbcc","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=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\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\n return;\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":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_r1;\n\n temp_r1 = (arg1 * 4) + arg0;\n *temp_r1 = arg2;\n *temp_r1 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `union E' 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:4: arithmetic on pointer to an incomplete type","/cand.c.pp.c:4: warning: assignment from incompatible pointer type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tustore\n\t.type\t ustore,function\n\t.thumb_func\nustore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tmov\tr0, #0x0\n\tstrh\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t ustore,.Lfe1-ustore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:gcc2.7.2kmc","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","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:\tsw\ta2,0(a1)\n c:\tjr\tra\n 10:\tsh\tzero,0(a1)\n\t...\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c4770bb02162926/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ustore\n\n\nContents of section .text:\n 0000 00052880 00a42821 aca60000 03e00008 ..(...(!........\n 0010 a4a00000 00000000 00000000 00000000 ................\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":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\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":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_a1;\n\n temp_a1 = (arg1 * 4) + arg0;\n *temp_a1 = arg2;\n *temp_a1 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:5: arithmetic on pointer to an incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n sw\t$a2, 0($a1)\n jr\t$ra\n sh\t$zero, 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'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tsw\ta2,0(a1)\n c:\tjr\tra\n 10:\tsh\tzero,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-0c4770bb02162926/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 ustore\n\n\nContents of section .text:\n 0000 00052880 00a42821 aca60000 03e00008 ..(...(!........\n 0010 a4a00000 00000000 00000000 00000000 ................\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 \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:ido7.1","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tv0,a0,t6\n 8:\tsw\ta2,0(v0)\n c:\tjr\tra\n 10:\tsh\tzero,0(v0)\n\t...\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 ustore\n\n\nContents of section .text:\n 0000 00057080 008e1021 ac460000 03e00008 ..p....!.F......\n 0010 a4400000 00000000 00000000 00000000 .@..............\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 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 00000003 ................\n 0090 00000003 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 63343737 30626230 32313632 ef-0c4770bb02162\n 0130 3932362f 7265662e 63007573 746f7265 926/ref.c.ustore\n 0140 00000000 7573746f 72650000 00000000 ....ustore......\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":"nonmatch","source":"void ustore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n *(u16 *)(a0 + (a1 << 2)) = 0;\n return;\n}\n","score":5,"maxScore":7,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":96,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 *temp_v0;\n\n temp_v0 = arg0 + (arg1 * 4);\n *temp_v0 = arg2;\n *temp_v0 = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 5: Unacceptable operand of '+'."]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":7,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n sll\t$t6, $a1, 0x2\n addu\t$v0, $a0, $t6\n sw\t$a2, 0($v0)\n jr\t$ra\n sh\t$zero, 0($v0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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\tv0,a0,t6\n 8:\tsw\ta2,0(v0)\n c:\tjr\tra\n 10:\tsh\tzero,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\t00000020 .text\n00000000 g F .text\t00000014 ustore\n\n\nContents of section .text:\n 0000 00057080 008e1021 ac460000 03e00008 ..p....!.F......\n 0010 a4400000 00000000 00000000 00000000 .@..............\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 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 00000003 ................\n 0090 00000003 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 63343737 30626230 32313632 ef-0c4770bb02162\n 0130 3932362f 7265662e 63007573 746f7265 926/ref.c.ustore\n 0140 00000000 7573746f 72650000 00000000 ....ustore......\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# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ustore:mwcc_242_81","sym":"ustore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","field","array","store","mixed-width"],"loc":2,"refSource":"union E{s32 a;u16 b[2];};\nvoid ustore(union E*e,int i,s32 v){ e[i].a=v; e[i].b[0]=0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r4,r4,2\n 4:\tli r0,0\n 8:\tstwx r5,r3,r4\n c:\tsthx r0,r3,r4\n 10:\tblr\n","ctx":"union E; void ustore(union E*,int,s32);","proto":{"ustore":{"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 ustore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ustore\n\n\nContents of section .text:\n 0000 5484103a 38000000 7ca3212e 7c03232e T..:8...|.!.|.#.\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":"struct Elem0 { u16 field_0; u8 _pad0[2]; };\nvoid ustore(struct Elem0 * a0, u32 a1, u32 a2) {\n ((s32 *)a0)[a1] = a2;\n a0[a1].field_0 = 0;\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":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ustore(union E *arg0, s32 arg1, s32 arg2) {\n s32 temp_r4;\n\n temp_r4 = arg1 * 4;\n *(arg0 + temp_r4) = arg2;\n *(arg0 + temp_r4) = 0;\n}\n/* Warning: struct E is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# illegal type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ustore` — benchmark function synthetic:ustore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ustore\n slwi r4,r4,2\n li r0,0\n stwx r5,r3,r4\n sthx r0,r3,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'\nunion E; void ustore(union E*,int,s32);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ustore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ustore` — benchmark function synthetic:ustore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ustore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 r4,r4,2\n 4:\tli r0,0\n 8:\tstwx r5,r3,r4\n c:\tsthx r0,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 ustore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ustore\n\n\nContents of section .text:\n 0000 5484103a 38000000 7ca3212e 7c03232e T..:8...|.!.|.#.\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 \"ustore\": {\n \"returnsVoid\": 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 ustore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:agbcc","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.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\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 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\tutag */\n/* \t.type\t utag,function */\n/* \t.thumb_func */\n/* utag: */\n/* \tldr\tr1, [r0] */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tcmp\tr1, #0x1 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldrb\tr0, [r0, #0x4] */\n/* \tb\t.L9 */\n/* .L4: */\n/* \tldr\tr0, [r0, #0x4] */\n/* \tb\t.L9 */\n/* .L5: */\n/* \tldrh\tr0, [r0, #0x4] */\n/* .L9: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t utag,.Lfe1-utag */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_r1;\n\n temp_r1 = arg0->unk0;\n switch (temp_r1) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:4: warning: dereferencing `void *' pointer","/cand.c.pp.c:4: request for member `unk0' in something not a structure or union","/cand.c.pp.c:7: warning: dereferencing `void *' pointer","/cand.c.pp.c:7: request for member `unk4' in something not a structure or union","/cand.c.pp.c:9: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tutag\n\t.type\t utag,function\n\t.thumb_func\nutag:\n\tldr\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r0, #0x4]\n\tb\t.L9\n.L4:\n\tldr\tr0, [r0, #0x4]\n\tb\t.L9\n.L5:\n\tldrh\tr0, [r0, #0x4]\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t utag,.Lfe1-utag\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name utag # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:gcc2.7.2kmc","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a0)\n 4:\tbeqz\tv1,1c \n 8:\tli\tv0,1\n c:\tbeq\tv1,v0,24 \n 10:\tnop\n 14:\tj\t2c \n 18:\tnop\n 1c:\tj\t30 \n 20:\tlw\tv0,4(a0)\n 24:\tj\t30 \n 28:\tlhu\tv0,4(a0)\n 2c:\tlbu\tv0,4(a0)\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-f8e70ed93edb6aa5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 utag\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n0000001c R_MIPS_26 .text\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c830000 10600005 24020001 10620005 .....`..$....b..\n 0010 00000000 0800000b 00000000 0800000c ................\n 0020 8c820004 0800000c 94820004 90820004 ................\n 0030 03e00008 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":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv1,0(a0) */\n/* 4:\tbeqz\tv1,1c */\n/* 8:\tli\tv0,1 */\n/* c:\tbeq\tv1,v0,24 */\n/* 10:\tnop */\n/* 14:\tj\t2c */\n/* 18:\tnop */\n/* 1c:\tj\t30 */\n/* 20:\tlw\tv0,4(a0) */\n/* 24:\tj\t30 */\n/* 28:\tlhu\tv0,4(a0) */\n/* 2c:\tlbu\tv0,4(a0) */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* \t... */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 4 and 2) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_v1;\n\n temp_v1 = arg0->unk0;\n switch (temp_v1) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:5: request for member `unk0' in something not a structure or union","/cand.c:8: request for member `unk4' in something not a structure or union","/cand.c:10: request for member `unk4' in something not a structure or union","/cand.c:12: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lw\t$v1, 0($a0)\n beqz\t$v1, .L1c\n li\t$v0, 1\n beq\t$v1, $v0, .L24\n nop\n j\t.L2c\n nop\n.L1c:\n j\t.L30\n lw\t$v0, 4($a0)\n.L24:\n j\t.L30\n lhu\t$v0, 4($a0)\n.L2c:\n lbu\t$v0, 4($a0)\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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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(a0)\n 4:\tbeqz\tv1,1c \n 8:\tli\tv0,1\n c:\tbeq\tv1,v0,24 \n 10:\tnop\n 14:\tj\t2c \n 18:\tnop\n 1c:\tj\t30 \n 20:\tlw\tv0,4(a0)\n 24:\tj\t30 \n 28:\tlhu\tv0,4(a0)\n 2c:\tlbu\tv0,4(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 df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8e70ed93edb6aa5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\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 utag\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n0000001c R_MIPS_26 .text\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8c830000 10600005 24020001 10620005 .....`..$....b..\n 0010 00000000 0800000b 00000000 0800000c ................\n 0020 8c820004 0800000c 94820004 90820004 ................\n 0030 03e00008 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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:ido7.1","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tli\tat,1\n 8:\tbeqz\tv0,20 \n c:\tnop\n 10:\tbeq\tv0,at,28 \n 14:\tnop\n 18:\tb\t34 \n 1c:\tlbu\tv0,4(a0)\n 20:\tjr\tra\n 24:\tlw\tv0,4(a0)\n 28:\tjr\tra\n 2c:\tlhu\tv0,4(a0)\n 30:\tlbu\tv0,4(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c utag\n\n\nContents of section .text:\n 0000 8c820000 24010001 10400005 00000000 ....$....@......\n 0010 10410005 00000000 10000006 90820004 .A..............\n 0020 03e00008 8c820004 03e00008 94820004 ................\n 0030 90820004 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 0000000f 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 08050000 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 0000003c 20200001 00000001 .......< ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 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 38653730 65643933 65646236 ef-f8e70ed93edb6\n 0130 6161352f 7265662e 63007574 61670000 aa5/ref.c.utag..\n 0140 75746167 00000000 00000000 00000001 utag............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000f 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":"declined","source":"/* asmlift could not decompile 'utag' — raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv0,0(a0) */\n/* 4:\tli\tat,1 */\n/* 8:\tbeqz\tv0,20 */\n/* c:\tnop */\n/* 10:\tbeq\tv0,at,28 */\n/* 14:\tnop */\n/* 18:\tb\t34 */\n/* 1c:\tlbu\tv0,4(a0) */\n/* 20:\tjr\tra */\n/* 24:\tlw\tv0,4(a0) */\n/* 28:\tjr\tra */\n/* 2c:\tlhu\tv0,4(a0) */\n/* 30:\tlbu\tv0,4(a0) */\n/* 34:\tjr\tra */\n/* 38:\tnop */\n/* 3c:\tnop */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions 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":["raise: cannot recover struct 'Struct0': overlapping fields at offset 4 (widths 1 and 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 utag(void *arg0) {\n s32 temp_v0;\n\n temp_v0 = arg0->unk0;\n switch (temp_v0) { /* irregular */\n case 0:\n return (u8) (s32) arg0->unk4;\n case 1:\n return (u8) (u16) arg0->unk4;\n default:\n return arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 8: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 10: Selector requires struct/union pointer as left hand side","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 `utag` — benchmark function synthetic:utag:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lw\t$v0, 0($a0)\n li\t$at, 1\n beqz\t$v0, .L20\n nop\n beq\t$v0, $at, .L28\n nop\n b\t.L34\n lbu\t$v0, 4($a0)\n.L20:\n jr\t$ra\n lw\t$v0, 4($a0)\n.L28:\n jr\t$ra\n lhu\t$v0, 4($a0)\n lbu\t$v0, 4($a0)\n.L34:\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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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:\tli\tat,1\n 8:\tbeqz\tv0,20 \n c:\tnop\n 10:\tbeq\tv0,at,28 \n 14:\tnop\n 18:\tb\t34 \n 1c:\tlbu\tv0,4(a0)\n 20:\tjr\tra\n 24:\tlw\tv0,4(a0)\n 28:\tjr\tra\n 2c:\tlhu\tv0,4(a0)\n 30:\tlbu\tv0,4(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 d .text\t00000040 .text\n00000000 g F .text\t0000003c utag\n\n\nContents of section .text:\n 0000 8c820000 24010001 10400005 00000000 ....$....@......\n 0010 10410005 00000000 10000006 90820004 .A..............\n 0020 03e00008 8c820004 03e00008 94820004 ................\n 0030 90820004 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 0000000f 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 08050000 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 0000003c 20200001 00000001 .......< ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 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 38653730 65643933 65646236 ef-f8e70ed93edb6\n 0130 6161352f 7265662e 63007574 61670000 aa5/ref.c.utag..\n 0140 75746167 00000000 00000000 00000001 utag............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000f 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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:utag:mwcc_242_81","sym":"utag","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["union","struct","field","mixed-width","switch","comparison-tree"],"loc":2,"refSource":"struct T{int kind;union{int i;u16 h;u8 b;}v;};\nint utag(struct T*t){ switch(t->kind){case 0:return t->v.i;case 1:return t->v.h;default:return t->v.b;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r0,0(r3)\n 4:\tcmpwi r0,1\n 8:\tbeq 24 \n c:\tbge 2c \n 10:\tcmpwi r0,0\n 14:\tbge 1c \n 18:\tb 2c \n 1c:\tlwz r3,4(r3)\n 20:\tblr\n 24:\tlhz r3,4(r3)\n 28:\tblr\n 2c:\tlbz r3,4(r3)\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 utag\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 utag\n\n\nContents of section .text:\n 0000 80030000 2c000001 4182001c 40800020 ....,...A...@.. \n 0010 2c000000 40800008 48000014 80630004 ,...@...H....c..\n 0020 4e800020 a0630004 4e800020 88630004 N.. .c..N.. .c..\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":"declined","source":"/* asmlift could not decompile 'utag' — lift: cannot lift 'utag': 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:\tlwz r0,0(r3) */\n/* 4:\tcmpwi r0,1 */\n/* 8:\tbeq 24 */\n/* c:\tbge 2c */\n/* 10:\tcmpwi r0,0 */\n/* 14:\tbge 1c */\n/* 18:\tb 2c */\n/* 1c:\tlwz r3,4(r3) */\n/* 20:\tblr */\n/* 24:\tlhz r3,4(r3) */\n/* 28:\tblr */\n/* 2c:\tlbz r3,4(r3) */\n/* 30:\tblr */\nvoid utag(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'utag': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":21,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'utag': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 utag(void *arg0) {\n s32 temp_r0;\n\n temp_r0 = arg0->unk0;\n switch (temp_r0) { /* irregular */\n case 0:\n return arg0->unk4;\n case 1:\n return (s32) (u16) arg0->unk4;\n default:\n return (s32) (u8) arg0->unk4;\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":92,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^^","# Error: ^^"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `utag` — benchmark function synthetic:utag:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel utag\n lwz r0,0(r3)\n cmpwi r0,1\n beq .L24\n bge .L2c\n cmpwi r0,0\n bge .L1c\n b .L2c\n.L1c:\n lwz r3,4(r3)\n blr\n.L24:\n lhz r3,4(r3)\n blr\n.L2c:\n lbz 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 utag # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `utag` — benchmark function synthetic:utag:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:utag:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-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 r0,0(r3)\n 4:\tcmpwi r0,1\n 8:\tbeq 24 \n c:\tbge 2c \n 10:\tcmpwi r0,0\n 14:\tbge 1c \n 18:\tb 2c \n 1c:\tlwz r3,4(r3)\n 20:\tblr\n 24:\tlhz r3,4(r3)\n 28:\tblr\n 2c:\tlbz r3,4(r3)\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 utag\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 utag\n\n\nContents of section .text:\n 0000 80030000 2c000001 4182001c 40800020 ....,...A...@.. \n 0010 2c000000 40800008 48000014 80630004 ,...@...H....c..\n 0020 4e800020 a0630004 4e800020 88630004 N.. .c..N.. .c..\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 utag # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own 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":["method"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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"],"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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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":["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 ad5c529:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout ad5c529a65ca1e5191b00a4a7b4cbfe79a7b45a0\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the 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