A longer running total
With four operands you've got three operations, hence three arithmetic instructions. A partial result builds up in r0, passed along from each instruction to the next, and the final instruction writes r3 to hand the answer back.
Here's delta(p, q, r, s), running two subtracts and then an add:
subf r0, r4, r3 # r0 = r3 - r4 = p - q
subf r0, r5, r0 # r0 = r0 - r5 = (p - q) - r
add r3, r6, r0 # r3 = s + ((p - q) - r)
blr
Every instruction grabs whatever r0 held and applies the next operation. The subf reversal is in force the whole way down: subf rD, rA, rB is always rB − rA, so the most recent r0 becomes the minuend of the next subf. Count the instructions and you know the number of operations. Decode them one by one and the chain reads off left-to-right.
This target leans on the same plan. Pin down which register carries which argument (r3→a, r4→b, r5→c, r6→d), then follow the accumulator instruction by instruction until the expression falls out.
Your task
Write func_803862f0 to reproduce the target assembly.