(module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "printf" (func $printf (param i32 i32) (result i32))) (import "env" "__handle_stack_overflow" (func $__handle_stack_overflow)) (memory $0 2) (data (i32.const 568) "%d:%d\n\00Result: %d\n\00") (table $0 1 1 funcref) (global $global$0 (mut i32) (i32.const 66128)) (global $global$1 i32 (i32.const 66128)) (global $global$2 i32 (i32.const 587)) (global $__stack_limit (mut i32) (i32.const 0)) (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_limit" (func $__set_stack_limit)) (export "stackSave" (func $stackSave)) (export "stackAlloc" (func $stackAlloc)) (export "stackRestore" (func $stackRestore)) (export "__growWasmMemory" (func $__growWasmMemory)) (func $__wasm_call_ctors (; 2 ;) (nop) ) (func $foo (; 3 ;) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (block (if (i32.lt_u (local.tee $3 (local.tee $2 (i32.sub (global.get $global$0) (i32.const 16) ) ) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (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.lt_u (local.tee $4 (i32.add (local.get $2) (i32.const 16) ) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (global.set $global$0 (local.get $4) ) ) (i32.add (local.get $1) (local.get $0) ) ) (func $__original_main (; 4 ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) (block (if (i32.lt_u (local.tee $1 (local.tee $0 (i32.sub (global.get $global$0) (i32.const 16) ) ) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (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.lt_u (local.tee $2 (i32.add (local.get $0) (i32.const 16) ) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (global.set $global$0 (local.get $2) ) ) (i32.const 0) ) (func $main (; 5 ;) (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) (func $__set_stack_limit (; 6 ;) (param $0 i32) (global.set $__stack_limit (local.get $0) ) ) (func $stackSave (; 7 ;) (result i32) (global.get $global$0) ) (func $stackAlloc (; 8 ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (block (if (i32.lt_u (local.tee $2 (local.tee $1 (i32.and (i32.sub (global.get $global$0) (local.get $0) ) (i32.const -16) ) ) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (global.set $global$0 (local.get $2) ) ) (local.get $1) ) (func $stackRestore (; 9 ;) (param $0 i32) (local $1 i32) (if (i32.lt_u (local.tee $1 (local.get $0) ) (global.get $__stack_limit) ) (call $__handle_stack_overflow) ) (global.set $global$0 (local.get $1) ) ) (func $__growWasmMemory (; 10 ;) (param $newSize i32) (result i32) (memory.grow (local.get $newSize) ) ) ) (; --BEGIN METADATA -- { "staticBump": 19, "tableSize": 1, "initializers": [ "__wasm_call_ctors" ], "declares": [ "printf", "__handle_stack_overflow" ], "externs": [ ], "implementedFunctions": [ "___wasm_call_ctors", "_main", "___set_stack_limit", "_stackSave", "_stackAlloc", "_stackRestore", "___growWasmMemory" ], "exports": [ "__wasm_call_ctors", "main", "__set_stack_limit", "stackSave", "stackAlloc", "stackRestore", "__growWasmMemory" ], "namedGlobals": { "__heap_base" : "66128", "__data_end" : "587" }, "invokeFuncs": [ ], "features": [ ], "mainReadsParams": 0 } -- END METADATA -- ;)