Small security hole in this: since i0/i1/i2 are signed ints, i0 % 8 etc can be negative, and thus allow writing in the 7 bytes before r[], quite possibly leading to a stack smashing attack. So you probably don't want to run this in production :)
However I fixed the issue and gave you the credit:
https://github.com/wkoszek/cpu60/commit/672711f3e06bba424b98...