namespace; include rt; // a hot path: the jits have translated down() and the loop in main long before // the last call, so the return stack pointer comes from translated code (op 56 // reads it at the gate store, cb_r on both jits) int down(int n, int last) { if (n == 0) { if (last) rt.trace(); return 1; } return down(n - 1, last) + 1; } int main() { int i = 0, s = 0; while (i < 5000) { s = s + down(3, i == 4999); i++; } rt.put_n(s); rt.put_c(10); return 0; }