+ (func $main (param $event_channel i32) (result i32)
+ block $use_current_channel
+ (; rstack contains channel barriers (numbers lower than 256)
+ which will reset channel to 0 when returning to the quit loop.
+ if an interrupt event is happening, load its handler and set
+ the input channel. ;)
+ get_local $event_channel
+ i32.eqz
+ br_if $use_current_channel
+ get_local $event_channel
+ i32.const 255
+ i32.gt_u
+ br_if $use_current_channel
+ get_global $channel_in_p
+ get_local $event_channel
+ i32.store
+ end
+ get_global $channel_listeners_p
+ get_local $event_channel
+ i32.const 2
+ i32.shl
+ i32.add
+ i32.load