Putting the idioms together
Real engine code rarely shows one idiom at a time. A frame's state-machine step might check a volatile abort flag, then dispatch on an enum state through a switch. Each piece you've learned is visible in the asm — stacked:
lwz r0, g_abort@sda21(r2) # volatile read of the abort flag...
cmpwi r0, 0
beq- .run # ...not aborting -> proceed
li r3, -1 # aborting -> bail with sentinel
blr
.run:
cmplwi r3, 7 # enum-state switch on s (still in r3, first arg): bounds check (8 dense cases)
bgt- .default
lis r4, table@ha # ...jump-table dispatch
slwi r0, r3, 2
addi r3, r4, table@lo
lwzx r0, r3, r0
mtctr r0
bctr # jump straight to the case for this state
Three lessons in one fingerprint: the volatile guard (a single lwz of the flag feeding a beq- early-return), the enum (the state arrives as a plain 4-byte int — naming, no codegen cost), and the jump table (eight dense states cross the threshold into cmplwi/lwzx/mtctr/bctr). Recovering this means recognizing all three at once and writing each in its natural C form.
Your task
Write step_state(GameState s) to reproduce the assembly above. The GameState enum and g_abort are provided in context.