Initial
[watForth.git] / c / switch_split_0.wat
1 (module
2 (type $FUNCSIG$i (func (result i32)))
3 (type $FUNCSIG$vi (func (param i32)))
4 (type $FUNCSIG$v (func))
5 (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
6 (import "env" "pop" (func $pop (result i32)))
7 (import "env" "push" (func $push (param i32)))
8 (import "env" "rinit" (func $rinit))
9 (import "env" "rpop" (func $rpop (result i32)))
10 (import "env" "rpush" (func $rpush (param i32)))
11 (import "env" "sys_read" (func $sys_read (param i32 i32) (result i32)))
12 (import "env" "sys_request" (func $sys_request (param i32 i32) (result i32)))
13 (import "env" "sys_write" (func $sys_write (param i32 i32) (result i32)))
14 (table (;0;) 0 anyfunc)
15 (memory $0 1)
16 (data (i32.const 16) "\00\00\00\09interpret\00\00\00\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\10\00\00\00\0d\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
17 (export "memory" (memory $0))
18 (export "main" (func $main))
19 (func $main (result i32)
20 (local $0 i32) (local $1 i32)
21 i32.const 0
22 i32.load offset=4
23 i32.const 16
24 i32.sub
25 set_local $1
26 i32.const 0
27 get_local $1
28 i32.store offset=4
29 get_local $1
30 i32.const 0
31 i32.store offset=12
32 i32.const 16
33 i32.const 16
34 call $interpret
35 set_local $0
36 i32.const 0
37 get_local $1
38 i32.const 16
39 i32.add
40 i32.store offset=4
41 get_local $0)
42 (func $interpret (param $0 i32) (param $1 i32) (result i32)
43 (local $2 i32)
44 i32.const 0
45 i32.load offset=4
46 i32.const 32
47 i32.sub
48 set_local $2
49 i32.const 0
50 get_local $2
51 i32.store offset=4
52 get_local $2
53 get_local $0
54 i32.store offset=28
55 get_local $2
56 get_local $1
57 i32.store offset=24
58 get_local $2
59 i32.const 0
60 i32.store offset=20
61 get_local $2
62 i32.const 0
63 i32.store offset=16
64 get_local $2
65 i32.const 0
66 i32.store offset=12
67 get_local $2
68 i32.const 0
69 i32.store offset=8
70 loop $label$0 (result i32)
71 get_local $2
72 get_local $2
73 i32.load offset=28
74 i32.load
75 i32.store offset=20
76 get_local $2
77 get_local $2
78 i32.load offset=28
79 i32.const 4
80 i32.add
81 i32.store offset=28
82 block $label$1
83 block $label$2
84 block $label$3
85 loop $label$4
86 get_local $2
87 i32.load offset=20
88 set_local $1
89 get_local $1
90 i32.const 13
91 i32.gt_u
92 br_if $label$3
93 block $label$5
94 block $label$6
95 block $label$7
96 block $label$8
97 block $label$9
98 block $label$10
99 block $label$11
100 block $label$12
101 block $label$13
102 block $label$14
103 block $label$15
104 block $label$16
105 block $label$17
106 block $label$18
107 get_local $1
108 br_table $label$18 $label$17 $label$16 $label$15 $label$14 $label$13 $label$12 $label$11 $label$10 $label$9 $label$8 $label$7 $label$6 $label$5 $label$18
109 end
110 get_local $2
111 get_local $2
112 i32.load offset=20
113 i32.store offset=28
114 get_local $2
115 get_local $2
116 i32.load offset=20
117 i32.load
118 i32.store offset=20
119 br $label$1
120 end
121 get_local $2
122 call $rpop
123 i32.store offset=28
124 br $label$1
125 end
126 get_local $2
127 i32.load offset=28
128 i32.load
129 call $push
130 get_local $2
131 get_local $2
132 i32.load offset=28
133 i32.const 4
134 i32.add
135 i32.store offset=28
136 br $label$1
137 end
138 call $rinit
139 br $label$1
140 end
141 get_local $2
142 get_local $2
143 i32.load offset=28
144 get_local $2
145 i32.load offset=20
146 i32.add
147 i32.store offset=28
148 get_local $2
149 get_local $2
150 i32.load offset=20
151 get_local $2
152 i32.load offset=28
153 i32.add
154 i32.store offset=20
155 br $label$1
156 end
157 call $pop
158 call $pop
159 call $sys_read
160 drop
161 br $label$1
162 end
163 call $pop
164 call $pop
165 call $sys_request
166 drop
167 br $label$1
168 end
169 call $pop
170 call $pop
171 call $sys_write
172 drop
173 br $label$1
174 end
175 br $label$2
176 end
177 get_local $2
178 get_local $2
179 i32.load offset=28
180 i32.load
181 i32.store offset=28
182 br $label$1
183 end
184 call $pop
185 i32.load
186 call $push
187 br $label$1
188 end
189 call $pop
190 set_local $1
191 call $pop
192 get_local $1
193 i32.store
194 br $label$1
195 end
196 get_local $2
197 call $pop
198 i32.store offset=20
199 br $label$4
200 end
201 end
202 i32.const 1
203 call $push
204 br $label$1
205 end
206 get_local $2
207 i32.load offset=28
208 call $rpush
209 get_local $2
210 get_local $2
211 i32.load offset=20
212 i32.store offset=28
213 br $label$1
214 end
215 i32.const 0
216 get_local $2
217 i32.const 32
218 i32.add
219 i32.store offset=4
220 i32.const 0
221 return
222 end
223 br $label$0
224 end))