li the divisor, then divw
Division has no immediate form — there's no instruction that can carry the divisor. So to divide by a constant, the compiler first drops it into a register with li, then runs the real divide, divw ("divide word").
sixth(n) = n / 6 comes out as a plain pair:
li r0, 6 # load the divisor
divw r3, r3, r0 # r3 = r3 / 6
blr
The li hands you the divisor outright. divw does signed division and throws the remainder away.
We've eased this lesson's optimizer back a notch to keep the divide this honest. At the setting the rest of the course runs under, dividing by a constant turns into something much stranger — you'll pull that apart later.
Your task
Write divConst, taking an int a, to reproduce the target assembly.