phase12: match func_80029E88 (707 bodies / 716 regions)

This commit is contained in:
Christopher Williams
2026-09-25 00:31:53 -04:00
parent 49dac73315
commit abe811cf68
3 changed files with 863 additions and 834 deletions
+833 -834
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -136,6 +136,7 @@
0x800297F4 0x800298C0 src/func_800297F4.c
0x800298C0 0x80029A48 src/func_800298C0.c
0x80029A48 0x80029C84 src/func_80029A48.c
0x80029E88 0x80029ED8 src/func_80029E88.c
0x8002A9D4 0x8002AA18 src/func_8002A9D4.c
0x8002AC84 0x8002ACBC src/func_8002AC84.c
0x8002C6EC 0x8002C728 src/func_8002C6EC.c
1 # Code-region registry: one C region per matched function.
136 0x800297F4
137 0x800298C0
138 0x80029A48
139 0x80029E88
140 0x8002A9D4
141 0x8002AC84
142 0x8002C6EC
+29
View File
@@ -0,0 +1,29 @@
/*
* func_80029E88 — 80 bytes at 0x80029E88..0x80029ED8
*
* Squares the input, applies the signed 4095 bias when the square is negative,
* shifts by 12, and passes 4096-minus-that-value to func_800F9204. The result of
* that helper is then passed with the original input to func_800F2FC0, whose result
* is returned.
*
* The nested call dataflow is byte-required: the second helper receives the first
* helper's return value, not the pre-call shifted value. This removes the extra
* live local and produces the target's 24-byte frame with only s0 and ra saved.
*
* LIMITS: arithmetic meaning and helper behavior are not inferred. The square,
* signed bias, 4096 constant, shift, call order, argument values, return, frame,
* and epilogue are byte evidence.
*/
extern int func_800F9204(int);
extern int func_800F2FC0(int, int);
int func_80029E88(int a0)
{
int x = a0 * a0;
if (x < 0)
x += 4095;
x >>= 12;
return func_800F2FC0(func_800F9204(4096 - x), a0);
}