diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-03-27 13:09:08 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-03-27 13:09:08 -0600 |
commit | 8131ddc22af5d39114a55349d71bcdc467599187 (patch) | |
tree | 9aaa7b984f223b1b405bb1598982ea992eeba67d /vaporize/tests/Factorial.opt.vapor | |
parent | e8af241aa57104d62c25c8bcbc2df76510998bf9 (diff) |
Expand file structure, Vaporize skeleton
Diffstat (limited to 'vaporize/tests/Factorial.opt.vapor')
-rw-r--r-- | vaporize/tests/Factorial.opt.vapor | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vaporize/tests/Factorial.opt.vapor b/vaporize/tests/Factorial.opt.vapor new file mode 100644 index 0000000..aca17fe --- /dev/null +++ b/vaporize/tests/Factorial.opt.vapor @@ -0,0 +1,20 @@ + +const empty_Fac + + +func Main() + t.0 = call :Fac.ComputeFac(:empty_Fac 10) + PrintIntS(t.0) + ret + +func Fac.ComputeFac(this num) + t.0 = LtS(num 1) + if0 t.0 goto :if1_else + num_aux = 1 + goto :if1_end + if1_else: + t.1 = Sub(num 1) + t.2 = call :Fac.ComputeFac(this t.1) + num_aux = MulS(num t.2) + if1_end: + ret num_aux |