Pretty cool, though the assembly could be tightened in a few hot loops, eg:
mov r3, r10
adds r5, r5, r3
mov r9, r5
can be made into mov r9, r10
add r9, r5
since r5 and r3 are both dead, and so are the flags