(module $manager (type $func (;0;) (func)) (type $cont (;1;) (cont $func)) (type (;2;) (func (param i32))) (type (;3;) (func (param (ref $cont)) (result i32))) (type (;4;) (func (param i32) (result i32))) (type (;5;) (func (result i32 (ref $cont)))) (import "generator" "yield" (tag $yield (;0;) (type 2) (param i32))) (table $active (;0;) 0 (ref null $cont)) (export "init" (func $init)) (export "next" (func $next)) (func $init (;0;) (type 3) (param $k (ref $cont)) (result i32) local.get $k i32.const 1 table.grow $active ) (func $next (;1;) (type 4) (param $g i32) (result i32) (local $next_k (ref $cont)) (local $next_v i32) block $on_yield (type 5) (result i32 (ref $cont)) local.get $g table.get $active resume $cont (on $yield $on_yield) i32.const -1 return end local.set $next_k local.set $next_v local.get $g local.get $next_k table.set $active local.get $next_v return ) )