(module
 (type $none_=>_none (func))
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $none_=>_i32 (func (result i32)))
 (type $i32_i32_=>_none (func (param i32 i32)))
 (type $i32_=>_none (func (param i32)))
 (type $f64_=>_none (func (param f64)))
 (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
 (import "env" "segfault" (func $segfault (param i32)))
 (memory $0 10)
 (table $0 1 1 funcref)
 (global $stack_ptr (mut i32) (global.get $STACKTOP$asm2wasm$import))
 (func $nothing (; 1 ;)
  (nop)
 )
 (func $not-alive (; 2 ;)
  (local $x i32)
  (local.set $x
   (i32.const 1)
  )
  (call $nothing)
 )
 (func $spill (; 3 ;)
  (local $x i32)
  (local $1 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
 (func $ignore-non-pointers (; 4 ;)
  (local $x i32)
  (local $y i64)
  (local $z f32)
  (local $w f64)
  (local $4 i32)
  (local.set $4
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $4)
    (i32.const 16)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i64.const 1)
   )
   (local.set $z
    (f32.const 1)
   )
   (local.set $w
    (f64.const 1)
   )
   (block
    (i32.store
     (local.get $4)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
  )
  (global.set $stack_ptr
   (local.get $4)
  )
 )
 (func $spill4 (; 5 ;)
  (local $x i32)
  (local $y i32)
  (local $z i32)
  (local $w i32)
  (local $4 i32)
  (local.set $4
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $4)
    (i32.const 16)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i32.const 1)
   )
   (local.set $z
    (i32.const 1)
   )
   (local.set $w
    (i32.const 1)
   )
   (block
    (i32.store
     (local.get $4)
     (local.get $x)
    )
    (i32.store offset=4
     (local.get $4)
     (local.get $y)
    )
    (i32.store offset=8
     (local.get $4)
     (local.get $z)
    )
    (i32.store offset=12
     (local.get $4)
     (local.get $w)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
  )
  (global.set $stack_ptr
   (local.get $4)
  )
 )
 (func $spill5 (; 6 ;)
  (local $x i32)
  (local $y i32)
  (local $z i32)
  (local $w i32)
  (local $a i32)
  (local $5 i32)
  (local.set $5
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $5)
    (i32.const 32)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i32.const 1)
   )
   (local.set $z
    (i32.const 1)
   )
   (local.set $w
    (i32.const 1)
   )
   (local.set $a
    (i32.const 1)
   )
   (block
    (i32.store
     (local.get $5)
     (local.get $x)
    )
    (i32.store offset=4
     (local.get $5)
     (local.get $y)
    )
    (i32.store offset=8
     (local.get $5)
     (local.get $z)
    )
    (i32.store offset=12
     (local.get $5)
     (local.get $w)
    )
    (i32.store offset=16
     (local.get $5)
     (local.get $a)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
   (drop
    (local.get $a)
   )
  )
  (global.set $stack_ptr
   (local.get $5)
  )
 )
 (func $some-alive (; 7 ;)
  (local $x i32)
  (local $y i32)
  (local $2 i32)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (block
   (block
    (i32.store
     (local.get $2)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
 )
 (func $spill-args (; 8 ;) (param $p i32) (param $q i32)
  (local $x i32)
  (local $3 i32)
  (local $4 i32)
  (local $5 i32)
  (local.set $3
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $3)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $4
     (i32.const 1)
    )
    (local.set $5
     (i32.const 2)
    )
    (i32.store offset=8
     (local.get $3)
     (local.get $x)
    )
    (call $spill-args
     (local.get $4)
     (local.get $5)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $3)
  )
 )
 (func $spill-ret (; 9 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $4
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (if
     (i32.const 1)
     (block
      (local.set $2
       (i32.const 2)
      )
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (local.get $2)
      )
     )
     (block
      (local.set $3
       (i32.const 3)
      )
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (local.get $3)
      )
     )
    )
    (i32.const 4)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $4)
 )
 (func $spill-unreachable (; 10 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $2
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (unreachable)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $2)
 )
 (func $spill-call-call0 (; 11 ;) (param $p i32) (result i32)
  (unreachable)
 )
 (func $spill-call-call1 (; 12 ;) (param $p i32) (result i32)
  (local $x i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local $5 i32)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (local.set $5
   (block (result i32)
    (drop
     (block (result i32)
      (local.set $3
       (block (result i32)
        (local.set $4
         (i32.const 1)
        )
        (i32.store offset=4
         (local.get $2)
         (local.get $x)
        )
        (call $spill-call-call1
         (local.get $4)
        )
       )
      )
      (i32.store offset=4
       (local.get $2)
       (local.get $x)
      )
      (call $spill-call-call0
       (local.get $3)
      )
     )
    )
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
  (local.get $5)
 )
 (func $spill-call-ret (; 13 ;) (param $p i32) (result i32)
  (local $x i32)
  (drop
   (call $spill-call-call0
    (return
     (i32.const 1)
    )
   )
  )
  (i32.const 0)
 )
 (func $spill-ret-call (; 14 ;) (param $p i32) (result i32)
  (local $x i32)
  (drop
   (return
    (call $spill-call-call0
     (i32.const 1)
    )
   )
  )
  (i32.const 0)
 )
 (func $spill-ret-ret (; 15 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $3
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (drop
     (block
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (block
        (local.set $2
         (i32.const 1)
        )
        (global.set $stack_ptr
         (local.get $1)
        )
        (return
         (local.get $2)
        )
       )
      )
     )
    )
    (i32.const 0)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $3)
 )
 (func $spill-call-othertype (; 16 ;) (param $y f64)
  (local $x i32)
  (local $2 i32)
  (local $3 f64)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $3
     (f64.const 1)
    )
    (i32.store
     (local.get $2)
     (local.get $x)
    )
    (call $spill-call-othertype
     (local.get $3)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
 )
 (func $spill-call_indirect (; 17 ;)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $2
     (i32.const 123)
    )
    (local.set $3
     (i32.const 456)
    )
    (local.set $4
     (i32.const 789)
    )
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call_indirect (type $i32_i32_=>_none)
     (local.get $2)
     (local.get $3)
     (local.get $4)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
 (func $spill-call_import (; 18 ;)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $2
     (i32.const 200)
    )
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call $segfault
     (local.get $2)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
)
(module
 (type $none_=>_none (func))
 (type $none_=>_i32 (func (result i32)))
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $i32_i32_=>_none (func (param i32 i32)))
 (type $i32_=>_none (func (param i32)))
 (type $f64_=>_none (func (param f64)))
 (import "env" "segfault" (func $segfault (param i32)))
 (memory $0 10)
 (table $0 1 1 funcref)
 (global $stack_ptr (mut i32) (i32.const 1716592))
 (export "stackSave" (func $stack_save))
 (func $stack_save (; 1 ;) (result i32)
  (global.get $stack_ptr)
 )
 (func $nothing (; 2 ;)
  (nop)
 )
 (func $not-alive (; 3 ;)
  (local $x i32)
  (local.set $x
   (i32.const 1)
  )
  (call $nothing)
 )
 (func $spill (; 4 ;)
  (local $x i32)
  (local $1 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
 (func $ignore-non-pointers (; 5 ;)
  (local $x i32)
  (local $y i64)
  (local $z f32)
  (local $w f64)
  (local $4 i32)
  (local.set $4
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $4)
    (i32.const 16)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i64.const 1)
   )
   (local.set $z
    (f32.const 1)
   )
   (local.set $w
    (f64.const 1)
   )
   (block
    (i32.store
     (local.get $4)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
  )
  (global.set $stack_ptr
   (local.get $4)
  )
 )
 (func $spill4 (; 6 ;)
  (local $x i32)
  (local $y i32)
  (local $z i32)
  (local $w i32)
  (local $4 i32)
  (local.set $4
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $4)
    (i32.const 16)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i32.const 1)
   )
   (local.set $z
    (i32.const 1)
   )
   (local.set $w
    (i32.const 1)
   )
   (block
    (i32.store
     (local.get $4)
     (local.get $x)
    )
    (i32.store offset=4
     (local.get $4)
     (local.get $y)
    )
    (i32.store offset=8
     (local.get $4)
     (local.get $z)
    )
    (i32.store offset=12
     (local.get $4)
     (local.get $w)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
  )
  (global.set $stack_ptr
   (local.get $4)
  )
 )
 (func $spill5 (; 7 ;)
  (local $x i32)
  (local $y i32)
  (local $z i32)
  (local $w i32)
  (local $a i32)
  (local $5 i32)
  (local.set $5
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $5)
    (i32.const 32)
   )
  )
  (block
   (local.set $x
    (i32.const 1)
   )
   (local.set $y
    (i32.const 1)
   )
   (local.set $z
    (i32.const 1)
   )
   (local.set $w
    (i32.const 1)
   )
   (local.set $a
    (i32.const 1)
   )
   (block
    (i32.store
     (local.get $5)
     (local.get $x)
    )
    (i32.store offset=4
     (local.get $5)
     (local.get $y)
    )
    (i32.store offset=8
     (local.get $5)
     (local.get $z)
    )
    (i32.store offset=12
     (local.get $5)
     (local.get $w)
    )
    (i32.store offset=16
     (local.get $5)
     (local.get $a)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
   (drop
    (local.get $y)
   )
   (drop
    (local.get $z)
   )
   (drop
    (local.get $w)
   )
   (drop
    (local.get $a)
   )
  )
  (global.set $stack_ptr
   (local.get $5)
  )
 )
 (func $some-alive (; 8 ;)
  (local $x i32)
  (local $y i32)
  (local $2 i32)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (block
   (block
    (i32.store
     (local.get $2)
     (local.get $x)
    )
    (call $nothing)
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
 )
 (func $spill-args (; 9 ;) (param $p i32) (param $q i32)
  (local $x i32)
  (local $3 i32)
  (local $4 i32)
  (local $5 i32)
  (local.set $3
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $3)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $4
     (i32.const 1)
    )
    (local.set $5
     (i32.const 2)
    )
    (i32.store offset=8
     (local.get $3)
     (local.get $x)
    )
    (call $spill-args
     (local.get $4)
     (local.get $5)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $3)
  )
 )
 (func $spill-ret (; 10 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $4
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (if
     (i32.const 1)
     (block
      (local.set $2
       (i32.const 2)
      )
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (local.get $2)
      )
     )
     (block
      (local.set $3
       (i32.const 3)
      )
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (local.get $3)
      )
     )
    )
    (i32.const 4)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $4)
 )
 (func $spill-unreachable (; 11 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $2
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (unreachable)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $2)
 )
 (func $spill-call-call0 (; 12 ;) (param $p i32) (result i32)
  (unreachable)
 )
 (func $spill-call-call1 (; 13 ;) (param $p i32) (result i32)
  (local $x i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local $5 i32)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (local.set $5
   (block (result i32)
    (drop
     (block (result i32)
      (local.set $3
       (block (result i32)
        (local.set $4
         (i32.const 1)
        )
        (i32.store offset=4
         (local.get $2)
         (local.get $x)
        )
        (call $spill-call-call1
         (local.get $4)
        )
       )
      )
      (i32.store offset=4
       (local.get $2)
       (local.get $x)
      )
      (call $spill-call-call0
       (local.get $3)
      )
     )
    )
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
  (local.get $5)
 )
 (func $spill-call-ret (; 14 ;) (param $p i32) (result i32)
  (local $x i32)
  (drop
   (call $spill-call-call0
    (return
     (i32.const 1)
    )
   )
  )
  (i32.const 0)
 )
 (func $spill-ret-call (; 15 ;) (param $p i32) (result i32)
  (local $x i32)
  (drop
   (return
    (call $spill-call-call0
     (i32.const 1)
    )
   )
  )
  (i32.const 0)
 )
 (func $spill-ret-ret (; 16 ;) (result i32)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (local.set $3
   (block (result i32)
    (block
     (i32.store
      (local.get $1)
      (local.get $x)
     )
     (call $nothing)
    )
    (drop
     (local.get $x)
    )
    (drop
     (block
      (global.set $stack_ptr
       (local.get $1)
      )
      (return
       (block
        (local.set $2
         (i32.const 1)
        )
        (global.set $stack_ptr
         (local.get $1)
        )
        (return
         (local.get $2)
        )
       )
      )
     )
    )
    (i32.const 0)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
  (local.get $3)
 )
 (func $spill-call-othertype (; 17 ;) (param $y f64)
  (local $x i32)
  (local $2 i32)
  (local $3 f64)
  (local.set $2
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $2)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $3
     (f64.const 1)
    )
    (i32.store
     (local.get $2)
     (local.get $x)
    )
    (call $spill-call-othertype
     (local.get $3)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $2)
  )
 )
 (func $spill-call_indirect (; 18 ;)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $2
     (i32.const 123)
    )
    (local.set $3
     (i32.const 456)
    )
    (local.set $4
     (i32.const 789)
    )
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call_indirect (type $i32_i32_=>_none)
     (local.get $2)
     (local.get $3)
     (local.get $4)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
 (func $spill-call_import (; 19 ;)
  (local $x i32)
  (local $1 i32)
  (local $2 i32)
  (local.set $1
   (global.get $stack_ptr)
  )
  (global.set $stack_ptr
   (i32.add
    (local.get $1)
    (i32.const 16)
   )
  )
  (block
   (block
    (local.set $2
     (i32.const 200)
    )
    (i32.store
     (local.get $1)
     (local.get $x)
    )
    (call $segfault
     (local.get $2)
    )
   )
   (drop
    (local.get $x)
   )
  )
  (global.set $stack_ptr
   (local.get $1)
  )
 )
)
