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