(module
 (type $none_=>_none (func))
 (type $i32_=>_none (func (param i32)))
 (import "env" "import" (func $import))
 (memory $0 1 2)
 (global $__asyncify_state (mut i32) (i32.const 0))
 (global $__asyncify_data (mut i32) (i32.const 0))
 (export "asyncify_start_unwind" (func $asyncify_start_unwind))
 (export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
 (export "asyncify_start_rewind" (func $asyncify_start_rewind))
 (export "asyncify_stop_rewind" (func $asyncify_stop_rewind))
 (func $foo (; 1 ;)
  (local $0 i32)
  (local $1 i32)
  (if
   (i32.eq
    (global.get $__asyncify_state)
    (i32.const 2)
   )
   (nop)
  )
  (local.set $0
   (block $__asyncify_unwind (result i32)
    (block
     (block
      (if
       (i32.eq
        (global.get $__asyncify_state)
        (i32.const 2)
       )
       (block
        (i32.store
         (global.get $__asyncify_data)
         (i32.add
          (i32.load
           (global.get $__asyncify_data)
          )
          (i32.const -4)
         )
        )
        (local.set $1
         (i32.load
          (i32.load
           (global.get $__asyncify_data)
          )
         )
        )
       )
      )
      (if
       (if (result i32)
        (i32.eq
         (global.get $__asyncify_state)
         (i32.const 0)
        )
        (i32.const 1)
        (i32.eq
         (local.get $1)
         (i32.const 0)
        )
       )
       (block
        (call $import)
        (if
         (i32.eq
          (global.get $__asyncify_state)
          (i32.const 1)
         )
         (br $__asyncify_unwind
          (i32.const 0)
         )
        )
       )
      )
     )
     (return)
    )
   )
  )
  (block
   (i32.store
    (i32.load
     (global.get $__asyncify_data)
    )
    (local.get $0)
   )
   (i32.store
    (global.get $__asyncify_data)
    (i32.add
     (i32.load
      (global.get $__asyncify_data)
     )
     (i32.const 4)
    )
   )
  )
  (nop)
 )
 (func $bar (; 2 ;)
  (local $0 i32)
  (local $1 i32)
  (if
   (i32.eq
    (global.get $__asyncify_state)
    (i32.const 2)
   )
   (nop)
  )
  (local.set $0
   (block $__asyncify_unwind (result i32)
    (block
     (block
      (if
       (i32.eq
        (global.get $__asyncify_state)
        (i32.const 2)
       )
       (block
        (i32.store
         (global.get $__asyncify_data)
         (i32.add
          (i32.load
           (global.get $__asyncify_data)
          )
          (i32.const -4)
         )
        )
        (local.set $1
         (i32.load
          (i32.load
           (global.get $__asyncify_data)
          )
         )
        )
       )
      )
      (if
       (if (result i32)
        (i32.eq
         (global.get $__asyncify_state)
         (i32.const 0)
        )
        (i32.const 1)
        (i32.eq
         (local.get $1)
         (i32.const 0)
        )
       )
       (block
        (call $import)
        (if
         (i32.eq
          (global.get $__asyncify_state)
          (i32.const 1)
         )
         (br $__asyncify_unwind
          (i32.const 0)
         )
        )
       )
      )
     )
     (return)
    )
   )
  )
  (block
   (i32.store
    (i32.load
     (global.get $__asyncify_data)
    )
    (local.get $0)
   )
   (i32.store
    (global.get $__asyncify_data)
    (i32.add
     (i32.load
      (global.get $__asyncify_data)
     )
     (i32.const 4)
    )
   )
  )
  (nop)
 )
 (func $baz (; 3 ;)
  (call $import)
 )
 (func $other1 (; 4 ;)
  (call $foo)
 )
 (func $other2 (; 5 ;)
  (call $baz)
 )
 (func $asyncify_start_unwind (; 6 ;) (param $0 i32)
  (global.set $__asyncify_state
   (i32.const 1)
  )
  (global.set $__asyncify_data
   (local.get $0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_stop_unwind (; 7 ;)
  (global.set $__asyncify_state
   (i32.const 0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_start_rewind (; 8 ;) (param $0 i32)
  (global.set $__asyncify_state
   (i32.const 2)
  )
  (global.set $__asyncify_data
   (local.get $0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
 (func $asyncify_stop_rewind (; 9 ;)
  (global.set $__asyncify_state
   (i32.const 0)
  )
  (if
   (i32.gt_u
    (i32.load
     (global.get $__asyncify_data)
    )
    (i32.load offset=4
     (global.get $__asyncify_data)
    )
   )
   (unreachable)
  )
 )
)
