Strength reduction
Multiplying by a power of two never actually multiplies. The compiler rewrites it as a left shift, which is cheaper and gives the identical answer. That rewrite has a name, strength reduction, and you'll see it constantly. The shift instruction itself is rlwinm, though MWCC dresses it up as the slwi extended mnemonic.
Say times16(n) = n * 16. Out comes:
slwi r3, r3, 4 # n << 4 == n * 16
blr
The 4 is log base 2 of 16; the shift count is always log base 2 of the multiplier. Your C can say n * 16 or n << 4, and neither survives into the object code as anything but that single shift.
A target that shifts left by some amount is hiding a multiply by two to that power. Recover the power and you have the multiplier. * N and << log2(N) are interchangeable here, so the prettier one wins.
Your task
Write times8 to match the target.