When the compiler regroups your chain
MWCC can reassociate a chain of additions while scheduling instructions. The order of the machine operations need not follow the left-to-right grouping of the C expression.
For example, consider the assembly for a four-term sum:
add r0,r4,r5
mr r4,r3
add r3,r0,r6
add r3,r4,r3
blr
The first add combines b and c. The mr saves a in r4, the next add includes d, and the final add brings in the saved value. MWCC chose that order from a natural left-to-right expression.
An mr is a register-to-register copy. Follow the saved value to its later use, then trace each add back to its inputs to find which operands belong to the sum. Write the natural left-to-right expression and let MWCC choose the instruction order. Parenthesizing the C to imitate the compiler's regrouping can produce different assembly.
Your task
Write func_800ef650 to reproduce the target assembly.