diff options
| author | bd-912 <bdunahu@colostate.edu> | 2024-05-08 03:23:52 -0600 |
|---|---|---|
| committer | bd-912 <bdunahu@colostate.edu> | 2024-05-08 03:23:52 -0600 |
| commit | bf6c70d595e194e8688737b39f31d173436163d4 (patch) | |
| tree | d8a84eb1b78c3c763472789414bc868c599d8378 /output/Factorial.opt.vaporm | |
| parent | 6a27fdf4276772544d20074ab9abd02dab9c0a20 (diff) | |
Fix issue with assigning a label to a register in Condense
Diffstat (limited to 'output/Factorial.opt.vaporm')
| -rw-r--r-- | output/Factorial.opt.vaporm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/output/Factorial.opt.vaporm b/output/Factorial.opt.vaporm new file mode 100644 index 0000000..fb5f8e6 --- /dev/null +++ b/output/Factorial.opt.vaporm @@ -0,0 +1,30 @@ +const empty_Fac + +func Main [in 0, out 0, local 0] + $a0 = :empty_Fac + $a1 = 10 + call :Fac.ComputeFac + $t0 = $v0 + PrintIntS($t0) + ret + +func Fac.ComputeFac [in 0, out 0, local 1] + local[0] = $s0 + $t0 = $a0 + $s0 = $a1 + $t1 = LtS($s0 1) + if0 $t1 goto :if1_else + $t1 = 1 + goto :if1_end +if1_else: + $t2 = Sub($s0 1) + $a0 = $t0 + $a1 = $t2 + call :Fac.ComputeFac + $t2 = $v0 + $t1 = MulS($s0 $t2) +if1_end: + $v0 = $t1 + $s0 = local[0] + ret + |
