(module
 (type $0 (func (result i32)))
 (type $1 (func))
 (type $2 (func (param i32)))
 (import "spectest" "print" (func $print (param i32)))
 (memory $0 1 1)
 (export "mem" (memory $0))
 (start $main)
 (func $check (result i32)
  (if
   (i32.eq
    (i32.load
     (i32.const 4)
    )
    (i32.const 108)
   )
   (then
    (unreachable)
   )
  )
  (i32.store
   (i32.const 4)
   (i32.add
    (i32.load
     (i32.const 4)
    )
    (i32.const 4)
   )
  )
  (call $print
   (i32.sub
    (i32.const 0)
    (i32.load offset=4
     (i32.load
      (i32.const 4)
     )
    )
   )
  )
  (i32.load offset=4
   (i32.load
    (i32.const 4)
   )
  )
 )
 (func $main
  (local $0 i32)
  (local $1 i32)
  (i32.store
   (i32.const 8)
   (i32.const 89)
  )
  (i32.store
   (i32.const 12)
   (i32.const 12)
  )
  (i32.store
   (i32.const 16)
   (i32.const 78)
  )
  (i32.store
   (i32.const 20)
   (i32.const 149)
  )
  (i32.store
   (i32.const 24)
   (i32.const 118)
  )
  (i32.store
   (i32.const 28)
   (i32.const 179)
  )
  (i32.store
   (i32.const 32)
   (i32.const 127)
  )
  (i32.store
   (i32.const 36)
   (i32.const 80)
  )
  (i32.store
   (i32.const 40)
   (i32.const 21)
  )
  (i32.store
   (i32.const 44)
   (i32.const 34)
  )
  (i32.store
   (i32.const 48)
   (i32.const 119)
  )
  (i32.store
   (i32.const 52)
   (i32.const 98)
  )
  (i32.store
   (i32.const 56)
   (i32.const 38)
  )
  (i32.store
   (i32.const 60)
   (i32.const 29)
  )
  (i32.store
   (i32.const 64)
   (i32.const 36)
  )
  (i32.store
   (i32.const 68)
   (i32.const 147)
  )
  (i32.store
   (i32.const 72)
   (i32.const 13)
  )
  (i32.store
   (i32.const 76)
   (i32.const 55)
  )
  (i32.store
   (i32.const 80)
   (i32.const 166)
  )
  (i32.store
   (i32.const 84)
   (i32.const 16)
  )
  (i32.store
   (i32.const 88)
   (i32.const 143)
  )
  (i32.store
   (i32.const 92)
   (i32.const 52)
  )
  (i32.store
   (i32.const 96)
   (i32.const 130)
  )
  (i32.store
   (i32.const 100)
   (i32.const 150)
  )
  (i32.store
   (i32.const 104)
   (i32.const 176)
  )
  (i32.store
   (i32.const 108)
   (i32.const 91)
  )
  (i32.store
   (i32.const 112)
   (i32.const 34)
  )
  (block
   (block
    (block $block$6$break
     (block $block$5$break
      (block
       (call $print
        (i32.const 0)
       )
       (local.set $0
        (call $check)
       )
      )
      (if
       (i32.eq
        (i32.rem_u
         (local.get $0)
         (i32.const 2)
        )
        (i32.const 0)
       )
       (then
        (local.set $1
         (i32.const 6)
        )
        (br $block$6$break)
       )
       (else
        (block
         (block
          (call $print
           (i32.const 8)
          )
          (local.set $0
           (call $check)
          )
         )
         (block
          (br $block$5$break)
         )
        )
       )
      )
     )
    )
   )
   (loop $shape$3$continue
    (block $block$5$break0
     (if
      (i32.eq
       (local.get $1)
       (i32.const 6)
      )
      (then
       (local.set $1
        (i32.const 0)
       )
       (block
        (call $print
         (i32.const 5)
        )
        (local.set $0
         (call $check)
        )
       )
       (if
        (i32.eq
         (i32.rem_u
          (local.get $0)
          (i32.const 2)
         )
         (i32.const 0)
        )
        (then
         (br $shape$3$continue)
        )
        (else
         (local.set $1
          (i32.const 6)
         )
         (br $shape$3$continue)
        )
       )
      )
     )
    )
    (block
     (block $block$3$break
      (block
       (call $print
        (i32.const 4)
       )
       (local.set $0
        (call $check)
       )
      )
      (if
       (i32.eq
        (i32.rem_u
         (local.get $0)
         (i32.const 3)
        )
        (i32.const 0)
       )
       (then
        (br $shape$3$continue)
       )
       (else
        (if
         (i32.eq
          (i32.rem_u
           (local.get $0)
           (i32.const 3)
          )
          (i32.const 1)
         )
         (then
          (local.set $1
           (i32.const 6)
          )
          (br $shape$3$continue)
         )
         (else
          (br $block$3$break)
         )
        )
       )
      )
     )
     (block
      (block
       (call $print
        (i32.const 2)
       )
       (local.set $0
        (call $check)
       )
      )
      (block
       (local.set $1
        (i32.const 6)
       )
       (br $shape$3$continue)
      )
     )
    )
   )
  )
 )
)
(module
 (type $0 (func (result i32)))
 (type $1 (func))
 (type $2 (func (param i32)))
 (import "spectest" "print" (func $print (param i32)))
 (memory $0 1 1)
 (export "mem" (memory $0))
 (start $main)
 (func $check (result i32)
  (if
   (i32.eq
    (i32.load
     (i32.const 4)
    )
    (i32.const 108)
   )
   (then
    (unreachable)
   )
  )
  (i32.store
   (i32.const 4)
   (i32.add
    (i32.load
     (i32.const 4)
    )
    (i32.const 4)
   )
  )
  (call $print
   (i32.sub
    (i32.const 0)
    (i32.load offset=4
     (i32.load
      (i32.const 4)
     )
    )
   )
  )
  (i32.load offset=4
   (i32.load
    (i32.const 4)
   )
  )
 )
 (func $main
  (local $0 i32)
  (local $1 i32)
  (i32.store
   (i32.const 8)
   (i32.const 89)
  )
  (i32.store
   (i32.const 12)
   (i32.const 12)
  )
  (i32.store
   (i32.const 16)
   (i32.const 78)
  )
  (i32.store
   (i32.const 20)
   (i32.const 149)
  )
  (i32.store
   (i32.const 24)
   (i32.const 118)
  )
  (i32.store
   (i32.const 28)
   (i32.const 179)
  )
  (i32.store
   (i32.const 32)
   (i32.const 127)
  )
  (i32.store
   (i32.const 36)
   (i32.const 80)
  )
  (i32.store
   (i32.const 40)
   (i32.const 21)
  )
  (i32.store
   (i32.const 44)
   (i32.const 34)
  )
  (i32.store
   (i32.const 48)
   (i32.const 119)
  )
  (i32.store
   (i32.const 52)
   (i32.const 98)
  )
  (i32.store
   (i32.const 56)
   (i32.const 38)
  )
  (i32.store
   (i32.const 60)
   (i32.const 29)
  )
  (i32.store
   (i32.const 64)
   (i32.const 36)
  )
  (i32.store
   (i32.const 68)
   (i32.const 147)
  )
  (i32.store
   (i32.const 72)
   (i32.const 13)
  )
  (i32.store
   (i32.const 76)
   (i32.const 55)
  )
  (i32.store
   (i32.const 80)
   (i32.const 166)
  )
  (i32.store
   (i32.const 84)
   (i32.const 16)
  )
  (i32.store
   (i32.const 88)
   (i32.const 143)
  )
  (i32.store
   (i32.const 92)
   (i32.const 52)
  )
  (i32.store
   (i32.const 96)
   (i32.const 130)
  )
  (i32.store
   (i32.const 100)
   (i32.const 150)
  )
  (i32.store
   (i32.const 104)
   (i32.const 176)
  )
  (i32.store
   (i32.const 108)
   (i32.const 91)
  )
  (i32.store
   (i32.const 112)
   (i32.const 34)
  )
  (call $print
   (i32.const 0)
  )
  (if
   (i32.and
    (call $check)
    (i32.const 1)
   )
   (then
    (call $print
     (i32.const 8)
    )
    (drop
     (call $check)
    )
   )
   (else
    (local.set $0
     (i32.const 6)
    )
   )
  )
  (loop $shape$3$continue
   (if
    (i32.eq
     (local.get $0)
     (i32.const 6)
    )
    (then
     (local.set $0
      (i32.const 0)
     )
     (call $print
      (i32.const 5)
     )
     (br_if $shape$3$continue
      (i32.eqz
       (i32.and
        (call $check)
        (i32.const 1)
       )
      )
     )
     (local.set $0
      (i32.const 6)
     )
     (br $shape$3$continue)
    )
   )
   (call $print
    (i32.const 4)
   )
   (br_if $shape$3$continue
    (i32.eqz
     (i32.rem_u
      (local.tee $1
       (call $check)
      )
      (i32.const 3)
     )
    )
   )
   (if
    (i32.eq
     (i32.rem_u
      (local.get $1)
      (i32.const 3)
     )
     (i32.const 1)
    )
    (then
     (local.set $0
      (i32.const 6)
     )
     (br $shape$3$continue)
    )
    (else
     (call $print
      (i32.const 2)
     )
     (drop
      (call $check)
     )
     (local.set $0
      (i32.const 6)
     )
     (br $shape$3$continue)
    )
   )
  )
 )
)
