#include #include #include uint16_t r7; uint16_t func1(uint16_t r0,uint16_t r1) { if(!r0) { return r1+1; } if(!r1) { return func1(r0-1,r7); } return func1(r0-1,func1(r0,r1-1)); } uint16_t func2(uint16_t r0, uint16_t r1) { if(!r0) { return r1+1; } if(!r1) { return func2(r0-1,r7); } switch(r0) { case 1: return r1+r7+1; case 2: return r1*(r7+1)+2*r7+1; case 3: return func2(r0-1,func2(r0,r1-1)); } } int main() { uint16_t r0; uint16_t r1; int i; for(i = 1; i < 32768; i++) { r0 = 3; r7 = i; r1 = func2(r0,r7) % 32768; if(func2(3,r1) == 6) { printf("===FOUND VALUE===\nr0: %d\nr1: %d\nr7: %d\n\n",r0,r1,r7); break; } } return 0; }