(module
 (type $0 (func (result i32)))
 (type $1 (func (param i32 i32)))
 (import "env" "__stack_pointer" (global $sp (mut i32)))
 (global $__stack_base (mut i32) (i32.const 0))
 (global $__stack_limit (mut i32) (i32.const 0))
 (export "use_stack" (func $use_stack))
 (export "__set_stack_limits" (func $__set_stack_limits))
 (func $use_stack (result i32)
  (local $0 i32)
  (block
   (if
    (i32.or
     (i32.gt_u
      (local.tee $0
       (i32.const 42)
      )
      (global.get $__stack_base)
     )
     (i32.lt_u
      (local.get $0)
      (global.get $__stack_limit)
     )
    )
    (then
     (unreachable)
    )
   )
   (global.set $sp
    (local.get $0)
   )
  )
  (global.get $sp)
 )
 (func $__set_stack_limits (param $0 i32) (param $1 i32)
  (global.set $__stack_base
   (local.get $0)
  )
  (global.set $__stack_limit
   (local.get $1)
  )
 )
)
(module
 (type $0 (func (result i32)))
 (type $1 (func (param i32 i32)))
 (import "env" "__stack_pointer" (global $sp (mut i32)))
 (global $__stack_base (mut i32) (i32.const 0))
 (global $__stack_limit (mut i32) (i32.const 0))
 (global $__stack_base_3 (mut i32) (i32.const 0))
 (global $__stack_limit_3 (mut i32) (i32.const 0))
 (export "use_stack" (func $0))
 (export "__set_stack_limits" (func $__set_stack_limits))
 (func $0 (result i32)
  (unreachable)
 )
 (func $__set_stack_limits (param $0 i32) (param $1 i32)
  (global.set $__stack_base_3
   (local.get $0)
  )
  (global.set $__stack_limit_3
   (local.get $1)
  )
 )
)
