A loaded value and a scalar argument
Up to now the constants doing the scaling have been just that, constants. Swap in a function argument and the multiply changes shape. Instead of the immediate mulli, you get the full register-register mullw rD, rA, rB. It's the constant-versus-variable split from the arithmetic chapter, except now there's a dereference underneath it.
Loads come first, then the arithmetic that blends a loaded value with the scalar waiting in its argument register.
offset_first(q, n) shows the addition version. It dereferences the pointer, adds the scalar n, and subtracts a later element:
lwz r0, 0(r3) # *q (q[0])
lwz r3, 8(r3) # q[2]
add r0, r0, r4 # *q + n (n is the argument in r4)
subf r3, r3, r0 # r0 - q[2]
blr
n sits in r4 and folds in through a plain add; addition never needs scaling. The target does something different. It multiplies a loaded element by that scalar argument, so look for a mullw that reads r4, then combines with a second element. Follow the registers to work out which element gets scaled and how the other one enters.
Your task
Write scaled_first, taking an int* and an int, to reproduce the assembly above.