// Euclid's algorithm: if you repeatedly subtract // the smaller of two numbers from the larger, // you'll eventually get to the GCD of the two. while (a != b) { if (a < b) { a -= b; } else { b -= a; } } /* beg: if (a == b) goto end if (a >= b) goto else a -= b goto endif else: b -= a endif: goto beg end: */ /* variables: (I picked these at random) a in 0x80 b in 0x81 a -= b b = -b; a += b; b = -b; if !!a <= 0 goto end */ /* variables: (I picked these at random) a in 0x80 b in 0x81 r0 = mem[0x80] (6, 0, 3) 80 r1 = mem[0x81] (6, 1, 3) 81 r1 = -r1 (5, 1, 1) r0 += r1 (1, 0, 1) r1 = -r1 (5, 1, 1) r0 = !r0 (5, 0, 2) r0 = !r0 (5, 0, 2) r3 = end**** if r0 <= 0 goto end (7, 0, 3) a -= b b = -b; a += b; b = -b; if !!a <= 0 goto end */