# append this file to fib2.toy, e.g., cat fib2.toy fib3.toy | toy # The corresponding C code is as follows; note that n2 is no longer used int fib(int n, int p) { int n2; top: if (n < 2) return 1 + p; p = fib(n-2, p); n--; goto top; } 3D: A173 M[R7+3] <- R1 p <- fib(n-2,p) 3E: 9372 R3 <- M[R7+2] R3 <- n 3F: B101 R1 <- 1 40: 2331 R3 <- R3 - R1 = R3 - 1 R3 <- n - 1 41: A372 M[R7+2] <- R3 n <- n - 1 42: 5033 goto 33 jump back to the top of fib