(module (rec (type $ft (;0;) (func (param i32 (ref null $ct)) (result i32))) (type $ct (;1;) (cont $ft)) ) (type (;2;) (func (param i32))) (type (;3;) (func (result i32))) (import "spectest" "print_i32" (func $print-i32 (;0;) (type 2))) (tag $swap (;0;) (type 3) (result i32)) (export "init" (func $init)) (elem (;0;) declare func $f $g) (func $init (;1;) (type 3) (result i32) i32.const 1 ref.func $g cont.new $ct ref.func $f cont.new $ct resume $ct (on $swap switch) ) (func $f (;2;) (type $ft) (param $i i32) (param $nextk (ref null $ct)) (result i32) (local i32 (ref null $ct)) local.get $i local.set 2 local.get $nextk local.set 3 local.get 2 call $print-i32 i32.const 1 local.get 2 i32.add local.get 3 switch $ct $swap local.set 3 local.set 2 local.get 2 call $print-i32 i32.const 1 local.get 2 i32.add local.get 3 switch $ct $swap unreachable ) (func $g (;3;) (type $ft) (param $i i32) (param $nextk (ref null $ct)) (result i32) (local i32 (ref null $ct)) local.get $i local.set 2 local.get $nextk local.set 3 local.get 2 call $print-i32 i32.const 1 local.get 2 i32.add local.get 3 switch $ct $swap local.set 3 local.set 2 local.get 2 call $print-i32 local.get 2 return ) )