diff options
Diffstat (limited to 'output/LinearSearch.vapor')
-rw-r--r-- | output/LinearSearch.vapor | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/output/LinearSearch.vapor b/output/LinearSearch.vapor new file mode 100644 index 0000000..868e715 --- /dev/null +++ b/output/LinearSearch.vapor @@ -0,0 +1,188 @@ +func Main() + t.3 = HeapAllocZ(24) + [t.3+0] = :functable_LS + 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_LS + :LS_Start + :LS_Print + :LS_Search + :LS_Init + +func LS_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.7 = [this] + t.7 = [t.7+4] + t.6 = call t.7(this ) + t.5 = t.6 + t.8 = 9999 + PrintIntS(t.8) + t.10 = [this] + t.11 = 8 + t.10 = [t.10+8] + t.9 = call t.10(this t.11) + t.12 = t.9 + PrintIntS(t.12) + t.14 = [this] + t.15 = 12 + t.14 = [t.14+8] + t.13 = call t.14(this t.15) + t.16 = t.13 + PrintIntS(t.16) + t.18 = [this] + t.19 = 17 + t.18 = [t.18+8] + t.17 = call t.18(this t.19) + t.20 = t.17 + PrintIntS(t.20) + t.22 = [this] + t.23 = 50 + t.22 = [t.22+8] + t.21 = call t.22(this t.23) + t.24 = t.21 + PrintIntS(t.24) + t.25 = 55 + ret t.25 + +func LS_Print(this ) + t.0 = 1 +while29_test: + t.2 = t.0 + t.3 = [this+20] + t.1 = LtS(t.2 t.3) + t.4 = t.1 + if0 t.4 goto :while29_end +while29_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 :while29_test +while29_end: + t.12 = 0 + ret t.12 + +func LS_Search(this t.0 ) + t.1 = 1 + t.2 = 0 + t.3 = 0 +while42_test: + t.5 = t.1 + t.6 = [this+20] + t.4 = LtS(t.5 t.6) + t.7 = t.4 + if0 t.7 goto :while42_end +while42_body: + t.10 = [this+16] + t.11 = MulS(t.1 4) + t.11 = Add(t.11 4) + t.11 = Add(t.10 t.11) + t.9 = [t.11] + t.8 = t.9 + t.14 = t.0 + t.15 = 1 + t.13 = Add(t.14 t.15) + t.12 = t.13 + t.17 = t.8 + t.18 = t.0 + t.16 = LtS(t.17 t.18) + t.19 = t.16 + if0 t.19 goto :if53_else +if53_body: + t.20 = 0 + goto :if53_end +if53_else: + t.23 = t.8 + t.24 = t.12 + t.22 = LtS(t.23 t.24) + t.21 = Eq(t.22 0) + t.25 = t.21 + if0 t.25 goto :if57_else +if57_body: + t.20 = 0 + goto :if57_end +if57_else: + t.2 = 1 + t.3 = 1 + t.1 = [this+20] +if57_end: +if53_end: + t.27 = t.1 + t.28 = 1 + t.26 = Add(t.27 t.28) + t.1 = t.26 + goto :while42_test +while42_end: + t.29 = t.3 + ret t.29 + +func LS_Init(this t.0 ) + [this+20] = t.0 + t.1 = call :AllocArray(t.0) + [this+16] = t.1 + t.2 = 1 + t.5 = [this+20] + t.6 = 1 + t.4 = Add(t.5 t.6) + t.3 = t.4 +while70_test: + t.8 = t.2 + t.9 = [this+20] + t.7 = LtS(t.8 t.9) + t.10 = t.7 + if0 t.10 goto :while70_end +while70_body: + t.13 = 2 + t.14 = t.2 + t.12 = MulS(t.13 t.14) + t.11 = t.12 + t.17 = t.3 + t.18 = 3 + t.16 = Sub(t.17 t.18) + t.15 = t.16 + t.19 = [this+16] + t.20 = MulS(t.2 4) + t.20 = Add(t.20 4) + t.20 = Add(t.19 t.20) + t.22 = t.11 + t.23 = t.15 + t.21 = Add(t.22 t.23) + [t.20] = t.21 + t.25 = t.2 + t.26 = 1 + t.24 = Add(t.25 t.26) + t.2 = t.24 + t.28 = t.3 + t.29 = 1 + t.27 = Sub(t.28 t.29) + t.3 = t.27 + goto :while70_test +while70_end: + t.30 = 0 + ret t.30 + +func AllocArray(size) + bytes = MulS(size 4) + bytes = Add(bytes 4) + v = HeapAllocZ(bytes) + [v] = size + ret v + |