(module
  (import "wasi_snapshot_preview1" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
  (import "wasi_snapshot_preview1" "proc_exit" (func $proc_exit (param i32)))
  (data (i32.const 48) "\04\00\00\00true")
  (data (i32.const 56) "\05\00\00\00false")
  (data (i32.const 64) "\01\00\00\00-")
  (func $alloc (param $n i32) (result i32) (local $p i32) (local $limit i32)
    (local.set $p (global.get $hp))
    (global.set $hp (i32.and (i32.add (i32.add (local.get $p) (local.get $n)) (i32.const 7)) (i32.const -8)))
    (local.set $limit (i32.mul (memory.size) (i32.const 65536)))
    (if (i32.gt_u (global.get $hp) (local.get $limit))
      (then
        (if (i32.eq (memory.grow (i32.add (i32.shr_u (i32.sub (global.get $hp) (local.get $limit)) (i32.const 16)) (i32.const 1))) (i32.const -1))
          (then (unreachable)))))
    (local.get $p))
  (func $str_eq (param $a i32) (param $b i32) (result i32) (local $n i32) (local $i i32)
    (local.set $n (i32.load (local.get $a)))
    (if (i32.ne (local.get $n) (i32.load (local.get $b))) (then (return (i32.const 0))))
    (block $done
      (loop $next
        (br_if $done (i32.ge_u (local.get $i) (local.get $n)))
        (if (i32.ne (i32.load8_u (i32.add (i32.add (local.get $a) (i32.const 4)) (local.get $i)))
                    (i32.load8_u (i32.add (i32.add (local.get $b) (i32.const 4)) (local.get $i))))
          (then (return (i32.const 0))))
        (local.set $i (i32.add (local.get $i) (i32.const 1)))
        (br $next)))
    (i32.const 1))
  (memory (export "memory") 2)
  (global $hp (mut i32) (i32.const 104))
  (func $score_0 (param $v0 i32) (result i32)
    (local $t0 i32)
    (local $v1 i32)
    (local $v2 i32)
    (local $v3 i32)
    (local $v4 i32)
    (local $v5 i32)
    (local $v6 i32)
    (local $v7 i32)
    (local $v8 i32)
    (local $v9 i32)
    (local $v10 i32)
    (local $v12 i32)
    (local $v11 i32)
    (local $v14 i32)
    (local $v13 i32)
    (local $v16 i32)
    (local $v15 i32)
    (local $v18 i32)
    (local $v17 i32)
    (local.set $t0 (i32.load (local.get $v0)))
    (if (i32.eq (local.get $t0) (i32.const 1))
        (then
            (local.set $v1 (i32.load offset=8 (local.get $v0)))
            (local.set $v2 (i32.load offset=8 (local.get $v1)))
            (local.set $v3 (i32.load offset=16 (local.get $v1)))
            (local.set $v4 (i32.load offset=8 (local.get $v2)))
            (local.set $v5 (i32.load offset=16 (local.get $v2)))
            (local.set $v6 (i32.load offset=8 (local.get $v4)))
            (local.set $v7 (i32.load offset=16 (local.get $v4)))
            (local.set $v8 (i32.load offset=8 (local.get $v5)))
            (local.set $v9 (i32.load offset=16 (local.get $v5)))
            (local.set $v10 (i32.eq (local.get $v6) (i32.const 7)))
            (if (local.get $v10)
                (then
                    (local.set $v11 (call $str_eq (local.get $v7) (i32.const 88)))
                    (local.set $v12 (local.get $v11))
                )
                (else
                    (local.set $v12 (i32.const 0))
                ))
            (if (local.get $v12)
                (then
                    (local.set $v13 (i32.eq (local.get $v8) (i32.const 4)))
                    (local.set $v14 (local.get $v13))
                )
                (else
                    (local.set $v14 (i32.const 0))
                ))
            (if (local.get $v14)
                (then
                    (local.set $v15 (call $str_eq (local.get $v9) (i32.const 96)))
                    (local.set $v16 (local.get $v15))
                )
                (else
                    (local.set $v16 (i32.const 0))
                ))
            (if (local.get $v16)
                (then
                    (local.set $v17 (i32.eq (local.get $v3) (i32.const 2)))
                    (local.set $v18 (local.get $v17))
                )
                (else
                    (local.set $v18 (i32.const 0))
                ))
            (if (local.get $v18)
                (then
                    (return (i32.const 0))
                )
                (else
                    (return (i32.const 1))
                ))
        )
        (else
    (if (i32.eq (local.get $t0) (i32.const 0))
        (then
            (return (i32.const 1))
        )
        (else
    (unreachable)
        ))
        ))
    (unreachable)
  )
  (func $spiralMain (result i32)
    (local $v0 i32)
    (local $v1 i32)
    (local $v2 i32)
    (local $t3 i32)
    (local $v3 i32)
    (local $v4 i32)
    (local $v5 i32)
    (local $t7 i32)
    (local $v6 i32)
    (local $t9 i32)
    (local $v7 i32)
    (local $v8 i32)
    (local $t12 i32)
    (local $v9 i32)
    (local $v12 i32)
    (local $t15 i32)
    (local $t16 i32)
    (local $v13 i32)
    (local $t18 i32)
    (local $v14 i32)
    (local $t20 i32)
    (local $v15 i32)
    (local $t22 i32)
    (local $t23 i32)
    (local $v16 i32)
    (local $v17 i32)
    (local $v18 i32)
    (local $t27 i32)
    (local $v19 i32)
    (local $v20 i32)
    (local $v21 i32)
    (local $t31 i32)
    (local $v22 i32)
    (local $t33 i32)
    (local $v23 i32)
    (local $v24 i32)
    (local $t36 i32)
    (local $v25 i32)
    (local $v28 i32)
    (local $t39 i32)
    (local $t40 i32)
    (local $v29 i32)
    (local $t42 i32)
    (local $v30 i32)
    (local $v31 i32)
    (local $v32 i32)
    (local.set $v0 (i32.const 1))
    (local.set $v1 (i32.const 72))
    (local.set $t3 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t3) (local.get $v0))
    (i32.store offset=16 (local.get $t3) (local.get $v1))
    (local.set $v2 (local.get $t3))
    (local.set $v3 (i32.const 2))
    (local.set $v4 (i32.const 80))
    (local.set $t7 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t7) (local.get $v3))
    (i32.store offset=16 (local.get $t7) (local.get $v4))
    (local.set $v5 (local.get $t7))
    (local.set $t9 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t9) (local.get $v2))
    (i32.store offset=16 (local.get $t9) (local.get $v5))
    (local.set $v6 (local.get $t9))
    (local.set $v7 (i32.const 3))
    (local.set $t12 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t12) (local.get $v6))
    (i32.store offset=16 (local.get $t12) (local.get $v7))
    (local.set $v8 (local.get $t12))
    (local.set $v9 (i32.const 1))
    (if (local.get $v9)
        (then
            (local.set $t15 (call $alloc (i32.const 16)))
            (i32.store (local.get $t15) (i32.const 1))
            (i32.store offset=8 (local.get $t15) (local.get $v8))
            (local.set $v12 (local.get $t15))
        )
        (else
            (local.set $t16 (call $alloc (i32.const 8)))
            (i32.store (local.get $t16) (i32.const 0))
            (local.set $v12 (local.get $t16))
        ))
    (local.set $t18 (call $alloc (i32.const 16)))
    (i32.store offset=8 (local.get $t18) (local.get $v12))
    (local.set $v13 (local.get $t18))
    (local.set $t20 (call $alloc (i32.const 16)))
    (i32.store offset=8 (local.get $t20) (local.get $v13))
    (local.set $v14 (local.get $t20))
    (local.set $t22 (i32.const 1))
    (local.set $t23 (call $alloc (i32.add (i32.const 8) (i32.mul (local.get $t22) (i32.const 8)))))
    (i32.store (local.get $t23) (local.get $t22))
    (local.set $v15 (local.get $t23))
    (i32.store offset=8 (i32.add (local.get $v15) (i32.mul (i32.const 0) (i32.const 8))) (local.get $v14))
    (local.set $v16 (i32.const 7))
    (local.set $v17 (i32.const 88))
    (local.set $t27 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t27) (local.get $v16))
    (i32.store offset=16 (local.get $t27) (local.get $v17))
    (local.set $v18 (local.get $t27))
    (local.set $v19 (i32.const 4))
    (local.set $v20 (i32.const 96))
    (local.set $t31 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t31) (local.get $v19))
    (i32.store offset=16 (local.get $t31) (local.get $v20))
    (local.set $v21 (local.get $t31))
    (local.set $t33 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t33) (local.get $v18))
    (i32.store offset=16 (local.get $t33) (local.get $v21))
    (local.set $v22 (local.get $t33))
    (local.set $v23 (i32.const 2))
    (local.set $t36 (call $alloc (i32.const 24)))
    (i32.store offset=8 (local.get $t36) (local.get $v22))
    (i32.store offset=16 (local.get $t36) (local.get $v23))
    (local.set $v24 (local.get $t36))
    (local.set $v25 (i32.const 1))
    (if (local.get $v25)
        (then
            (local.set $t39 (call $alloc (i32.const 16)))
            (i32.store (local.get $t39) (i32.const 1))
            (i32.store offset=8 (local.get $t39) (local.get $v24))
            (local.set $v28 (local.get $t39))
        )
        (else
            (local.set $t40 (call $alloc (i32.const 8)))
            (i32.store (local.get $t40) (i32.const 0))
            (local.set $v28 (local.get $t40))
        ))
    (local.set $t42 (call $alloc (i32.const 16)))
    (i32.store offset=8 (local.get $t42) (local.get $v28))
    (local.set $v29 (local.get $t42))
    (local.set $v30 (i32.load offset=8 (i32.add (local.get $v15) (i32.mul (i32.const 0) (i32.const 8)))))
    (i32.store offset=8 (local.get $v30) (local.get $v29))
    (local.set $v31 (i32.load offset=8 (local.get $v30)))
    (local.set $v32 (i32.load offset=8 (local.get $v31)))
    (return (call $score_0 (local.get $v32)))
    (unreachable)
  )
  (data (i32.const 72) "\02\00\00\00no")
  (data (i32.const 80) "\02\00\00\00zz")
  (data (i32.const 88) "\02\00\00\00hi")
  (data (i32.const 96) "\02\00\00\00yo")
  (func $_start (export "_start")
    (call $proc_exit (call $spiralMain)))
)
