;typedef unsigned char ch; ;typedef struct {ch s[256]; ch i; ch j;} state; ;int mv(ch * a, state * b, int c){return c+*a + b->j;} .section __TEXT,__text,regular,pure_instructions .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 .section __TEXT,__text,regular,pure_instructions .align 2 .globl _mv1 .section __TEXT,__text,regular,pure_instructions .align 2 _mv1: ;void mv(ch * out, state * s, int n) ; lbz r6,0(r3) ; lbz r2,257(r4) ; add r4,r5,r6 ; add r3,r4,r2 ; blr lbz r6,256(r4) lbz r7,257(r4) subi r3,r3,1 ;out in r3, s in r4, n in r5, i in r6, j in r7 mtctr r5 ; move n to CTR lp: addi r6,r6,1 andi. r6,r6,255 lbzx r0,r4,r6 ; s[i] add r7,r7,r0 ; j andi. r7,r7,255 lbzx r8,r4,r7 ; s[j] stbx r0,r4,r7 stbx r8,r4,r6 add r2,r0,r8 andi. r2,r2,255 lbzx r2,r4,r2 stbu r2,1(r3) bc 17,0,lp stb r6,256(r4) stb r7,257(r4) blr