(module
 (type $0 (func (param i32 i32) (result i32)))
 (type $1 (func))
 (type $2 (func (result i32)))
 (type $3 (func (param i32 i32)))
 (import "env" "printf" (func $printf (param i32 i32) (result i32)))
 (global $global$0 (mut i32) (i32.const 66128))
 (global $global$1 i32 (i32.const 66128))
 (global $global$2 i32 (i32.const 587))
 (global $__stack_base (mut i32) (i32.const 0))
 (global $__stack_limit (mut i32) (i32.const 0))
 (memory $0 2)
 (data $0 (i32.const 568) "%d:%d\n\00Result: %d\n\00")
 (table $0 1 1 funcref)
 (export "memory" (memory $0))
 (export "__wasm_call_ctors" (func $__wasm_call_ctors))
 (export "__heap_base" (global $global$1))
 (export "__data_end" (global $global$2))
 (export "main" (func $main))
 (export "__set_stack_limits" (func $__set_stack_limits))
 (func $__wasm_call_ctors
 )
 (func $foo (param $0 i32) (param $1 i32) (result i32)
  (local $2 i32)
  (local $3 i32)
  (local $4 i32)
  (block
   (if
    (i32.or
     (i32.gt_u
      (local.tee $3
       (local.tee $2
        (i32.sub
         (global.get $global$0)
         (i32.const 16)
        )
       )
      )
      (global.get $__stack_base)
     )
     (i32.lt_u
      (local.get $3)
      (global.get $__stack_limit)
     )
    )
    (then
     (unreachable)
    )
   )
   (global.set $global$0
    (local.get $3)
   )
  )
  (i32.store offset=4
   (local.get $2)
   (local.get $1)
  )
  (i32.store
   (local.get $2)
   (local.get $0)
  )
  (drop
   (call $printf
    (i32.const 568)
    (local.get $2)
   )
  )
  (block
   (if
    (i32.or
     (i32.gt_u
      (local.tee $4
       (i32.add
        (local.get $2)
        (i32.const 16)
       )
      )
      (global.get $__stack_base)
     )
     (i32.lt_u
      (local.get $4)
      (global.get $__stack_limit)
     )
    )
    (then
     (unreachable)
    )
   )
   (global.set $global$0
    (local.get $4)
   )
  )
  (i32.add
   (local.get $1)
   (local.get $0)
  )
 )
 (func $__original_main (result i32)
  (local $0 i32)
  (local $1 i32)
  (local $2 i32)
  (block
   (if
    (i32.or
     (i32.gt_u
      (local.tee $1
       (local.tee $0
        (i32.sub
         (global.get $global$0)
         (i32.const 16)
        )
       )
      )
      (global.get $__stack_base)
     )
     (i32.lt_u
      (local.get $1)
      (global.get $__stack_limit)
     )
    )
    (then
     (unreachable)
    )
   )
   (global.set $global$0
    (local.get $1)
   )
  )
  (i32.store
   (local.get $0)
   (call $foo
    (i32.const 1)
    (i32.const 2)
   )
  )
  (drop
   (call $printf
    (i32.const 575)
    (local.get $0)
   )
  )
  (block
   (if
    (i32.or
     (i32.gt_u
      (local.tee $2
       (i32.add
        (local.get $0)
        (i32.const 16)
       )
      )
      (global.get $__stack_base)
     )
     (i32.lt_u
      (local.get $2)
      (global.get $__stack_limit)
     )
    )
    (then
     (unreachable)
    )
   )
   (global.set $global$0
    (local.get $2)
   )
  )
  (i32.const 0)
 )
 (func $main (param $0 i32) (param $1 i32) (result i32)
  (call $__original_main)
 )
 (func $__set_stack_limits (param $0 i32) (param $1 i32)
  (global.set $__stack_base
   (local.get $0)
  )
  (global.set $__stack_limit
   (local.get $1)
  )
 )
)