Begin trace
line: 20 loc: 0 contents: lim r4 (0) 0
reg[4] = 0
line: 22 loc: 1 contents: lim r3 (0) 19
reg[3] = 19
line: 23 loc: 2 contents: jsub r3 (19) r0 (0)
reg[0] = 3 jumping to sub at 19 return is 3
line: 26 loc: 3 contents: lim r3 (19) 24
reg[3] = 24
line: 27 loc: 4 contents: jsub r3 (24) r0 (3)
reg[0] = 5 jumping to sub at 24 return is 5
------- input ------
3
--------------------
line: 29 loc: 5 contents: copy r2 (0) r1 (3)
reg[2] = 3
line: 31 loc: 6 contents: lim r3 (24) 13
reg[3] = 13
line: 32 loc: 7 contents: jsub r3 (13) r0 (5)
reg[0] = 8 jumping to sub at 13 return is 8
line: 51 loc: 13 contents: lim r1 (3) 1
reg[1] = 1
line: 52 loc: 14 contents: lim r3 (13) 15
reg[3] = 15
line: 55 loc: 15 contents: jlte r0 (8) r2 (3) r4 (0)
jump to 8 not taken
line: 56 loc: 16 contents: mul r1 (1) r1 (1) r2 (3)
reg[1] = 3
line: 57 loc: 17 contents: aim r2 (3) -1
reg[2] = 2
line: 58 loc: 18 contents: junc r3 (15)
jumping unconditionally to 15
line: 55 loc: 15 contents: jlte r0 (8) r2 (2) r4 (0)
jump to 8 not taken
line: 56 loc: 16 contents: mul r1 (3) r1 (3) r2 (2)
reg[1] = 6
line: 57 loc: 17 contents: aim r2 (2) -1
reg[2] = 1
line: 58 loc: 18 contents: junc r3 (15)
jumping unconditionally to 15
line: 55 loc: 15 contents: jlte r0 (8) r2 (1) r4 (0)
jump to 8 not taken
line: 56 loc: 16 contents: mul r1 (6) r1 (6) r2 (1)
reg[1] = 6
line: 57 loc: 17 contents: aim r2 (1) -1
reg[2] = 0
line: 58 loc: 18 contents: junc r3 (15)
jumping unconditionally to 15
line: 55 loc: 15 contents: jlte r0 (8) r2 (0) r4 (0)
jump to 8 taken
line: 34 loc: 8 contents: copy r2 (0) r1 (6)
reg[2] = 6
line: 36 loc: 9 contents: lim r3 (15) 31
reg[3] = 31
line: 37 loc: 10 contents: jsub r3 (31) r0 (8)
reg[0] = 11 jumping to sub at 31 return is 11
------- output ------
6
--------------------
line: 39 loc: 11 contents: lim r3 (31) 3
reg[3] = 3
line: 40 loc: 12 contents: junc r3 (3)
jumping unconditionally to 3
line: 26 loc: 3 contents: lim r3 (3) 24
reg[3] = 24
line: 27 loc: 4 contents: jsub r3 (24) r0 (11)
reg[0] = 5 jumping to sub at 24 return is 5
------- input ------
^D
--------------------