summaryrefslogtreecommitdiff
path: root/boil/tests/Factorial.opt.vapor
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-10 23:40:25 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-10 23:40:25 -0600
commit1080b37bbe40fe56b919d22804c159cccdca3c95 (patch)
tree8ddbb9528f575e537f925b266c8f366be6acc8b7 /boil/tests/Factorial.opt.vapor
parent61a28b7f8e709d1884ccab15f0dc38ed19dfde70 (diff)
Library rename, created A4 directories
Diffstat (limited to 'boil/tests/Factorial.opt.vapor')
-rw-r--r--boil/tests/Factorial.opt.vapor20
1 files changed, 20 insertions, 0 deletions
diff --git a/boil/tests/Factorial.opt.vapor b/boil/tests/Factorial.opt.vapor
new file mode 100644
index 0000000..aca17fe
--- /dev/null
+++ b/boil/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