(module (type $0 (func)) (type $1 (func (param i32 i64) (result i32))) (type $2 (func (param i32) (result i32))) (type $3 (func (result i32))) (import "env" "putchar" (func $putchar (param i32) (result i32))) (import "env" "getchar" (func $getchar (result i32))) (memory $mem 2 2) (export "c" (func $c)) (export "main" (func $main)) (export "mem" (memory $mem)) (func $c (local $0 i32) (local $1 i64) (local $2 i64) (loop $shape$1$continue (if (i32.eq (local.tee $0 (i32.load8_u (i32.wrap_i64 (local.tee $1 (i64.load (i32.const 0) ) ) ) ) ) (i32.const 45) ) (then (i32.store8 (i32.wrap_i64 (local.tee $1 (i64.load (i32.const 65545) ) ) ) (i32.sub (i32.load8_u (i32.wrap_i64 (local.get $1) ) ) (i32.const 1) ) ) ) (else (block $block$46$break (if (i32.lt_u (local.get $0) (i32.const 45) ) (then (if (i32.eq (local.get $0) (i32.const 43) ) (then (i32.store8 (i32.wrap_i64 (local.tee $1 (i64.load (i32.const 65545) ) ) ) (i32.add (i32.load8_u (i32.wrap_i64 (local.get $1) ) ) (i32.const 1) ) ) (br $block$46$break) ) ) (if (i32.ge_u (local.get $0) (i32.const 43) ) (then (local.set $0 (call $getchar) ) (i32.store8 (i32.wrap_i64 (i64.load (i32.const 65545) ) ) (local.get $0) ) ) ) ) (else (block $block$30$break (if (i32.eq (local.get $0) (i32.const 60) ) (then (i64.store (i32.const 65545) (i64.sub (i64.load (i32.const 65545) ) (i64.const 1) ) ) (br $block$46$break) ) ) (if (i32.lt_u (local.get $0) (i32.const 60) ) (then (if (i32.eq (local.get $0) (i32.const 46) ) (then (drop (call $putchar (i32.load8_u (i32.wrap_i64 (i64.load (i32.const 65545) ) ) ) ) ) (br $block$46$break) ) (else (br $block$30$break) ) ) ) ) (if (i32.eq (local.get $0) (i32.const 91) ) (then (if (i32.eqz (i32.load8_u (i32.wrap_i64 (i64.load (i32.const 65545) ) ) ) ) (then (local.set $0 (i32.const 1) ) (loop $shape$28$continue (if (local.get $0) (then (i64.store (i32.const 0) (local.tee $2 (i64.add (local.get $1) (i64.const 1) ) ) ) (if (i32.eq (i32.load8_u (i32.wrap_i64 (local.get $2) ) ) (i32.const 91) ) (then (local.set $0 (i32.add (local.get $0) (i32.const 1) ) ) ) (else (if (i32.eq (i32.load8_u (i32.wrap_i64 (i64.add (local.get $1) (i64.const 1) ) ) ) (i32.const 93) ) (then (local.set $0 (i32.sub (local.get $0) (i32.const 1) ) ) ) ) ) ) (local.set $1 (local.get $2) ) (br $shape$28$continue) ) ) ) ) ) (br $block$46$break) ) ) (if (i32.lt_u (local.get $0) (i32.const 91) ) (then (if (i32.eq (local.get $0) (i32.const 62) ) (then (i64.store (i32.const 65545) (i64.add (i64.load (i32.const 65545) ) (i64.const 1) ) ) (br $block$46$break) ) (else (br $block$30$break) ) ) ) ) (br_if $block$30$break (i32.ne (local.get $0) (i32.const 93) ) ) (if (i32.load8_u (i32.wrap_i64 (i64.load (i32.const 65545) ) ) ) (then (local.set $0 (i32.const 1) ) (loop $shape$52$continue (if (local.get $0) (then (i64.store (i32.const 0) (local.tee $2 (i64.sub (local.get $1) (i64.const 1) ) ) ) (if (i32.eq (i32.load8_u (i32.wrap_i64 (local.get $2) ) ) (i32.const 93) ) (then (local.set $0 (i32.add (local.get $0) (i32.const 1) ) ) ) (else (if (i32.eq (i32.load8_u (i32.wrap_i64 (i64.sub (local.get $1) (i64.const 1) ) ) ) (i32.const 91) ) (then (local.set $0 (i32.sub (local.get $0) (i32.const 1) ) ) ) ) ) ) (local.set $1 (local.get $2) ) (br $shape$52$continue) ) ) ) ) ) ) ) ) ) ) ) (i64.store (i32.const 0) (local.tee $1 (i64.add (i64.load (i32.const 0) ) (i64.const 1) ) ) ) (br_if $shape$1$continue (i32.load8_u (i32.wrap_i64 (local.get $1) ) ) ) ) ) (func $main (param $0 i32) (param $1 i64) (result i32) (if (result i32) (i32.lt_s (local.get $0) (i32.const 2) ) (then (i32.const 1) ) (else (i64.store (i32.const 0) (i64.load (i32.wrap_i64 (i64.add (local.get $1) (i64.const 8) ) ) ) ) (i64.store (i32.const 65545) (i64.const 8) ) (call $c) (i32.const 0) ) ) ) )