summaryrefslogtreecommitdiff
path: root/test/passes/bysyncify_optimize-level=1.txt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-06-15 12:04:16 -0700
committerGitHub <noreply@github.com>2019-06-15 12:04:16 -0700
commit1cd34c211dffa66fa2f2e45f3f9291e8ad836e07 (patch)
tree74fc2c7c15872d2c23d8b7eed7865486069549ce /test/passes/bysyncify_optimize-level=1.txt
parent22ba24118ef04720e6c7605dbaf90b22cdba006f (diff)
downloadbinaryen-1cd34c211dffa66fa2f2e45f3f9291e8ad836e07.tar.gz
binaryen-1cd34c211dffa66fa2f2e45f3f9291e8ad836e07.tar.bz2
binaryen-1cd34c211dffa66fa2f2e45f3f9291e8ad836e07.zip
Bysyncify: async transform for wasm (#2172)
This adds a new pass, Bysyncify, which transforms code to allow unwind and rewinding the call stack and local state. This allows things like coroutines, turning synchronous code asynchronous, etc. The new pass file itself has a large comment on top with docs. So far the tests here seem to show this works, but this hasn't been tested heavily yet. My next step is to hook this up to emscripten as a replacement for asyncify/emterpreter, see emscripten-core/emscripten#8561 Note that this is completely usable by itself, so it could be useful for any language that needs coroutines etc., and not just ones using LLVM and/or emscripten. See docs on the ABI in the pass source.
Diffstat (limited to 'test/passes/bysyncify_optimize-level=1.txt')
-rw-r--r--test/passes/bysyncify_optimize-level=1.txt1541
1 files changed, 1541 insertions, 0 deletions
diff --git a/test/passes/bysyncify_optimize-level=1.txt b/test/passes/bysyncify_optimize-level=1.txt
new file mode 100644
index 000000000..6eb7217e4
--- /dev/null
+++ b/test/passes/bysyncify_optimize-level=1.txt
@@ -0,0 +1,1541 @@
+(module
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$i (func (result i32)))
+ (type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$ii (func (param i32) (result i32)))
+ (import "env" "import" (func $import))
+ (import "env" "import2" (func $import2 (result i32)))
+ (import "env" "import3" (func $import3 (param i32)))
+ (memory $0 1 2)
+ (global $__bysyncify_state (mut i32) (i32.const 0))
+ (global $__bysyncify_data (mut i32) (i32.const 0))
+ (export "bysyncify_start_unwind" (func $bysyncify_start_unwind))
+ (export "bysyncify_start_rewind" (func $bysyncify_start_rewind))
+ (export "bysyncify_stop_rewind" (func $bysyncify_stop_rewind))
+ (func $calls-import (; 3 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local.set $0
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (select
+ (i32.eqz
+ (if (result i32)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block (result i32)
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ (local.get $0)
+ )
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-import2 (; 4 ;) (type $FUNCSIG$i) (result i32)
+ (local $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (select
+ (i32.eqz
+ (if (result i32)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block (result i32)
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ (local.get $1)
+ )
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (local.set $0
+ (call $import2)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (local.get $0)
+ )
+ )
+ (unreachable)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.const 0)
+ )
+ (func $calls-import2-drop (; 5 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local.set $0
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (select
+ (i32.eqz
+ (if (result i32)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block (result i32)
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ (local.get $0)
+ )
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (drop
+ (call $import2)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-nothing (; 6 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $many-locals (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -8)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (local.tee $1
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ (local.set $1
+ (i32.load offset=4
+ (local.get $1)
+ )
+ )
+ )
+ )
+ (local.set $2
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $2
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (loop $l
+ (br_if $l
+ (local.tee $1
+ (i32.div_s
+ (i32.add
+ (local.get $1)
+ (i32.const 1)
+ )
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $2)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (local.get $1)
+ )
+ )
+ (unreachable)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $2)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (local.tee $2
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ (local.get $0)
+ )
+ (i32.store offset=4
+ (local.get $2)
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 8)
+ )
+ )
+ (i32.const 0)
+ )
+ (func $calls-import2-if (; 8 ;) (type $FUNCSIG$vi) (param $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (local.get $0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-import2-if-else (; 9 ;) (type $FUNCSIG$vi) (param $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (local.get $0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import3
+ (i32.const 1)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (i32.eqz
+ (local.get $0)
+ )
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (select
+ (i32.eq
+ (local.get $1)
+ (i32.const 1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import3
+ (i32.const 2)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 1)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-import2-if-else-oneside (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (local.get $0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.or
+ (i32.eqz
+ (local.get $0)
+ )
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import3
+ (i32.const 2)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (i32.const 3)
+ )
+ )
+ (unreachable)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.const 0)
+ )
+ (func $calls-import2-if-else-oneside2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (local.get $0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import3
+ (i32.const 1)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.or
+ (i32.eqz
+ (local.get $0)
+ )
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (return
+ (i32.const 3)
+ )
+ )
+ (unreachable)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.const 0)
+ )
+ (func $calls-loop (; 12 ;) (type $FUNCSIG$vi) (param $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (loop $l
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import3
+ (i32.const 1)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (br_if $l
+ (local.tee $0
+ (i32.add
+ (local.get $0)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-loop2 (; 13 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (local.set $1
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $1
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (loop $l
+ (if
+ (select
+ (i32.eqz
+ (local.get $1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (local.set $0
+ (call $import2)
+ )
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (br_if $l
+ (local.get $0)
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $1)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $calls-mix (; 14 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local.set $0
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (call $boring)
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $0)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (call $boring)
+ )
+ (if
+ (select
+ (i32.eq
+ (local.get $0)
+ (i32.const 1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 1)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $boring (; 15 ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $calls-mix-deep (; 16 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local.set $0
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (local.set $0
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (call $boring-deep)
+ )
+ (if
+ (select
+ (i32.eqz
+ (local.get $0)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import-deep)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (global.get $__bysyncify_state)
+ )
+ (call $boring)
+ )
+ (if
+ (select
+ (i32.eq
+ (local.get $0)
+ (i32.const 1)
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 1)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $boring-deep (; 17 ;) (type $FUNCSIG$v)
+ (call $boring)
+ )
+ (func $import-deep (; 18 ;) (type $FUNCSIG$v)
+ (local $0 i32)
+ (local.set $0
+ (block $__bysyncify_unwind (result i32)
+ (if
+ (select
+ (i32.eqz
+ (if (result i32)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 2)
+ )
+ (block (result i32)
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const -4)
+ )
+ )
+ (i32.load
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ )
+ )
+ (local.get $0)
+ )
+ )
+ (i32.const 1)
+ (global.get $__bysyncify_state)
+ )
+ (block
+ (call $import)
+ (drop
+ (br_if $__bysyncify_unwind
+ (i32.const 0)
+ (i32.eq
+ (global.get $__bysyncify_state)
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ )
+ (return)
+ )
+ )
+ (i32.store
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (local.get $0)
+ )
+ (i32.store
+ (global.get $__bysyncify_data)
+ (i32.add
+ (i32.load
+ (global.get $__bysyncify_data)
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (func $bysyncify_start_unwind (; 19 ;) (param $0 i32)
+ (if
+ (i32.gt_u
+ (i32.load
+ (local.get $0)
+ )
+ (i32.load offset=4
+ (local.get $0)
+ )
+ )
+ (unreachable)
+ )
+ (global.set $__bysyncify_state
+ (i32.const 1)
+ )
+ (global.set $__bysyncify_data
+ (local.get $0)
+ )
+ )
+ (func $bysyncify_start_rewind (; 20 ;) (param $0 i32)
+ (if
+ (i32.gt_u
+ (i32.load
+ (local.get $0)
+ )
+ (i32.load offset=4
+ (local.get $0)
+ )
+ )
+ (unreachable)
+ )
+ (global.set $__bysyncify_state
+ (i32.const 2)
+ )
+ (global.set $__bysyncify_data
+ (local.get $0)
+ )
+ )
+ (func $bysyncify_stop_rewind (; 21 ;)
+ (global.set $__bysyncify_state
+ (i32.const 0)
+ )
+ )
+)