00d655187a
Three small functions extracted from the v1.19 conservative blob with
ground-truth C and per-tool (Ghidra / retdec / decomp.me) docs:
01_memset — byte memset, 28 B
02_memcpy32 — word-aligned memcpy, 36 B
03_magic_memset — magic check + tail-call to memset, 40 B
04_train_phy_block — first real poll-site function (104 B, 26 insts),
contains poll sites 12-15
Results in RESULTS.md:
- Ghidra: A on all four. Auto-decompile is close to final.
- retdec: A on #3, F on #1 and #2 (no register-arg inference on raw),
C on #4 (mistakes & 0xF0000000 for < 0x10000000).
GRIND_LOG.md (in 04_train_phy_block/) records the matching-decomp
iteration: 116-byte candidate.c at -Os vs vendor 104 bytes = 89.7%
size match on first real iteration. Remaining gap is GCC's choice of
`cmp w, w_const; b.ls` over vendor's `tst w, #imm; b.eq` for the
mask tests.
gdb_debug/ holds a native-aarch64 GDB single-stepper for the three
benchmark functions — boltzmann smoke test passed (memset:
buf[10] 0x00→0xab).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
689 B
C
19 lines
689 B
C
/* Ghidra 11.3 default decompiler output for FUN_0000d328 — unmodified. */
|
|
void FUN_0000d328(long param_1)
|
|
{
|
|
long lVar1;
|
|
|
|
lVar1 = *(long *)(param_1 + 0xb8);
|
|
*(undefined4 *)(lVar1 + 0x8110) = 0xf000f000;
|
|
do { } while ((*(uint *)(lVar1 + 0x8118) & 0xf0000000) == 0);
|
|
do { } while ((*(uint *)(lVar1 + 0x8120) & 0xf0000000) == 0);
|
|
*(undefined4 *)(lVar1 + 0x8160) = 0x30003;
|
|
*(undefined4 *)(lVar1 + 0x8154) = 0x30003;
|
|
do { } while ((*(uint *)(lVar1 + 0x8184) & 3) == 0);
|
|
*(undefined4 *)(lVar1 + 0x8154) = 0x30000;
|
|
do { } while ((*(uint *)(lVar1 + 0x8184) & 3) != 0);
|
|
*(undefined4 *)(lVar1 + 0x8160) = 0x30000;
|
|
*(undefined4 *)(lVar1 + 0x8110) = 0xf0000000;
|
|
return;
|
|
}
|