mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-01 15:43:06 -04:00
9467db409b
The counterintuitive one: use TWO distinct locals for the same b*24, because cse resets at the if-join and the original recomputes the product into a second register — one shared local cannot reproduce it, and writing it inline is worse still (cse hoists the %hi/%lo address into a pseudo and changes the addressing mode). Duplicating a subexpression can be the correct decompile. Plus: a store-then-read-back turns a redundant load into the target's register copy; a zero-byte fence stops sched1 hoisting two '= 0' stores into the load-delay slot; and writing three repeated tails out separately lets cross_jump merge them, where funnelling them through one variable emits the arms inverted. Residual is three allocation facts, incl. a $17 pin that is REQUIRED (else k2 splits across two callee-saved regs and costs a fourth) but drags the shift chain into $s1.