summaryrefslogtreecommitdiff
path: root/output/BubbleSort.vapor
diff options
context:
space:
mode:
Diffstat (limited to 'output/BubbleSort.vapor')
-rw-r--r--output/BubbleSort.vapor223
1 files changed, 223 insertions, 0 deletions
diff --git a/output/BubbleSort.vapor b/output/BubbleSort.vapor
new file mode 100644
index 0000000..5315afc
--- /dev/null
+++ b/output/BubbleSort.vapor
@@ -0,0 +1,223 @@
+func Main()
+ t.3 = HeapAllocZ(24)
+ [t.3+0] = :functable_BBS
+ t.4 = t.3
+ t.5 = [t.4+0]
+ t.6 = [t.5+0]
+ t.7 = 10
+ t.2 = call t.6(t.4 t.7)
+ t.8 = t.2
+ PrintIntS(t.8)
+ ret
+
+const functable_BBS
+ :BBS_Start
+ :BBS_Sort
+ :BBS_Print
+ :BBS_Init
+
+func BBS_Start(this t.0 )
+ t.3 = [this]
+ t.4 = t.0
+ t.3 = [t.3+12]
+ t.2 = call t.3(this t.4)
+ t.1 = t.2
+ t.6 = [this]
+ t.6 = [t.6+8]
+ t.5 = call t.6(this )
+ t.1 = t.5
+ t.7 = 99999
+ PrintIntS(t.7)
+ t.9 = [this]
+ t.9 = [t.9+4]
+ t.8 = call t.9(this )
+ t.1 = t.8
+ t.11 = [this]
+ t.11 = [t.11+8]
+ t.10 = call t.11(this )
+ t.1 = t.10
+ t.12 = 0
+ ret t.12
+
+func BBS_Sort(this )
+ t.2 = [this+20]
+ t.3 = 1
+ t.1 = Sub(t.2 t.3)
+ t.0 = t.1
+ t.6 = 0
+ t.7 = 1
+ t.5 = Sub(t.6 t.7)
+ t.4 = t.5
+while23_test:
+ t.9 = t.4
+ t.10 = t.0
+ t.8 = LtS(t.9 t.10)
+ t.11 = t.8
+ if0 t.11 goto :while23_end
+while23_body:
+ t.12 = 1
+while28_test:
+ t.14 = t.12
+ t.16 = t.0
+ t.17 = 1
+ t.15 = Add(t.16 t.17)
+ t.18 = t.15
+ t.13 = LtS(t.14 t.18)
+ t.19 = t.13
+ if0 t.19 goto :while28_end
+while28_body:
+ t.22 = t.12
+ t.23 = 1
+ t.21 = Sub(t.22 t.23)
+ t.20 = t.21
+ t.26 = [this+16]
+ t.27 = MulS(t.20 4)
+ t.27 = Add(t.27 4)
+ t.27 = Add(t.26 t.27)
+ t.25 = [t.27]
+ t.24 = t.25
+ t.30 = [this+16]
+ t.31 = MulS(t.12 4)
+ t.31 = Add(t.31 4)
+ t.31 = Add(t.30 t.31)
+ t.29 = [t.31]
+ t.28 = t.29
+ t.33 = t.28
+ t.34 = t.24
+ t.32 = LtS(t.33 t.34)
+ t.35 = t.32
+ if0 t.35 goto :if45_else
+if45_body:
+ t.38 = t.12
+ t.39 = 1
+ t.37 = Sub(t.38 t.39)
+ t.36 = t.37
+ t.42 = [this+16]
+ t.43 = MulS(t.36 4)
+ t.43 = Add(t.43 4)
+ t.43 = Add(t.42 t.43)
+ t.41 = [t.43]
+ t.40 = t.41
+ t.44 = [this+16]
+ t.45 = MulS(t.36 4)
+ t.45 = Add(t.45 4)
+ t.45 = Add(t.44 t.45)
+ t.47 = [this+16]
+ t.48 = MulS(t.12 4)
+ t.48 = Add(t.48 4)
+ t.48 = Add(t.47 t.48)
+ t.46 = [t.48]
+ [t.45] = t.46
+ t.49 = [this+16]
+ t.50 = MulS(t.12 4)
+ t.50 = Add(t.50 4)
+ t.50 = Add(t.49 t.50)
+ [t.50] = t.40
+ goto :if45_end
+if45_else:
+ t.51 = 0
+if45_end:
+ t.53 = t.12
+ t.54 = 1
+ t.52 = Add(t.53 t.54)
+ t.12 = t.52
+ goto :while28_test
+while28_end:
+ t.56 = t.0
+ t.57 = 1
+ t.55 = Sub(t.56 t.57)
+ t.0 = t.55
+ goto :while23_test
+while23_end:
+ t.58 = 0
+ ret t.58
+
+func BBS_Print(this )
+ t.0 = 0
+while69_test:
+ t.2 = t.0
+ t.3 = [this+20]
+ t.1 = LtS(t.2 t.3)
+ t.4 = t.1
+ if0 t.4 goto :while69_end
+while69_body:
+ t.6 = [this+16]
+ t.7 = MulS(t.0 4)
+ t.7 = Add(t.7 4)
+ t.7 = Add(t.6 t.7)
+ t.5 = [t.7]
+ t.8 = t.5
+ PrintIntS(t.8)
+ t.10 = t.0
+ t.11 = 1
+ t.9 = Add(t.10 t.11)
+ t.0 = t.9
+ goto :while69_test
+while69_end:
+ t.12 = 0
+ ret t.12
+
+func BBS_Init(this t.0 )
+ [this+20] = t.0
+ t.1 = call :AllocArray(t.0)
+ [this+16] = t.1
+ t.2 = [this+16]
+ t.3 = MulS(0 4)
+ t.3 = Add(t.3 4)
+ t.3 = Add(t.2 t.3)
+ [t.3] = 20
+ t.4 = [this+16]
+ t.5 = MulS(1 4)
+ t.5 = Add(t.5 4)
+ t.5 = Add(t.4 t.5)
+ [t.5] = 7
+ t.6 = [this+16]
+ t.7 = MulS(2 4)
+ t.7 = Add(t.7 4)
+ t.7 = Add(t.6 t.7)
+ [t.7] = 12
+ t.8 = [this+16]
+ t.9 = MulS(3 4)
+ t.9 = Add(t.9 4)
+ t.9 = Add(t.8 t.9)
+ [t.9] = 18
+ t.10 = [this+16]
+ t.11 = MulS(4 4)
+ t.11 = Add(t.11 4)
+ t.11 = Add(t.10 t.11)
+ [t.11] = 2
+ t.12 = [this+16]
+ t.13 = MulS(5 4)
+ t.13 = Add(t.13 4)
+ t.13 = Add(t.12 t.13)
+ [t.13] = 11
+ t.14 = [this+16]
+ t.15 = MulS(6 4)
+ t.15 = Add(t.15 4)
+ t.15 = Add(t.14 t.15)
+ [t.15] = 6
+ t.16 = [this+16]
+ t.17 = MulS(7 4)
+ t.17 = Add(t.17 4)
+ t.17 = Add(t.16 t.17)
+ [t.17] = 9
+ t.18 = [this+16]
+ t.19 = MulS(8 4)
+ t.19 = Add(t.19 4)
+ t.19 = Add(t.18 t.19)
+ [t.19] = 19
+ t.20 = [this+16]
+ t.21 = MulS(9 4)
+ t.21 = Add(t.21 4)
+ t.21 = Add(t.20 t.21)
+ [t.21] = 5
+ t.22 = 0
+ ret t.22
+
+func AllocArray(size)
+ bytes = MulS(size 4)
+ bytes = Add(bytes 4)
+ v = HeapAllocZ(bytes)
+ [v] = size
+ ret v
+