Three operations, one accumulator
Three operations, three instructions, and they all hand work to each other through r0. That register holds the running result; only the last instruction writes r3. You've traced shorter chains already; this is one more link.
A quick warm-up: div_sub(p, q, r) divides, then subtracts a third value:
divw r0, r3, r4 # r0 = p / q
subf r3, r5, r0 # r3 = r0 - r5 = (p / q) - r
blr
divw drops the quotient into r0. subf then takes r5 away from it. The only thing that trips people up is the order: subf rD, rA, rB is rB − rA, so subf r3, r5, r0 really does mean r0 − r5.
Your target is one operation longer. Read it from the top, track what r0 holds after each line, and the last instruction's operands show you how to put the expression back together.
Your task
Write func_802c9ac8 to reproduce the assembly above.