1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
|
(module
(type (;0;) (func (param i32) (result)))
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
(type (;2;) (func (param) (result)))
(type (;3;) (func (param i64) (result)))
(import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0)))
(import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1)))
(global $0 (mut i32) (i32.const 0))
(global $1 (mut i32) (i32.const 0))
(global $2 (mut i32) (i32.const 0))
(global $3 (mut i64) (i64.const 0))
(global $4 (mut i64) (i64.const 0))
(global $5 (mut f32) (f32.const 0.000000))
(global $6 (mut f32) (f32.const 0.000000))
(global $7 (mut f64) (f64.const 0.000000))
(global $8 (mut f64) (f64.const 0.000000))
(func $2 (type 2) (param) (result)
(local i32 i64 i32 i64)
i32.const 5
local.set 2
local.get 2
i32.const 2
drop
local.get 2
i32.mul
local.set 0
local.get 2
i64.extend_i32_s
call 3
i32.const 1
i32.const 4
i32.const 1
i32.const 0
call 1
drop
local.get 0
i64.extend_i32_s
call 3
i32.const 1
i32.const 16
i32.const 1
i32.const 0
call 1
drop
local.get 0
i32.const 25
i32.ne
if
i32.const 1
i32.const 208
i32.const 1
i32.const 0
call 1
drop
i32.const 1
call 0
unreachable
else
end
i64.const 5
local.set 3
local.get 3
i64.const 2
drop
local.get 3
i64.mul
local.set 1
local.get 3
call 3
i32.const 1
i32.const 4
i32.const 1
i32.const 0
call 1
drop
local.get 1
call 3
i32.const 1
i32.const 16
i32.const 1
i32.const 0
call 1
drop
local.get 1
i64.const 25
i64.ne
if
i32.const 1
i32.const 208
i32.const 1
i32.const 0
call 1
drop
i32.const 1
call 0
unreachable
else
end
i32.const 0
call 0
return
)
(func $3 (type 3) (param i64) (result)
(local i64 i64 i64 i64)
local.get 0
i64.const 0
i64.eq
if
i32.const 1
i32.const 88
i32.const 1
i32.const 0
call 1
drop
return
else
end
local.get 0
i64.const 0
i64.lt_s
if
i32.const 1
i32.const 28
i32.const 1
i32.const 0
call 1
drop
local.get 0
i64.const -1
i64.mul
local.set 0
else
end
local.get 0
local.set 4
i64.const 0
local.set 1
loop
local.get 0
i64.const 0
i64.gt_s
if
local.get 1
i64.const 1
i64.add
local.set 1
local.get 0
i64.const 10
i64.div_s
local.set 0
br 1
else
end
end
loop
local.get 1
i64.const 0
i64.gt_s
if
local.get 1
i64.const 1
i64.sub
local.set 1
i64.const 1
local.set 2
i64.const 0
local.set 3
loop
local.get 3
local.get 1
i64.lt_s
if
local.get 3
i64.const 1
i64.add
local.set 3
local.get 2
i64.const 10
i64.mul
local.set 2
br 1
else
end
end
local.get 4
local.get 2
i64.div_s
i64.const 10
i64.rem_s
i64.const 12
i64.mul
i64.const 88
i64.add
local.set 0
i32.const 1
local.get 0
i32.wrap_i64
i32.const 1
i32.const 0
call 1
drop
br 1
else
end
end
return
)
(memory (;0;) 1000 1000)
(export "memory" (memory 0))
(export "_start" (func 2))
(export "print_i64" (func 3))
(data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00")
(data (;1;) (i32.const 12) " ")
(data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00")
(data (;3;) (i32.const 24) "\n ")
(data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00")
(data (;5;) (i32.const 36) "- ")
(data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00")
(data (;7;) (i32.const 48) ". ")
(data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00")
(data (;9;) (i32.const 60) "( ")
(data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00")
(data (;11;) (i32.const 72) ") ")
(data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00")
(data (;13;) (i32.const 84) ", ")
(data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00")
(data (;15;) (i32.const 96) "0 ")
(data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00")
(data (;17;) (i32.const 108) "1 ")
(data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00")
(data (;19;) (i32.const 120) "2 ")
(data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00")
(data (;21;) (i32.const 132) "3 ")
(data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00")
(data (;23;) (i32.const 144) "4 ")
(data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00")
(data (;25;) (i32.const 156) "5 ")
(data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00")
(data (;27;) (i32.const 168) "6 ")
(data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00")
(data (;29;) (i32.const 180) "7 ")
(data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00")
(data (;31;) (i32.const 192) "8 ")
(data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00")
(data (;33;) (i32.const 204) "9 ")
(data (;34;) (i32.const 208) "\d8\00\00\00\0b\00\00\00")
(data (;35;) (i32.const 216) "ERROR STOP\n ")
)
|